Package org.apache.synapse.core
Interface SynapseEnvironment
-
- All Known Implementing Classes:
Axis2SynapseEnvironment
public interface SynapseEnvironment
The 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 void
addUnavailableArtifactRef(String key)
Add an artifact reference not available in the environment.void
clearUnavailabilityOfArtifact(String key)
Clear unavailability of an artifact if it is previously marked as unavailable in the environmentMessageContext
createMessageContext()
Creates a new SynapseMessageContext
instance.org.apache.axiom.util.blob.OverflowBlob
createOverflowBlob()
Creates a newTemporaryData
instance for the temp storage requirementsExecutorService
getExecutorService()
This is used by anyone who needs access to a SynapseThreadPool.long
getGlobalTimeout()
Get the global timeout interval for callbacksMessageDataStore
getMessageDataStore()
This method returns message data store which holds a queue of event holder objects.ServerContextInformation
getServerContextInformation()
Get the information about the synapse environment.SynapseConfiguration
getSynapseConfiguration()
Retrieves theSynapseConfiguration
from theenvironment
SynapseDebugManager
getSynapseDebugManager()
Retrieve theSynapseDebugManager
from theenvironment
.List<SynapseHandler>
getSynapseHandlers()
Get all synapse handlersorg.apache.synapse.task.SynapseTaskManager
getTaskManager()
Retrieve theSynapseTaskManager
from theenvironment
.TenantInfoConfigurator
getTenantInfoConfigurator()
Map<String,SynapseXpathFunctionContextProvider>
getXpathFunctionExtensions()
Get all Xpath Extension objects for Function contextsMap<QName,SynapseXpathVariableResolver>
getXpathVariableExtensions()
Get all Xpath Extension objects for Variable contextsvoid
injectAsync(MessageContext smc, SequenceMediator seq)
This method injects a new message into the Synapse engine for the mediation by the specified sequence.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.boolean
injectMessage(MessageContext smc)
This method injects a new message into the Synapse engine.boolean
injectMessage(MessageContext smc, SequenceMediator seq)
Inject message to the sequence in synchronous mannerboolean
isContinuationEnabled()
Whether continuation is enabled in the environmentboolean
isDebuggerEnabled()
Whether debugging is enabled in the environment.boolean
isInitialized()
Has the Synapse Environment properly initialized?void
registerSynapseHandler(SynapseHandler handler)
Register a synapse handler to the synapse environmentvoid
removeUnavailableArtifactRef(String key)
Remove the artifact reference which is marked as unavailable in environment from the unavailable listvoid
send(EndpointDefinition endpoint, MessageContext smc)
This method allows a message to be sent through the underlying SOAP engine.void
setInitialized(boolean state)
Set the environment as ready for message processingvoid
updateCallMediatorCount(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 SynapseMessageContext
instance.- Returns:
- a MessageContext
-
createOverflowBlob
org.apache.axiom.util.blob.OverflowBlob createOverflowBlob()
Creates a newTemporaryData
instance 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 theSynapseConfiguration
from theenvironment
- Returns:
- configuration of the synapse
-
getTaskManager
org.apache.synapse.task.SynapseTaskManager getTaskManager()
Retrieve theSynapseTaskManager
from theenvironment
.- Returns:
- SynapseTaskManager of this synapse environment
-
getServerContextInformation
ServerContextInformation getServerContextInformation()
Get the information about the synapse environment.- Returns:
ServerContextInformation
of 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 theSynapseDebugManager
from theenvironment
.- Returns:
- SynapseDebugManager of this synapse environment
-
-