Package com.aspectran.core.service
Interface ServiceController
-
- All Known Subinterfaces:
SchedulerService
- All Known Implementing Classes:
AbstractCoreService,AbstractServiceController,AspectranCoreService,QuartzSchedulerService
public interface ServiceControllerThe Interface ServiceController.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetServiceName()Returns the name of this service.booleanisActive()Returns whether this service is currently started and active.booleanisBusy()Returns whether this service has any work in progress.voidpause()Pauses the service.voidpause(long timeout)Pauses the service for a specified period of time.voidrestart()Restarts the service.voidrestart(java.lang.String message)Restarts the service.voidresume()Continues the service after it has been paused.voidsetServiceStateListener(ServiceStateListener serviceStateListener)Sets the service state listener.voidstart()Starts the service.voidstop()Stops the service.
-
-
-
Method Detail
-
getServiceName
java.lang.String getServiceName()
Returns the name of this service.- Returns:
- the name of this service
-
setServiceStateListener
void setServiceStateListener(ServiceStateListener serviceStateListener)
Sets the service state listener.- Parameters:
serviceStateListener- the new service state listener
-
start
void start() throws java.lang.ExceptionStarts the service.- Throws:
java.lang.Exception- if the service control fails
-
restart
void restart() throws java.lang.ExceptionRestarts the service.- Throws:
java.lang.Exception- if the service control fails
-
restart
void restart(java.lang.String message) throws java.lang.ExceptionRestarts the service.- Parameters:
message- the message to be delivered to the system before restart- Throws:
java.lang.Exception- if the service control fails
-
pause
void pause() throws java.lang.ExceptionPauses the service.- Throws:
java.lang.Exception- if the service control fails
-
pause
void pause(long timeout) throws java.lang.ExceptionPauses the service for a specified period of time.- Parameters:
timeout- the maximum time to wait in milliseconds.- Throws:
java.lang.Exception- if the service control fails
-
resume
void resume() throws java.lang.ExceptionContinues the service after it has been paused.- Throws:
java.lang.Exception- if the service control fails
-
stop
void stop()
Stops the service. Destroys any services and resources that are dependent on this service.
-
isActive
boolean isActive()
Returns whether this service is currently started and active.- Returns:
- true, if the service is active; false otherwise
-
isBusy
boolean isBusy()
Returns whether this service has any work in progress.- Returns:
- true, if this service is busy; false otherwise
-
-