|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.camel.impl.ServiceSupport
public abstract class ServiceSupport
A useful base class which ensures that a service is only initialized once and provides some helper methods for enquiring of its status
| Constructor Summary | |
|---|---|
ServiceSupport()
|
|
| Method Summary | |
|---|---|
protected void |
addChildService(Object childService)
|
protected void |
doShutdown()
|
protected abstract void |
doStart()
|
protected abstract void |
doStop()
|
ServiceStatus |
getStatus()
Returns the current status |
String |
getVersion()
Returns the version of this service |
boolean |
isRunAllowed()
Helper methods so the service knows if it should keep running. |
boolean |
isStarted()
|
boolean |
isStarting()
|
boolean |
isStopped()
|
boolean |
isStopping()
|
protected boolean |
removeChildService(Object childService)
|
void |
shutdown()
Shutdown the service, which means it cannot be started again. |
void |
start()
Starts the service |
void |
stop()
Stops the service |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ServiceSupport()
| Method Detail |
|---|
public void start()
throws Exception
Service
start in interface ServiceException - is thrown if starting failed
public void stop()
throws Exception
Service
stop in interface ServiceException - is thrown if stopping failed
public void shutdown()
throws Exception
ShutdownableService
shutdown in interface ShutdownableServiceException - is thrown if shutting down failedpublic ServiceStatus getStatus()
public boolean isStarted()
public boolean isStarting()
public boolean isStopping()
public boolean isStopped()
public boolean isRunAllowed()
protected abstract void doStart()
throws Exception
Exception
protected abstract void doStop()
throws Exception
Exception
protected void doShutdown()
throws Exception
Exceptionprotected void addChildService(Object childService)
protected boolean removeChildService(Object childService)
public String getVersion()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||