public class TimerListenerManager extends org.apache.camel.support.service.ServiceSupport implements Runnable, org.apache.camel.CamelContextAware, org.apache.camel.StaticService
TimerListener manager which triggers the TimerListener listeners once every
second.
Also ensure when adding and remove listeners, that they are correctly removed to avoid leaking memory.TimerListener,
org.apache.camel.management.ManagedLoadTimer| Constructor and Description |
|---|
TimerListenerManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
addTimerListener(org.apache.camel.TimerListener listener)
Adds the listener.
|
protected void |
doShutdown() |
protected void |
doStart() |
protected void |
doStop() |
org.apache.camel.CamelContext |
getCamelContext() |
long |
getInterval()
Gets the interval in millis.
|
void |
removeTimerListener(org.apache.camel.TimerListener listener)
Removes the listener.
|
void |
run() |
void |
setCamelContext(org.apache.camel.CamelContext camelContext) |
void |
setInterval(long interval)
Sets the interval in millis.
|
build, doBuild, doFail, doInit, doLifecycleChange, doResume, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic void setCamelContext(org.apache.camel.CamelContext camelContext)
setCamelContext in interface org.apache.camel.CamelContextAwarepublic org.apache.camel.CamelContext getCamelContext()
getCamelContext in interface org.apache.camel.CamelContextAwarepublic long getInterval()
public void setInterval(long interval)
interval - interval in millis.public void addTimerListener(org.apache.camel.TimerListener listener)
Object.equals(Object) and Object.hashCode() for the listener to ensure that
we can remove the same listener again, when invoking remove.listener - listenerpublic void removeTimerListener(org.apache.camel.TimerListener listener)
Object.equals(Object) and Object.hashCode() for the listener to ensure that
we can remove the same listener again, when invoking remove.listener - listener.protected void doStart()
throws Exception
doStart in class org.apache.camel.support.service.BaseServiceExceptionprotected void doStop()
throws Exception
doStop in class org.apache.camel.support.service.BaseServiceExceptionApache Camel