Package org.apache.synapse.core
Interface SynapseEnvironment
-
- All Known Implementing Classes:
Axis2SynapseEnvironment
public interface SynapseEnvironmentThe SynapseEnvironment allows access into the the host SOAP engine. It allows the sending of messages, class loader access etc.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddUnavailableArtifactRef(String key)Add an artifact reference not available in the environment.voidclearUnavailabilityOfArtifact(String key)Clear unavailability of an artifact if it is previously marked as unavailable in the environmentMessageContextcreateMessageContext()Creates a new SynapseMessageContextinstance.org.apache.axiom.util.blob.OverflowBlobcreateOverflowBlob()Creates a newTemporaryDatainstance for the temp storage requirementsExecutorServicegetExecutorService()This is used by anyone who needs access to a SynapseThreadPool.longgetGlobalTimeout()Get the global timeout interval for callbacksMessageDataStoregetMessageDataStore()This method returns message data store which holds a queue of event holder objects.ServerContextInformationgetServerContextInformation()Get the information about the synapse environment.SynapseConfigurationgetSynapseConfiguration()Retrieves theSynapseConfigurationfrom theenvironmentSynapseDebugManagergetSynapseDebugManager()Retrieve theSynapseDebugManagerfrom theenvironment.List<SynapseHandler>getSynapseHandlers()Get all synapse handlersorg.apache.synapse.task.SynapseTaskManagergetTaskManager()Retrieve theSynapseTaskManagerfrom theenvironment.TenantInfoConfiguratorgetTenantInfoConfigurator()Map<String,SynapseXpathFunctionContextProvider>getXpathFunctionExtensions()Get all Xpath Extension objects for Function contextsMap<QName,SynapseXpathVariableResolver>getXpathVariableExtensions()Get all Xpath Extension objects for Variable contextsvoidinjectAsync(MessageContext smc, SequenceMediator seq)This method injects a new message into the Synapse engine for the mediation by the specified sequence.booleaninjectInbound(MessageContext smc, SequenceMediator seq, boolean sequential)This method injects a new message into the Synapse engine for the mediation by the specified sequence.booleaninjectMessage(MessageContext smc)This method injects a new message into the Synapse engine.booleaninjectMessage(MessageContext smc, SequenceMediator seq)Inject message to the sequence in synchronous mannerbooleanisContinuationEnabled()Whether continuation is enabled in the environmentbooleanisDebuggerEnabled()Whether debugging is enabled in the environment.booleanisInitialized()Has the Synapse Environment properly initialized?voidregisterSynapseHandler(SynapseHandler handler)Register a synapse handler to the synapse environmentvoidremoveUnavailableArtifactRef(String key)Remove the artifact reference which is marked as unavailable in environment from the unavailable listvoidsend(EndpointDefinition endpoint, MessageContext smc)This method allows a message to be sent through the underlying SOAP engine.voidsetInitialized(boolean state)Set the environment as ready for message processingvoidupdateCallMediatorCount(boolean isIncrement)Increment/Decrement the Call mediator count in the environment by 1
-
-
-
Method Detail
-
injectMessage
boolean injectMessage(MessageContext smc)
This method injects a new message into the Synapse engine. This is used by the underlying SOAP engine to inject messages into Synapse for mediation. e.g. The SynapseMessageReceiver used by Axis2 invokes this to inject new messages- Parameters:
smc- - Synapse MessageContext to be injected- Returns:
- boolean true if the message processing should be continued and false if it should be aborted
-
injectAsync
void injectAsync(MessageContext smc, SequenceMediator seq)
This method injects a new message into the Synapse engine for the mediation by the specified sequence. This is used by custom mediation tasks like splitting message in EIP mediation. This method will do the mediation asynchronously using a separate thread from the environment thread pool- Parameters:
smc- - Synapse message context to be injectedseq- - Sequence to be used for mediation
-
injectInbound
boolean injectInbound(MessageContext smc, SequenceMediator seq, boolean sequential)
This method injects a new message into the Synapse engine for the mediation by the specified sequence. This is used by inbound pooling listeners in EIP mediation. This method will do the mediation asynchronously or synchronously using a separate thread from the environment thread pool- Parameters:
smc- - Synapse message context to be injectedseq- - Sequence to be used for mediationsequential- - Injection behavior- Returns:
- a Boolean Status of the injection
-
send
void send(EndpointDefinition endpoint, MessageContext smc)
This method allows a message to be sent through the underlying SOAP engine. This will send request messages on (forward), and send the response messages back to the client- Parameters:
endpoint- - Endpoint to be used for sendingsmc- - Synapse MessageContext to be sent
-
createMessageContext
MessageContext createMessageContext()
Creates a new SynapseMessageContextinstance.- Returns:
- a MessageContext
-
createOverflowBlob
org.apache.axiom.util.blob.OverflowBlob createOverflowBlob()
Creates a newTemporaryDatainstance for the temp storage requirements- Returns:
- a TemporaryData created from the parameters provided in the synapse.properties
-
getMessageDataStore
MessageDataStore getMessageDataStore()
This method returns message data store which holds a queue of event holder objects.- Returns:
- messageDataStore
-
getExecutorService
ExecutorService getExecutorService()
This is used by anyone who needs access to a SynapseThreadPool. It offers the ability to start work.- Returns:
- Returns the ExecutorService
-
isInitialized
boolean isInitialized()
Has the Synapse Environment properly initialized?- Returns:
- true if the environment is ready for processing
-
setInitialized
void setInitialized(boolean state)
Set the environment as ready for message processing- Parameters:
state- true means ready for processing
-
getSynapseConfiguration
SynapseConfiguration getSynapseConfiguration()
Retrieves theSynapseConfigurationfrom theenvironment- Returns:
- configuration of the synapse
-
getTaskManager
org.apache.synapse.task.SynapseTaskManager getTaskManager()
Retrieve theSynapseTaskManagerfrom theenvironment.- Returns:
- SynapseTaskManager of this synapse environment
-
getServerContextInformation
ServerContextInformation getServerContextInformation()
Get the information about the synapse environment.- Returns:
ServerContextInformationof this synapse environment
-
getXpathFunctionExtensions
Map<String,SynapseXpathFunctionContextProvider> getXpathFunctionExtensions()
Get all Xpath Extension objects for Function contexts- Returns:
- Map containing xpath extension objects
-
getXpathVariableExtensions
Map<QName,SynapseXpathVariableResolver> getXpathVariableExtensions()
Get all Xpath Extension objects for Variable contexts- Returns:
- Map containing xpath extension objects
-
getTenantInfoConfigurator
TenantInfoConfigurator getTenantInfoConfigurator()
- Returns:
-
updateCallMediatorCount
void updateCallMediatorCount(boolean isIncrement)
Increment/Decrement the Call mediator count in the environment by 1- Parameters:
isIncrement- whether to increment the count
-
isContinuationEnabled
boolean isContinuationEnabled()
Whether continuation is enabled in the environment- Returns:
- whether continuation is enabled in the environment
-
addUnavailableArtifactRef
void addUnavailableArtifactRef(String key)
Add an artifact reference not available in the environment.- Parameters:
key- artifact reference key
-
removeUnavailableArtifactRef
void removeUnavailableArtifactRef(String key)
Remove the artifact reference which is marked as unavailable in environment from the unavailable list- Parameters:
key- artifact reference key
-
clearUnavailabilityOfArtifact
void clearUnavailabilityOfArtifact(String key)
Clear unavailability of an artifact if it is previously marked as unavailable in the environment- Parameters:
key- artifact reference key
-
injectMessage
boolean injectMessage(MessageContext smc, SequenceMediator seq)
Inject message to the sequence in synchronous manner- Parameters:
smc- - Synapse message context to be injectedseq- - Sequence to be used for mediation- Returns:
- boolean true if the message processing should be continued and false if it should be aborted
-
getSynapseHandlers
List<SynapseHandler> getSynapseHandlers()
Get all synapse handlers- Returns:
- list of synapse handlers
-
registerSynapseHandler
void registerSynapseHandler(SynapseHandler handler)
Register a synapse handler to the synapse environment- Parameters:
handler- synapse handler
-
getGlobalTimeout
long getGlobalTimeout()
Get the global timeout interval for callbacks- Returns:
- global timeout interval
-
isDebuggerEnabled
boolean isDebuggerEnabled()
Whether debugging is enabled in the environment.- Returns:
- whether debugging is enabled in the environment
-
getSynapseDebugManager
SynapseDebugManager getSynapseDebugManager()
Retrieve theSynapseDebugManagerfrom theenvironment.- Returns:
- SynapseDebugManager of this synapse environment
-
-