Class AbstractServiceController

java.lang.Object
com.aspectran.core.service.AbstractServiceController
All Implemented Interfaces:
ServiceController
Direct Known Subclasses:
AbstractCoreService, QuartzSchedulerService

public abstract class AbstractServiceController extends Object implements ServiceController
The Class AbstractServiceController.
  • Constructor Details

    • AbstractServiceController

      public AbstractServiceController(boolean derivable)
  • Method Details

    • getServiceName

      public String getServiceName()
      Description copied from interface: ServiceController
      Returns the name of this service.
      Specified by:
      getServiceName in interface ServiceController
      Returns:
      the name of this service
    • getRootService

      public CoreService getRootService()
      Description copied from interface: ServiceController
      Returns the first created CoreService that holds the ActivityContext.
      Specified by:
      getRootService in interface ServiceController
      Returns:
      the root service
    • setRootService

      protected void setRootService(CoreService rootService)
    • setServiceStateListener

      public void setServiceStateListener(ServiceStateListener serviceStateListener)
      Description copied from interface: ServiceController
      Sets the service state listener.
      Specified by:
      setServiceStateListener in interface ServiceController
      Parameters:
      serviceStateListener - the new service state listener
    • joinDerivedService

      protected void joinDerivedService(ServiceController serviceController)
    • withdrawDerivedService

      protected void withdrawDerivedService(ServiceController serviceController)
    • clearDerivedService

      protected void clearDerivedService()
    • isExposable

      protected boolean isExposable(String transletName)
    • setExposals

      protected void setExposals(String[] includePatterns, String[] excludePatterns)
    • isDerived

      protected abstract boolean isDerived()
      Returns whether this service is derived from another root service.
      Returns:
      whether this service is derived
    • doStart

      protected abstract void doStart() throws Exception
      Throws:
      Exception
    • doPause

      protected abstract void doPause() throws Exception
      Throws:
      Exception
    • doPause

      protected abstract void doPause(long timeout) throws Exception
      Throws:
      Exception
    • doResume

      protected abstract void doResume() throws Exception
      Throws:
      Exception
    • doStop

      protected abstract void doStop() throws Exception
      Throws:
      Exception
    • getLock

      protected Object getLock()
    • start

      public void start() throws Exception
      Description copied from interface: ServiceController
      Starts the service.
      Specified by:
      start in interface ServiceController
      Throws:
      Exception - if the service control fails
    • restart

      public void restart() throws Exception
      Description copied from interface: ServiceController
      Restarts the service.
      Specified by:
      restart in interface ServiceController
      Throws:
      Exception - if the service control fails
    • restart

      public void restart(String message) throws Exception
      Description copied from interface: ServiceController
      Restarts the service.
      Specified by:
      restart in interface ServiceController
      Parameters:
      message - the message to be delivered to the system before restart
      Throws:
      Exception - if the service control fails
    • pause

      public void pause() throws Exception
      Description copied from interface: ServiceController
      Pauses the service.
      Specified by:
      pause in interface ServiceController
      Throws:
      Exception - if the service control fails
    • pause

      public void pause(long timeout) throws Exception
      Description copied from interface: ServiceController
      Pauses the service for a specified period of time.
      Specified by:
      pause in interface ServiceController
      Parameters:
      timeout - the maximum time to wait in milliseconds.
      Throws:
      Exception - if the service control fails
    • resume

      public void resume() throws Exception
      Description copied from interface: ServiceController
      Continues the service after it has been paused.
      Specified by:
      resume in interface ServiceController
      Throws:
      Exception - if the service control fails
    • stop

      public void stop()
      Description copied from interface: ServiceController
      Stops the service. Destroys any services and resources that are dependent on this service.
      Specified by:
      stop in interface ServiceController
    • isActive

      public boolean isActive()
      Description copied from interface: ServiceController
      Returns whether this service is currently started and active.
      Specified by:
      isActive in interface ServiceController
      Returns:
      true, if the service is active; false otherwise
    • isBusy

      public boolean isBusy()
      Description copied from interface: ServiceController
      Returns whether this service has any work in progress.
      Specified by:
      isBusy in interface ServiceController
      Returns:
      true, if this service is busy; false otherwise