@ComponentProfile(summary="Generate a static trigger message on a schedule", tag="consumer,base", recommended=NullConnection.class) public class PollingTrigger extends AdaptrisPollingConsumer
Periodically sends a template message to trigger a Workflow
In the adapter configuration file this class is aliased as polling-trigger which is the preferred alternative to the fully qualified classname when building your configuration.
Modifier and Type | Class and Description |
---|---|
static interface |
PollingTrigger.MessageProvider
How to generate the template that will be sent to the workflow.
|
AdaptrisPollingConsumer.LockOperator
log
Constructor and Description |
---|
PollingTrigger() |
PollingTrigger(Poller p) |
PollingTrigger(Poller p,
PollingTrigger.MessageProvider t) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the component.
|
ConsumeDestination |
getDestination()
Deprecated.
|
PollingTrigger.MessageProvider |
getMessageProvider() |
void |
init()
Initialises the component.
|
protected java.lang.String |
newThreadName() |
protected void |
prepareConsumer() |
protected int |
processMessages()
Sends a new
AdaptrisMessage with the configured template as
its payload using the configured producer. |
void |
setDestination(ConsumeDestination destination)
Deprecated.
|
void |
setMessageProvider(PollingTrigger.MessageProvider p) |
void |
start()
Starts the component.
|
void |
stop()
Stop the component
|
continueProcessingMessages, getMaxMessagesPerPoll, getPoller, getReacquireLockBetweenMessages, prepare, releaseLock, setMaxMessagesPerPoll, setPoller, setReacquireLockBetweenMessages
changeState, registerAdaptrisMessageListener, renameThread, requestClose, requestInit, requestStart, requestStop, retrieveAdaptrisMessageListener, retrieveComponentState
createName, createQualifier, decode, encode, getEncoder, getIsTrackingEndpoint, getMessageFactory, getUniqueId, handleConnectionException, isTrackingEndpoint, registerConnection, registerEncoderMessageFactory, retrieveConnection, setEncoder, setIsTrackingEndpoint, setMessageFactory, setUniqueId, withMessageFactory, withUniqueID
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
consumeLocationKey
decode, encode, getEncoder, getMessageFactory, handleConnectionException, registerConnection, retrieveConnection, setEncoder, setMessageFactory
getUniqueId
createName, createQualifier, isTrackingEndpoint
public PollingTrigger()
public PollingTrigger(Poller p, PollingTrigger.MessageProvider t)
public PollingTrigger(Poller p)
protected void prepareConsumer() throws CoreException
prepareConsumer
in class AdaptrisPollingConsumer
CoreException
protected int processMessages()
Sends a new AdaptrisMessage
with the configured template as
its payload using the configured producer.
processMessages
in class AdaptrisPollingConsumer
public void init() throws CoreException
ComponentLifecycle
Component initialisation includes config verification, creation of connections etc.
init
in interface ComponentLifecycle
init
in class AdaptrisPollingConsumer
CoreException
- wrapping any underlying Exception
sComponentLifecycle.init()
public void start() throws CoreException
ComponentLifecycle
Once a component is started it should be ready to process messages. In the case of AdaptrisMessageConsumer
, calling start
will begin message delivery.
start
in interface ComponentLifecycle
start
in class AdaptrisPollingConsumer
CoreException
- wrapping any underlying Exception
sComponentLifecycle.start()
public void stop()
ComponentLifecycle
A stopped component is not expected to be ready to process messages. In the case of AdaptrisMessageConsumer
, calling stop
will pause message delivery. Throwing a RuntimeException
may cause unintended consequences
stop
in interface ComponentLifecycle
stop
in class AdaptrisPollingConsumer
ComponentLifecycle.stop()
public void close()
ComponentLifecycle
A closed component should release any connections it uses, etc. and clean up completely. Throwing a RuntimeException
may
cause unintended consequences
close
in interface ComponentLifecycle
close
in class AdaptrisPollingConsumer
ComponentLifecycle.close()
protected java.lang.String newThreadName()
newThreadName
in class AdaptrisMessageConsumerImp
public PollingTrigger.MessageProvider getMessageProvider()
public void setMessageProvider(PollingTrigger.MessageProvider p)
p
- the templateProvider to set@Deprecated public ConsumeDestination getDestination()
@Deprecated public void setDestination(ConsumeDestination destination)