public class SamplingService extends Object implements org.apache.synapse.task.Task, ManagedLifecycle
Task injects a message to a given sequence. It also supports
Throttling scenarios.| Constructor and Description |
|---|
SamplingService(MessageProcessor messageProcessor,
SynapseEnvironment synapseEnvironment,
String concurrencyPropName,
String sequencePropName) |
SamplingService(MessageProcessor messageProcessor,
SynapseEnvironment synapseEnvironment,
String concurrencyPropName,
String sequencePropName,
boolean isDeactivatedAtStartup) |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
This method should implement the destroying of the
implemented parts of the configuration.
|
void |
dispatch(MessageContext messageContext)
Sends the message to a given sequence.
|
void |
execute()
Starts the execution of this task which grabs a message from the message
queue and inject it to a given sequence.
|
MessageContext |
fetch()
Receives the next message from the message store.
|
void |
init(SynapseEnvironment se)
This method should implement the initialization of the
implemented parts of the configuration.
|
boolean |
isInitialized()
Checks whether this TaskService is properly initialized or not.
|
boolean |
terminate()
Terminates the job of the message processor.
|
public SamplingService(MessageProcessor messageProcessor, SynapseEnvironment synapseEnvironment, String concurrencyPropName, String sequencePropName)
public SamplingService(MessageProcessor messageProcessor, SynapseEnvironment synapseEnvironment, String concurrencyPropName, String sequencePropName, boolean isDeactivatedAtStartup)
public void execute()
execute in interface org.apache.synapse.task.Taskpublic void init(SynapseEnvironment se)
ManagedLifecycleinit in interface ManagedLifecyclese - SynapseEnvironment to be used for initializationpublic MessageContext fetch()
MessageContext of the last message received from the
store.public void dispatch(MessageContext messageContext)
messageContext - message to be injected.public boolean terminate()
true if the job is terminated successfully,
false otherwise.public boolean isInitialized()
true if this TaskService is properly initialized.
false otherwise.public void destroy()
ManagedLifecycledestroy in interface ManagedLifecycleCopyright © 2005–2024 Apache Software Foundation. All rights reserved.