org.apache.synapse.core.axis2
Class Axis2SynapseEnvironment

java.lang.Object
  extended by org.apache.synapse.core.axis2.Axis2SynapseEnvironment
All Implemented Interfaces:
SynapseEnvironment

public class Axis2SynapseEnvironment
extends Object
implements SynapseEnvironment

This is the Axis2 implementation of the SynapseEnvironment


Constructor Summary
Axis2SynapseEnvironment(ConfigurationContext cfgCtx, SynapseConfiguration synapseConfig)
           
Axis2SynapseEnvironment(SynapseConfiguration synCfg)
           
 
Method Summary
 MessageContext createMessageContext()
          This method will be used to create a new MessageContext in the Axis2 environment for Synapse.
 TemporaryData createTemporaryData()
          Factory method to create the TemporaryData object as per on the parameters specified in the synapse.properties file, so that the TemporaryData parameters like threashold chunk size can be customized by using the properties file.
 ExecutorService getExecutorService()
          This will give the access to the synapse thread pool for the advanced mediation tasks.
 StatisticsCollector getStatisticsCollector()
          This method returns the StatisticsCollector
 void injectAsync(MessageContext synCtx, SequenceMediator seq)
          This method injects a new message into the Synapse engine for the mediation by the specified sequence.
 boolean injectMessage(MessageContext synCtx)
          This method injects a new message into the Synapse engine.
 boolean isInitialized()
          Has this environment properly initialized?
 void send(EndpointDefinition endpoint, MessageContext synCtx)
          This will be used for sending the message provided, to the endpoint specified by the EndpointDefinition using the axis2 environment.
 void setInitialized(boolean state)
          Mark this environment as ready for processing
 void setStatisticsCollector(StatisticsCollector collector)
          To set the StatisticsCollector
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Axis2SynapseEnvironment

public Axis2SynapseEnvironment(SynapseConfiguration synCfg)

Axis2SynapseEnvironment

public Axis2SynapseEnvironment(ConfigurationContext cfgCtx,
                               SynapseConfiguration synapseConfig)
Method Detail

injectMessage

public boolean injectMessage(MessageContext synCtx)
Description copied from interface: SynapseEnvironment
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

Specified by:
injectMessage in interface SynapseEnvironment
Parameters:
synCtx - - Synapse MessageContext to be injected
Returns:
boolean true if the message processing should be continued and false if it should be aborted

injectAsync

public void injectAsync(MessageContext synCtx,
                        SequenceMediator seq)
Description copied from interface: SynapseEnvironment
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 mediations. This method will do the mediation asynchronously using a separate thread from the environment thread pool

Specified by:
injectAsync in interface SynapseEnvironment
Parameters:
synCtx - - Synapse message context to be injected
seq - - Sequence to be used for mediation

send

public void send(EndpointDefinition endpoint,
                 MessageContext synCtx)
This will be used for sending the message provided, to the endpoint specified by the EndpointDefinition using the axis2 environment.

Specified by:
send in interface SynapseEnvironment
Parameters:
endpoint - - EndpointDefinition to be used to find the endpoint information and the properties of the sending process
synCtx - - Synapse MessageContext to be sent

createMessageContext

public MessageContext createMessageContext()
This method will be used to create a new MessageContext in the Axis2 environment for Synapse. This will set all the relevant parts to the messagecontext, but for this message context to be useful creator has to fill in the data like envelope and operation context and so on. This will set a default envelope of type soap12 and a new messageID for the created message along with the ConfigurationContext is being set in to the message correctly.

Specified by:
createMessageContext in interface SynapseEnvironment
Returns:
Synapse MessageContext with the underlying axis2 message context set

createTemporaryData

public TemporaryData createTemporaryData()
Factory method to create the TemporaryData object as per on the parameters specified in the synapse.properties file, so that the TemporaryData parameters like threashold chunk size can be customized by using the properties file. This can be extended to enforce further policies if required in the future.

Specified by:
createTemporaryData in interface SynapseEnvironment
Returns:
created TemporaryData object as per in the synapse.properties file

getStatisticsCollector

public StatisticsCollector getStatisticsCollector()
This method returns the StatisticsCollector

Specified by:
getStatisticsCollector in interface SynapseEnvironment
Returns:
Retruns the StatisticsCollector

setStatisticsCollector

public void setStatisticsCollector(StatisticsCollector collector)
To set the StatisticsCollector

Specified by:
setStatisticsCollector in interface SynapseEnvironment
Parameters:
collector - - Statistics collector to be set

getExecutorService

public ExecutorService getExecutorService()
This will give the access to the synapse thread pool for the advanced mediation tasks.

Specified by:
getExecutorService in interface SynapseEnvironment
Returns:
an ExecutorService to execute the tasks in a new thread from the pool

isInitialized

public boolean isInitialized()
Has this environment properly initialized?

Specified by:
isInitialized in interface SynapseEnvironment
Returns:
true if ready for processing

setInitialized

public void setInitialized(boolean state)
Mark this environment as ready for processing

Specified by:
setInitialized in interface SynapseEnvironment
Parameters:
state - true means ready for processing


Copyright © 2005-2008 Apache Software Foundation. All Rights Reserved.