Class FailoverForwardingService
- java.lang.Object
-
- org.apache.synapse.message.processor.impl.failover.FailoverForwardingService
-
- All Implemented Interfaces:
ManagedLifecycle,org.apache.synapse.task.Task
public class FailoverForwardingService extends Object implements org.apache.synapse.task.Task, ManagedLifecycle
This task is responsible for forwarding a request to a given message store.
-
-
Constructor Summary
Constructors Constructor Description FailoverForwardingService(MessageProcessor messageProcessor, SynapseEnvironment synapseEnvironment, long threshouldInterval, boolean isDeactivatedAtStartup)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()This method should implement the destroying of the implemented parts of the configuration.voiddispatch(MessageContext messageContext)Sends the message to a given message store.voidexecute()Starts the execution of this task which grabs a message from the message queue and dispatch it to a given endpoint.MessageContextfetch(MessageConsumer msgConsumer)Receives the next message from the message store.voidinit(SynapseEnvironment se)This method should implement the initialization of the implemented parts of the configuration.booleanisInitialized()Checks whether this TaskService is properly initialized or not.voidsendThroughDeactivateSeq(MessageContext msgCtx)Sending the out message through the deactivate sequence.voidsendThroughFaultSeq(MessageContext msgCtx)Sending the out message through the fault sequence.booleanterminate()Terminates the job of the message processor.
-
-
-
Constructor Detail
-
FailoverForwardingService
public FailoverForwardingService(MessageProcessor messageProcessor, SynapseEnvironment synapseEnvironment, long threshouldInterval, boolean isDeactivatedAtStartup)
-
-
Method Detail
-
execute
public void execute()
Starts the execution of this task which grabs a message from the message queue and dispatch it to a given endpoint.- Specified by:
executein interfaceorg.apache.synapse.task.Task
-
init
public void init(SynapseEnvironment se) throws SynapseException
Description copied from interface:ManagedLifecycleThis method should implement the initialization of the implemented parts of the configuration.- Specified by:
initin interfaceManagedLifecycle- Parameters:
se- SynapseEnvironment to be used for initialization- Throws:
SynapseException
-
fetch
public MessageContext fetch(MessageConsumer msgConsumer) throws StoreForwardException
Receives the next message from the message store.- Parameters:
msgConsumer- message consumer- Returns:
MessageContextof the last message received from the store.- Throws:
StoreForwardException
-
dispatch
public void dispatch(MessageContext messageContext)
Sends the message to a given message store.- Parameters:
messageContext- synapseMessageContextto be sent
-
sendThroughFaultSeq
public void sendThroughFaultSeq(MessageContext msgCtx)
Sending the out message through the fault sequence.- Parameters:
msgCtx- SynapseMessageContextto be sent through the fault sequence.
-
sendThroughDeactivateSeq
public void sendThroughDeactivateSeq(MessageContext msgCtx)
Sending the out message through the deactivate sequence.- Parameters:
msgCtx- SynapseMessageContextto be sent through the deactivate sequence.
-
terminate
public boolean terminate()
Terminates the job of the message processor.- Returns:
trueif the job is terminated successfully,falseotherwise.
-
isInitialized
public boolean isInitialized()
Checks whether this TaskService is properly initialized or not.- Returns:
trueif this TaskService is properly initialized.falseotherwise.
-
destroy
public void destroy()
Description copied from interface:ManagedLifecycleThis method should implement the destroying of the implemented parts of the configuration.- Specified by:
destroyin interfaceManagedLifecycle
-
-