@ManagedResource(description="Managed TimerEndpoint") @UriEndpoint(scheme="timer", title="Timer", syntax="timer:timerName", consumerOnly=true, consumerClass=TimerConsumer.class, label="core,scheduling") public class TimerEndpoint extends DefaultEndpoint implements MultipleConsumersSupport
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending| Modifier | Constructor and Description |
|---|---|
|
TimerEndpoint() |
protected |
TimerEndpoint(String endpointUri,
Component component) |
|
TimerEndpoint(String uri,
Component component,
String timerName) |
| Modifier and Type | Method and Description |
|---|---|
Consumer |
createConsumer(Processor processor)
Creates a new Event
Driven Consumer which consumes messages from the endpoint using the
given processor
|
Producer |
createProducer()
Creates a new producer which is used send messages into the endpoint
|
protected void |
doStart()
Implementations override this method to support customized start/stop.
|
protected void |
doStop()
Implementations override this method to support customized start/stop.
|
String |
getCamelId() |
String |
getCamelManagementName() |
TimerComponent |
getComponent()
Returns the component that created this endpoint.
|
long |
getDelay() |
String |
getEndpointUri()
Returns the string representation of the endpoint URI
|
long |
getPeriod() |
long |
getRepeatCount() |
String |
getState() |
Date |
getTime() |
Timer |
getTimer(TimerConsumer consumer) |
String |
getTimerName() |
boolean |
isDaemon() |
boolean |
isFixedRate() |
boolean |
isMultipleConsumersSupported()
Are multiple consumers supported?
|
boolean |
isSingleton()
Whether this class supports being singleton or not.
|
void |
removeTimer(TimerConsumer consumer) |
void |
setDaemon(boolean daemon)
Specifies whether or not the thread associated with the timer endpoint runs as a daemon.
|
void |
setDelay(long delay)
The number of milliseconds to wait before the first event is generated.
|
void |
setFixedRate(boolean fixedRate)
Events take place at approximately regular intervals, separated by the specified period.
|
void |
setPeriod(long period)
If greater than 0, generate periodic events every period milliseconds.
|
void |
setRepeatCount(long repeatCount)
Specifies a maximum limit of number of fires.
|
void |
setTime(Date time)
A java.util.Date the first event should be generated.
|
void |
setTimer(Timer timer)
To use a custom
Timer |
void |
setTimerName(String timerName)
The name of the timer
|
configureConsumer, configurePollingConsumer, configureProperties, createEndpointConfiguration, createEndpointUri, createExchange, createExchange, createExchange, createPollingConsumer, equals, getCamelContext, getConsumerProperties, getEndpointConfiguration, getEndpointKey, getExchangePattern, getId, getPollingConsumerQueueSize, hashCode, isLenientProperties, isPollingConsumerBlockWhenFull, isSynchronous, setCamelContext, setConsumerProperties, setEndpointConfiguration, setEndpointUri, setEndpointUriIfNotSpecified, setExchangePattern, setPollingConsumerBlockWhenFull, setPollingConsumerQueueSize, setProperties, setSynchronous, toStringdoResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendpublic TimerComponent getComponent()
DefaultEndpointgetComponent in class DefaultEndpointpublic Producer createProducer() throws Exception
EndpointcreateProducer in interface EndpointException - can be thrownpublic Consumer createConsumer(Processor processor) throws Exception
EndpointcreateConsumer in interface Endpointprocessor - the given processorException - can be thrownprotected void doStart()
throws Exception
ServiceSupportServiceSupport.doStop() for more details.doStart in class DefaultEndpointExceptionServiceSupport.doStop()protected void doStop()
throws Exception
ServiceSupportServiceSupport.doStop() method when
the service is being stopped. This method will also be invoked
if the service is still in uninitialized state (eg has not
been started). The method is always called to allow the service
to do custom logic when the service is being stopped, such as when
CamelContext is shutting down.doStop in class DefaultEndpointExceptionServiceSupport.doStart()@ManagedAttribute public boolean isMultipleConsumersSupported()
MultipleConsumersSupportisMultipleConsumersSupported in interface MultipleConsumersSupport@ManagedAttribute(description="Timer Name") public String getTimerName()
@ManagedAttribute(description="Timer Name") public void setTimerName(String timerName)
@ManagedAttribute(description="Timer Daemon") public boolean isDaemon()
@ManagedAttribute(description="Timer Daemon") public void setDaemon(boolean daemon)
@ManagedAttribute(description="Timer Delay") public long getDelay()
@ManagedAttribute(description="Timer Delay") public void setDelay(long delay)
@ManagedAttribute(description="Timer FixedRate") public boolean isFixedRate()
@ManagedAttribute(description="Timer FixedRate") public void setFixedRate(boolean fixedRate)
@ManagedAttribute(description="Timer Period") public long getPeriod()
@ManagedAttribute(description="Timer Period") public void setPeriod(long period)
@ManagedAttribute(description="Repeat Count") public long getRepeatCount()
@ManagedAttribute(description="Repeat Count") public void setRepeatCount(long repeatCount)
public Date getTime()
public void setTime(Date time)
@ManagedAttribute(description="Singleton") public boolean isSingleton()
IsSingletonisSingleton in interface IsSingleton@ManagedAttribute(description="Camel id") public String getCamelId()
@ManagedAttribute(description="Camel ManagementName") public String getCamelManagementName()
@ManagedAttribute(description="Endpoint Uri") public String getEndpointUri()
EndpointgetEndpointUri in interface EndpointgetEndpointUri in class DefaultEndpoint@ManagedAttribute(description="Endpoint State") public String getState()
public Timer getTimer(TimerConsumer consumer)
public void removeTimer(TimerConsumer consumer)
Apache Camel