Class SchedulerEndpoint
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.support.DefaultEndpoint
-
- org.apache.camel.support.ScheduledPollEndpoint
-
- org.apache.camel.component.scheduler.SchedulerEndpoint
-
- All Implemented Interfaces:
AutoCloseable
,org.apache.camel.CamelContextAware
,org.apache.camel.Endpoint
,org.apache.camel.IsSingleton
,org.apache.camel.Service
,org.apache.camel.ShutdownableService
,org.apache.camel.spi.HasId
,org.apache.camel.StatefulService
,org.apache.camel.SuspendableService
@UriEndpoint(firstVersion="2.15.0", scheme="scheduler", title="Scheduler", syntax="scheduler:name", consumerOnly=true, category={CORE,SCHEDULING}) public class SchedulerEndpoint extends org.apache.camel.support.ScheduledPollEndpoint
Generate messages in specified intervals usingjava.util.concurrent.ScheduledExecutorService
. This component is similar to the timer component, but it offers more functionality in terms of scheduling. Also this component uses JDK ScheduledExecutorService. Where as the timer uses a JDK Timer.
-
-
Constructor Summary
Constructors Constructor Description SchedulerEndpoint(String uri, SchedulerComponent component, String remaining)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.camel.Consumer
createConsumer(org.apache.camel.Processor processor)
org.apache.camel.Producer
createProducer()
SchedulerComponent
getComponent()
String
getName()
int
getPoolSize()
boolean
isSynchronous()
void
onConsumerStart(SchedulerConsumer consumer)
void
onConsumerStop(SchedulerConsumer consumer)
void
setName(String name)
The name of the schedulervoid
setPoolSize(int poolSize)
Number of core threads in the thread pool used by the scheduling thread pool.void
setSynchronous(boolean synchronous)
-
Methods inherited from class org.apache.camel.support.ScheduledPollEndpoint
configureConsumer, configureProperties, configureScheduledPollConsumerProperties, doConfigureConsumer, doStart, doStop, getBackoffErrorThreshold, getBackoffIdleThreshold, getBackoffMultiplier, getDefaultDelay, getDelay, getInitialDelay, getPollStrategy, getRepeatCount, getRunLoggingLevel, getScheduledExecutorService, getScheduler, getSchedulerProperties, getTimeUnit, isGreedy, isSendEmptyMessageWhenIdle, isStartScheduler, isUseFixedDelay, setBackoffErrorThreshold, setBackoffIdleThreshold, setBackoffMultiplier, setDelay, setGreedy, setInitialDelay, setPollStrategy, setRepeatCount, setRunLoggingLevel, setScheduledExecutorService, setScheduler, setSchedulerProperties, setSendEmptyMessageWhenIdle, setStartScheduler, setTimeUnit, setUseFixedDelay
-
Methods inherited from class org.apache.camel.support.DefaultEndpoint
configureExchange, configurePollingConsumer, createAsyncProducer, createEndpointUri, createExchange, createExchange, createPollingConsumer, doInit, 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, toString
-
Methods inherited from class org.apache.camel.support.service.BaseService
build, 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, suspend
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Constructor Detail
-
SchedulerEndpoint
public SchedulerEndpoint(String uri, SchedulerComponent component, String remaining)
-
-
Method Detail
-
getComponent
public SchedulerComponent getComponent()
- Overrides:
getComponent
in classorg.apache.camel.support.DefaultEndpoint
-
createConsumer
public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor) throws Exception
- Throws:
Exception
-
getName
public String getName()
-
setName
public void setName(String name)
The name of the scheduler
-
getPoolSize
public int getPoolSize()
-
setPoolSize
public void setPoolSize(int poolSize)
Number of core threads in the thread pool used by the scheduling thread pool. Is by default using a single thread
-
isSynchronous
public boolean isSynchronous()
-
setSynchronous
public void setSynchronous(boolean synchronous)
-
onConsumerStart
public void onConsumerStart(SchedulerConsumer consumer)
-
onConsumerStop
public void onConsumerStop(SchedulerConsumer consumer)
-
-