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 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 message store.void
execute()
Starts the execution of this task which grabs a message from the message queue and dispatch it to a given endpoint.MessageContext
fetch(MessageConsumer msgConsumer)
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.void
sendThroughDeactivateSeq(MessageContext msgCtx)
Sending the out message through the deactivate sequence.void
sendThroughFaultSeq(MessageContext msgCtx)
Sending the out message through the fault sequence.boolean
terminate()
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:
execute
in interfaceorg.apache.synapse.task.Task
-
init
public void init(SynapseEnvironment se) throws SynapseException
Description copied from interface:ManagedLifecycle
This method should implement the initialization of the implemented parts of the configuration.- Specified by:
init
in 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:
MessageContext
of 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
- synapseMessageContext
to be sent
-
sendThroughFaultSeq
public void sendThroughFaultSeq(MessageContext msgCtx)
Sending the out message through the fault sequence.- Parameters:
msgCtx
- SynapseMessageContext
to be sent through the fault sequence.
-
sendThroughDeactivateSeq
public void sendThroughDeactivateSeq(MessageContext msgCtx)
Sending the out message through the deactivate sequence.- Parameters:
msgCtx
- SynapseMessageContext
to be sent through the deactivate sequence.
-
terminate
public boolean terminate()
Terminates the job of the message processor.- Returns:
true
if the job is terminated successfully,false
otherwise.
-
isInitialized
public boolean isInitialized()
Checks whether this TaskService is properly initialized or not.- Returns:
true
if this TaskService is properly initialized.false
otherwise.
-
destroy
public void destroy()
Description copied from interface:ManagedLifecycle
This method should implement the destroying of the implemented parts of the configuration.- Specified by:
destroy
in interfaceManagedLifecycle
-
-