|
||||||||||
| 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 abstract void |
doStart()
|
protected abstract void |
doStop()
|
ServiceStatus |
getStatus()
Returns the current status |
protected String |
getThreadName(String prefix)
Creates a new thread name with the given prefix |
String |
getVersion()
Returns the version of this service |
protected boolean |
isRunAllowed()
Helper methods so the service knows if it should keep running. |
boolean |
isStarted()
|
boolean |
isStarting()
|
boolean |
isStopped()
|
boolean |
isStopping()
|
protected static int |
nextThreadCounter()
|
protected void |
notStarting()
|
protected boolean |
removeChildService(Object childService)
|
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
public void stop()
throws Exception
Service
stop in interface ServiceExceptionpublic ServiceStatus getStatus()
public boolean isStarted()
public boolean isStarting()
public boolean isStopping()
protected boolean isRunAllowed()
public boolean isStopped()
protected abstract void doStart()
throws Exception
Exception
protected abstract void doStop()
throws Exception
Exceptionprotected void notStarting()
protected String getThreadName(String prefix)
protected static int nextThreadCounter()
protected 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 | |||||||||