Interface MessageProcessor
-
- All Superinterfaces:
ManagedLifecycle
,Nameable
,SynapseArtifact
- All Known Implementing Classes:
AbstractMessageProcessor
,FailoverScheduledMessageForwardingProcessor
,SamplingProcessor
,ScheduledMessageForwardingProcessor
,ScheduledMessageProcessor
public interface MessageProcessor extends ManagedLifecycle, Nameable, SynapseArtifact
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
activate()
This method is used to activate a deactivated message processor.void
cleanUpDeactivatedProcessors()
Execute clean up tasks of a message processor which were deactivated remotely in cluster modevoid
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.String
getArtifactContainerName()
Get the name of the artifact container from which the message processor deployedString
getFileName()
This method is used to retrieve the configuration file name of the message processor.List<MessageConsumer>
getMessageConsumer()
This method retrieves the message consumer of message processor.String
getMessageStoreName()
This method returns the associated message store name of the message processor.Map<String,Object>
getParameters()
This method is used to retrieve the configuration parameters of message processor.String
getTargetEndpoint()
This method is used to retrieve the associated target endpoint name of the message processor.boolean
isDeactivated()
This method is used to see if the message processor is deactivated.boolean
isEdited()
Whether the message processor edited through the management consoleboolean
isPaused()
This method is used to check if the state is in paused mode.void
pauseService()
This method is only used by the associated forwarding services of message processors.void
resumeRemotely()
Execute resume tasks of a message processor in cluster modevoid
resumeService()
This is the opposite of pauseService method.void
setArtifactContainerName(String artifactContainerName)
Set the name of the artifact container from which the message processor deployedvoid
setFileName(String fileName)
This method is used to set the actual configuration file.void
setIsEdited(boolean isEdited)
Set whether the message processor edited through the management consoleboolean
setMessageConsumer(MessageConsumer messageConsumer)
This method is used to set the message consumer of message processor.void
setMessageStoreName(String messageStoreName)
This method is used to set the associated message store of the message processor.void
setParameters(Map<String,Object> parameters)
This method is used to set configuration parameters of the message processor.void
setTargetEndpoint(String targetEndpoint)
This method set the target endpoint associated with 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.-
Methods inherited from interface org.apache.synapse.ManagedLifecycle
destroy, init
-
Methods inherited from interface org.apache.synapse.SynapseArtifact
getDescription, setDescription
-
-
-
-
Method Detail
-
start
boolean start()
This method is used to start the message processor. Once the message processor is started it will start receiving messages- Returns:
true
if successful,false
otherwise
-
stop
boolean stop()
This method is used to stop the message processor. Once the the message processor is stopped it will no longer receive messages. A stopped message processor cannot re restarted without re-instantiating.- Returns:
true
if successful,false
otherwise
-
deactivate
boolean deactivate()
This method is used to deactivate the message processor. This will temporarily halt executing services.- Returns:
true
if successful,false
otherwise
-
activate
boolean activate()
This method is used to activate a deactivated message processor. Activating message processor will cause the services to start- Returns:
true
if successful,false
otherwise
-
isDeactivated
boolean isDeactivated()
This method is used to see if the message processor is deactivated.- Returns:
true
if successful,false
otherwise
-
setMessageStoreName
void setMessageStoreName(String messageStoreName)
This method is used to set the associated message store of the message processor. Every message processor has to be bound to a message store- Parameters:
messageStoreName
- Name of this message store.
-
getMessageStoreName
String getMessageStoreName()
This method returns the associated message store name of the message processor.- Returns:
- Name of this message store.
-
setParameters
void setParameters(Map<String,Object> parameters)
This method is used to set configuration parameters of the message processor. For example, triggering interval retrying interval, and etc.- Parameters:
parameters
- Message processor parameters.
-
getParameters
Map<String,Object> getParameters()
This method is used to retrieve the configuration parameters of message processor.- Returns:
- the extracted parameters of the message processor configuration
-
setFileName
void setFileName(String fileName)
This method is used to set the actual configuration file. This file has all the configuration related to particular message processor.- Parameters:
fileName
- is the name of the file
-
getFileName
String getFileName()
This method is used to retrieve the configuration file name of the message processor.- Returns:
- the file name
-
setMessageConsumer
boolean setMessageConsumer(MessageConsumer messageConsumer)
This method is used to set the message consumer of message processor. Consumer is the one who is responsible for retrieving messages from a store.- Parameters:
messageConsumer
- is the name of the associated message consumer- Returns:
- is true if the message if the message consumer is returned successfully. Otherwise false.
-
getMessageConsumer
List<MessageConsumer> getMessageConsumer()
This method retrieves the message consumer of message processor.- Returns:
- the message consumer
-
setTargetEndpoint
void setTargetEndpoint(String targetEndpoint)
This method set the target endpoint associated with the message processor. Without a target endpoint a message processor could not operated successfully.- Parameters:
targetEndpoint
- is the name of the associated endpoint
-
getTargetEndpoint
String getTargetEndpoint()
This method is used to retrieve the associated target endpoint name of the message processor.- Returns:
- The name of the endpoint
-
pauseService
void pauseService()
This method is only used by the associated forwarding services of message processors. When the service fails to send the message to the backend it pauses the message processor and starts retrying. Pausing the message processor avoids re-triggering new services till the existing service succeed.
-
resumeService
void resumeService()
This is the opposite of pauseService method. This method resumes a paused method.
-
isPaused
boolean isPaused()
This method is used to check if the state is in paused mode.- Returns:
- returns true on success.
-
cleanupLocalResources
void cleanupLocalResources()
This method is used to cleanup local resources such as JMS connections used by the message processor.
-
isEdited
boolean isEdited()
Whether the message processor edited through the management console- Returns:
- isEdited
-
setIsEdited
void setIsEdited(boolean isEdited)
Set whether the message processor edited through the management console- Parameters:
isEdited
-
-
getArtifactContainerName
String getArtifactContainerName()
Get the name of the artifact container from which the message processor deployed- Returns:
- artifactContainerName
-
setArtifactContainerName
void setArtifactContainerName(String artifactContainerName)
Set the name of the artifact container from which the message processor deployed- Parameters:
artifactContainerName
-
-
cleanUpDeactivatedProcessors
void cleanUpDeactivatedProcessors()
Execute clean up tasks of a message processor which were deactivated remotely in cluster mode
-
resumeRemotely
void resumeRemotely()
Execute resume tasks of a message processor in cluster mode
-
-