org.objectweb.jonas.service
Class AbsServiceImpl

java.lang.Object
  extended by javax.management.NotificationBroadcasterSupport
      extended by org.objectweb.jonas.management.ReconfigDispatcher
          extended by org.objectweb.jonas.service.AbsServiceImpl
All Implemented Interfaces:
javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, ReconfigDispatcherMBean, Service
Direct Known Subclasses:
AbsDBServiceImpl, AbsDynamicServiceImpl, AbsJmxServiceImpl, AbsJWebContainerServiceImpl, AbsWebServicesServiceImpl, DataBaseServiceImpl, DiscoveryServiceImpl, EarServiceImpl, EJBServiceImpl, HaServiceImpl, JAXRServiceImpl, JmsServiceImpl, JonasSecurityServiceImpl, MailServiceImpl, RegistryServiceImpl, ResourceServiceImpl, TransactionServiceImpl

public abstract class AbsServiceImpl
extends ReconfigDispatcher
implements Service

Abstract implementation of a Service


Field Summary
 
Fields inherited from class org.objectweb.jonas.management.ReconfigDispatcher
RECONFIG_TYPE, SAVE_RECONFIG_TYPE
 
Constructor Summary
AbsServiceImpl()
           
 
Method Summary
protected abstract  void doInit(javax.naming.Context ctx)
          Abstract initialization method to be implemented by sub-classes
protected abstract  void doStart()
          Abstract start-up method to be implemented by sub-classes
protected abstract  void doStop()
          Abstract method for service stopping to be implemented by sub-classes
 java.lang.String getDomainName()
          Return the domain's name of this service.
 java.lang.String getJonasServerName()
          Return the JOnAS server's name of this service.
 java.lang.String getName()
          Returns the service's name
 void init(javax.naming.Context ctx)
          Initialize the service
 boolean isStarted()
          Returns true if the service is started, false otherwise
 void setName(java.lang.String name)
          Set the service's name
 void start()
          Start the service
 void stop()
          Stop the service
 
Methods inherited from class org.objectweb.jonas.management.ReconfigDispatcher
addNotificationListener, getFilter, getHandback, getListener, getNotificationInfo, initLogger, removeNotificationListener, sendReconfigNotification, sendSaveNotification
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
handleNotification, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbsServiceImpl

public AbsServiceImpl()
Method Detail

init

public void init(javax.naming.Context ctx)
          throws ServiceException
Initialize the service

Specified by:
init in interface Service
Parameters:
ctx - configuration of the service
Throws:
ServiceException - service initialization failed

start

public void start()
           throws ServiceException
Start the service

Specified by:
start in interface Service
Throws:
ServiceException - service start-up failed

stop

public void stop()
          throws ServiceException
Stop the service

Specified by:
stop in interface Service
Throws:
ServiceException - service stopping failed

isStarted

public boolean isStarted()
Returns true if the service is started, false otherwise

Specified by:
isStarted in interface Service
Returns:
true if the service is started

getName

public java.lang.String getName()
Returns the service's name

Specified by:
getName in interface Service
Returns:
the service name

setName

public void setName(java.lang.String name)
Set the service's name

Specified by:
setName in interface Service
Parameters:
name - the name to set

getDomainName

public java.lang.String getDomainName()
Return the domain's name of this service.

Returns:
the domain name

getJonasServerName

public java.lang.String getJonasServerName()
Return the JOnAS server's name of this service.

Returns:
the server name

doInit

protected abstract void doInit(javax.naming.Context ctx)
                        throws ServiceException
Abstract initialization method to be implemented by sub-classes

Parameters:
ctx - configuration of the service
Throws:
ServiceException - service initialization failed

doStart

protected abstract void doStart()
                         throws ServiceException
Abstract start-up method to be implemented by sub-classes

Throws:
ServiceException - service start-up failed

doStop

protected abstract void doStop()
                        throws ServiceException
Abstract method for service stopping to be implemented by sub-classes

Throws:
ServiceException - service stopping failed