@ManagedResource(description="Managed TimerEndpoint")
@UriEndpoint(firstVersion="1.0.0",
scheme="timer",
title="Timer",
syntax="timer:timerName",
consumerOnly=true,
category={CORE,SCHEDULING})
public class TimerEndpoint
extends org.apache.camel.support.DefaultEndpoint
implements org.apache.camel.MultipleConsumersSupport
java.util.Timer.
This component is similar to the scheduler component, but has much less functionality.| Modifier | Constructor and Description |
|---|---|
|
TimerEndpoint() |
protected |
TimerEndpoint(String endpointUri,
org.apache.camel.Component component) |
|
TimerEndpoint(String uri,
org.apache.camel.Component component,
String timerName) |
| Modifier and Type | Method and Description |
|---|---|
org.apache.camel.Consumer |
createConsumer(org.apache.camel.Processor processor) |
org.apache.camel.Producer |
createProducer() |
protected void |
doInit() |
protected void |
doStop() |
TimerComponent |
getComponent() |
long |
getDelay() |
String |
getPattern() |
long |
getPeriod() |
long |
getRepeatCount() |
Date |
getTime() |
Timer |
getTimer() |
Timer |
getTimer(TimerConsumer consumer) |
String |
getTimerName() |
boolean |
isDaemon() |
boolean |
isFixedRate() |
boolean |
isIncludeMetadata() |
boolean |
isMultipleConsumersSupported() |
boolean |
isSynchronous() |
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 |
setIncludeMetadata(boolean includeMetadata)
Whether to include metadata in the exchange such as fired time, timer name, timer count etc.
|
void |
setPattern(String pattern)
Allows you to specify a custom Date pattern to use for setting the time option using URI syntax.
|
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 |
setSynchronous(boolean synchronous) |
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, configureExchange, configurePollingConsumer, configureProperties, createAsyncProducer, createEndpointUri, createExchange, createExchange, createPollingConsumer, doStart, equals, getCamelContext, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, isLenientProperties, isPollingConsumerBlockWhenFull, isPollingConsumerCopy, isSingleton, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setComponent, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setLazyStartProducer, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerCopy, setPollingConsumerQueueSize, setProperties, toStringbuild, doBuild, doFail, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic TimerEndpoint()
public TimerEndpoint(String uri, org.apache.camel.Component component, String timerName)
protected TimerEndpoint(String endpointUri, org.apache.camel.Component component)
public TimerComponent getComponent()
getComponent in class org.apache.camel.support.DefaultEndpointpublic org.apache.camel.Producer createProducer()
throws Exception
createProducer in interface org.apache.camel.EndpointExceptionpublic org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor)
throws Exception
createConsumer in interface org.apache.camel.EndpointExceptionprotected void doInit()
throws Exception
doInit in class org.apache.camel.support.DefaultEndpointExceptionprotected void doStop()
throws Exception
doStop in class org.apache.camel.support.DefaultEndpointException@ManagedAttribute public boolean isMultipleConsumersSupported()
isMultipleConsumersSupported in interface org.apache.camel.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)
public String getPattern()
public void setPattern(String pattern)
public Timer getTimer()
public Timer getTimer(TimerConsumer consumer)
@ManagedAttribute(description="Include metadata") public boolean isIncludeMetadata()
@ManagedAttribute(description="Include metadata") public void setIncludeMetadata(boolean includeMetadata)
public boolean isSynchronous()
public void setSynchronous(boolean synchronous)
public void removeTimer(TimerConsumer consumer)
Apache Camel