public abstract class ScheduledMessageProcessor extends AbstractMessageProcessor implements org.apache.synapse.task.TaskManagerObserver
Forwarding and Sampling message Processors.
Mainly
responsible for handling life cycle states of the message processors. Some of
the well known life cycle states are start, pause ,
destroy, deactivate etc.| Modifier and Type | Field and Description |
|---|---|
protected String |
cronExpression
A cron expression to run the sampler
|
protected long |
interval
The interval at which this processor runs , default value is 1000ms
|
protected String[] |
nonRetryStatusCodes
This is specially used for REST scenarios where http status codes can take semantics in a RESTful architecture.
|
protected BlockingMsgSender |
sender |
protected SynapseEnvironment |
synapseEnvironment |
artifactContainerName, configuration, description, fileName, isEdited, messageConsumers, messageStore, name, parameters, targetEndpoint| Constructor and Description |
|---|
ScheduledMessageProcessor() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
activate()
This method is used to activate a deactivated message processor.
|
void |
cleanupLocalResources()
This method is used to cleanup local resources such as JMS connections
used by the message processor.
|
boolean |
deactivate()
This method is used to deactivate the message processor.
|
void |
destroy()
This method should implement the destroying of the
implemented parts of the configuration.
|
void |
destroy(boolean preserveState)
Undeploy the artifact but keeps the current state based on the preserveState argument.
|
boolean |
getActivated() |
boolean |
getIsActivatedParamValue() |
protected abstract org.apache.synapse.task.Task |
getTask()
Gives the
Task instance associated with this processor. |
void |
init(SynapseEnvironment se)
This method should implement the initialization of the
implemented parts of the configuration.
|
boolean |
isActive() |
boolean |
isDeactivated()
This method is used to see if the message processor is deactivated.
|
boolean |
isPaused()
This method is used to check if the state is in paused mode.
|
protected boolean |
isProcessorStartAsDeactivated() |
protected boolean |
isThrottling(long interval)
nTask does not except values less than 1000 for its schedule interval.
|
boolean |
isThrottling(String cronExpression) |
void |
pauseService()
This method is only used by the associated forwarding services of message processors.
|
void |
resumeService()
This is the opposite of pauseService method.
|
void |
setParameters(Map<String,Object> parameters)
This method is used to set configuration parameters of the message processor.
|
boolean |
start()
This method is used to start the message processor.
|
boolean |
stop()
This method is used to stop the message processor.
|
void |
update() |
getArtifactContainerName, getDescription, getFileName, getMessageConsumer, getMessageStoreName, getName, getParameters, getTargetEndpoint, isEdited, setArtifactContainerName, setDescription, setFileName, setIsEdited, setMessageConsumer, setMessageStoreName, setName, setTargetEndpointprotected long interval
protected String cronExpression
protected String[] nonRetryStatusCodes
protected BlockingMsgSender sender
protected SynapseEnvironment synapseEnvironment
public void init(SynapseEnvironment se)
ManagedLifecycleinit in interface ManagedLifecycleinit in class AbstractMessageProcessorse - SynapseEnvironment to be used for initializationpublic boolean getIsActivatedParamValue()
protected boolean isProcessorStartAsDeactivated()
public boolean start()
MessageProcessorstart in interface MessageProcessortrue if successful, false otherwisepublic boolean isDeactivated()
MessageProcessorisDeactivated in interface MessageProcessortrue if successful, false otherwisepublic void setParameters(Map<String,Object> parameters)
MessageProcessorsetParameters in interface MessageProcessorsetParameters in class AbstractMessageProcessorparameters - Message processor parameters.public boolean stop()
MessageProcessorstop in interface MessageProcessortrue if successful, false otherwisepublic void destroy()
ManagedLifecycledestroy in interface ManagedLifecyclepublic void destroy(boolean preserveState)
AbstractMessageProcessordestroy in class AbstractMessageProcessorpreserveState - determine whether to preserve the artifacts state or notpublic boolean deactivate()
MessageProcessordeactivate in interface MessageProcessortrue if successful, false otherwisepublic boolean activate()
MessageProcessoractivate in interface MessageProcessortrue if successful, false otherwisepublic void pauseService()
MessageProcessorpauseService in interface MessageProcessorpublic void resumeService()
MessageProcessorresumeService in interface MessageProcessorpublic boolean isActive()
public boolean isPaused()
MessageProcessorisPaused in interface MessageProcessorpublic boolean getActivated()
protected boolean isThrottling(long interval)
interval - in which scheduler triggers its job.false
otherwise.public boolean isThrottling(String cronExpression)
protected abstract org.apache.synapse.task.Task getTask()
Task instance associated with this processor.Task associated with this processor.public void update()
update in interface org.apache.synapse.task.TaskManagerObserverpublic void cleanupLocalResources()
MessageProcessorcleanupLocalResources in interface MessageProcessorCopyright © 2005–2024 Apache Software Foundation. All rights reserved.