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 booleanactivate()This method is used to activate a deactivated message processor.voidcleanUpDeactivatedProcessors()Execute clean up tasks of a message processor which were deactivated remotely in cluster modevoidcleanupLocalResources()This method is used to cleanup local resources such as JMS connections used by the message processor.booleandeactivate()This method is used to deactivate the message processor.StringgetArtifactContainerName()Get the name of the artifact container from which the message processor deployedStringgetFileName()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.StringgetMessageStoreName()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.StringgetTargetEndpoint()This method is used to retrieve the associated target endpoint name of the message processor.booleanisDeactivated()This method is used to see if the message processor is deactivated.booleanisEdited()Whether the message processor edited through the management consolebooleanisPaused()This method is used to check if the state is in paused mode.voidpauseService()This method is only used by the associated forwarding services of message processors.voidresumeRemotely()Execute resume tasks of a message processor in cluster modevoidresumeService()This is the opposite of pauseService method.voidsetArtifactContainerName(String artifactContainerName)Set the name of the artifact container from which the message processor deployedvoidsetFileName(String fileName)This method is used to set the actual configuration file.voidsetIsEdited(boolean isEdited)Set whether the message processor edited through the management consolebooleansetMessageConsumer(MessageConsumer messageConsumer)This method is used to set the message consumer of message processor.voidsetMessageStoreName(String messageStoreName)This method is used to set the associated message store of the message processor.voidsetParameters(Map<String,Object> parameters)This method is used to set configuration parameters of the message processor.voidsetTargetEndpoint(String targetEndpoint)This method set the target endpoint associated with the message processor.booleanstart()This method is used to start the message processor.booleanstop()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:
trueif successful,falseotherwise
-
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:
trueif successful,falseotherwise
-
deactivate
boolean deactivate()
This method is used to deactivate the message processor. This will temporarily halt executing services.- Returns:
trueif successful,falseotherwise
-
activate
boolean activate()
This method is used to activate a deactivated message processor. Activating message processor will cause the services to start- Returns:
trueif successful,falseotherwise
-
isDeactivated
boolean isDeactivated()
This method is used to see if the message processor is deactivated.- Returns:
trueif successful,falseotherwise
-
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
-
-