Class AbstractMessageProcessor
- java.lang.Object
-
- org.apache.synapse.message.processor.impl.AbstractMessageProcessor
-
- All Implemented Interfaces:
ManagedLifecycle,MessageProcessor,Nameable,SynapseArtifact
- Direct Known Subclasses:
ScheduledMessageProcessor
public abstract class AbstractMessageProcessor extends Object implements MessageProcessor
ClassAbstractMessageProcessoris handles Message processing of the messages in Message Store. Abstract Message Store is assumes that Message processors can be implemented using the quartz scheduler jobs. If in case we user wants a different implementation They can directly useMessageProcessorinterface for that implementations
-
-
Field Summary
Fields Modifier and Type Field Description protected StringartifactContainerNameName of the artifact container from which the message processor deployedprotected SynapseConfigurationconfigurationprotected Stringdescriptionprotected StringfileNameprotected booleanisEditedWhether the message processor edited via the management consoleprotected List<MessageConsumer>messageConsumersprotected StringmessageStoreMessage Store associated with Message processorprotected Stringnameprotected Map<String,Object>parametersmessage store parametersprotected StringtargetEndpointThis attribute is only need for forwarding message processor.
-
Constructor Summary
Constructors Constructor Description AbstractMessageProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy(boolean preserveState)Undeploy the artifact but keeps the current state based on the preserveState argument.voiddestroy(boolean preserveState, boolean isUpdate)Destroy the artifacts.StringgetArtifactContainerName()Get the name of the artifact container from which the message processor deployedStringgetDescription()Retrieves the description of the artifactStringgetFileName()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.StringgetName()Get the name of an abstractionMap<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.voidinit(SynapseEnvironment se)This method should implement the initialization of the implemented parts of the configuration.booleanisEdited()Whether the message processor edited through the management consolevoidsetArtifactContainerName(String artifactContainerName)Set the name of the artifact container from which the message processor deployedvoidsetDescription(String description)Set the description of the artifactvoidsetFileName(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 consumer)This method is used to set the message consumer of message processor.voidsetMessageStoreName(String messageStore)This method is used to set the associated message store of the message processor.voidsetName(String name)Set the name of an abstractionvoidsetParameters(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.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.synapse.ManagedLifecycle
destroy
-
Methods inherited from interface org.apache.synapse.message.processor.MessageProcessor
activate, cleanUpDeactivatedProcessors, cleanupLocalResources, deactivate, isDeactivated, isPaused, pauseService, resumeRemotely, resumeService, start, stop
-
-
-
-
Field Detail
-
messageStore
protected String messageStore
Message Store associated with Message processor
-
description
protected String description
-
name
protected String name
-
fileName
protected String fileName
-
configuration
protected SynapseConfiguration configuration
-
messageConsumers
protected List<MessageConsumer> messageConsumers
-
artifactContainerName
protected String artifactContainerName
Name of the artifact container from which the message processor deployed
-
isEdited
protected boolean isEdited
Whether the message processor edited via the management console
-
targetEndpoint
protected String targetEndpoint
This attribute is only need for forwarding message processor. However, it here because then we don't need to implement this in sampling processor with nothing
-
-
Method Detail
-
init
public void init(SynapseEnvironment se)
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
-
setMessageStoreName
public void setMessageStoreName(String messageStore)
Description copied from interface:MessageProcessorThis method is used to set the associated message store of the message processor. Every message processor has to be bound to a message store- Specified by:
setMessageStoreNamein interfaceMessageProcessor- Parameters:
messageStore- Name of this message store.
-
getMessageStoreName
public String getMessageStoreName()
Description copied from interface:MessageProcessorThis method returns the associated message store name of the message processor.- Specified by:
getMessageStoreNamein interfaceMessageProcessor- Returns:
- Name of this message store.
-
setParameters
public void setParameters(Map<String,Object> parameters)
Description copied from interface:MessageProcessorThis method is used to set configuration parameters of the message processor. For example, triggering interval retrying interval, and etc.- Specified by:
setParametersin interfaceMessageProcessor- Parameters:
parameters- Message processor parameters.
-
getParameters
public Map<String,Object> getParameters()
Description copied from interface:MessageProcessorThis method is used to retrieve the configuration parameters of message processor.- Specified by:
getParametersin interfaceMessageProcessor- Returns:
- the extracted parameters of the message processor configuration
-
getName
public String getName()
Description copied from interface:NameableGet the name of an abstraction
-
setName
public void setName(String name)
Description copied from interface:NameableSet the name of an abstraction
-
setDescription
public void setDescription(String description)
Description copied from interface:SynapseArtifactSet the description of the artifact- Specified by:
setDescriptionin interfaceSynapseArtifact- Parameters:
description- tobe set to the artifact
-
getDescription
public String getDescription()
Description copied from interface:SynapseArtifactRetrieves the description of the artifact- Specified by:
getDescriptionin interfaceSynapseArtifact- Returns:
- description of the artifact
-
setFileName
public void setFileName(String filename)
Description copied from interface:MessageProcessorThis method is used to set the actual configuration file. This file has all the configuration related to particular message processor.- Specified by:
setFileNamein interfaceMessageProcessor- Parameters:
filename- is the name of the file
-
getFileName
public String getFileName()
Description copied from interface:MessageProcessorThis method is used to retrieve the configuration file name of the message processor.- Specified by:
getFileNamein interfaceMessageProcessor- Returns:
- the file name
-
getMessageConsumer
public List<MessageConsumer> getMessageConsumer()
Description copied from interface:MessageProcessorThis method retrieves the message consumer of message processor.- Specified by:
getMessageConsumerin interfaceMessageProcessor- Returns:
- the message consumer
-
setMessageConsumer
public boolean setMessageConsumer(MessageConsumer consumer)
Description copied from interface:MessageProcessorThis method is used to set the message consumer of message processor. Consumer is the one who is responsible for retrieving messages from a store.- Specified by:
setMessageConsumerin interfaceMessageProcessor- Parameters:
consumer- is the name of the associated message consumer- Returns:
- is true if the message if the message consumer is returned successfully. Otherwise false.
-
setTargetEndpoint
public void setTargetEndpoint(String targetEndpoint)
Description copied from interface:MessageProcessorThis method set the target endpoint associated with the message processor. Without a target endpoint a message processor could not operated successfully.- Specified by:
setTargetEndpointin interfaceMessageProcessor- Parameters:
targetEndpoint- is the name of the associated endpoint
-
getTargetEndpoint
public String getTargetEndpoint()
Description copied from interface:MessageProcessorThis method is used to retrieve the associated target endpoint name of the message processor.- Specified by:
getTargetEndpointin interfaceMessageProcessor- Returns:
- The name of the endpoint
-
isEdited
public boolean isEdited()
Whether the message processor edited through the management console- Specified by:
isEditedin interfaceMessageProcessor- Returns:
- isEdited
-
setIsEdited
public void setIsEdited(boolean isEdited)
Set whether the message processor edited through the management console- Specified by:
setIsEditedin interfaceMessageProcessor- Parameters:
isEdited-
-
getArtifactContainerName
public String getArtifactContainerName()
Get the name of the artifact container from which the message processor deployed- Specified by:
getArtifactContainerNamein interfaceMessageProcessor- Returns:
- artifactContainerName
-
setArtifactContainerName
public void setArtifactContainerName(String artifactContainerName)
Set the name of the artifact container from which the message processor deployed- Specified by:
setArtifactContainerNamein interfaceMessageProcessor- Parameters:
artifactContainerName-
-
destroy
public void destroy(boolean preserveState)
Undeploy the artifact but keeps the current state based on the preserveState argument. if true keep the current state, else remove the state as well as the artifact.- Parameters:
preserveState- determine whether to preserve the artifacts state or not
-
destroy
public void destroy(boolean preserveState, boolean isUpdate)Destroy the artifacts.- Parameters:
preserveState- whether to preserve state in registry.isUpdate- whether this is triggered in artifact update flow.
-
-