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 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 injected
        seq - - 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 injected
        seq - - Sequence to be used for mediation
        sequential - - 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 sending
        smc - - Synapse MessageContext to be sent
      • createMessageContext

        MessageContext createMessageContext()
        Creates a new Synapse MessageContext instance.
        Returns:
        a MessageContext
      • createOverflowBlob

        org.apache.axiom.util.blob.OverflowBlob createOverflowBlob()
        Creates a new TemporaryData 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
      • getTaskManager

        org.apache.synapse.task.SynapseTaskManager getTaskManager()
        Retrieve the SynapseTaskManager from the environment.
        Returns:
        SynapseTaskManager of this synapse environment
      • getXpathVariableExtensions

        Map<QName,​SynapseXpathVariableResolver> getXpathVariableExtensions()
        Get all Xpath Extension objects for Variable contexts
        Returns:
        Map containing xpath extension objects
      • 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 injected
        seq - - 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
      • getSequenceObservers

        List<SequenceFlowObserver> getSequenceObservers()
        Get all sequence observers
        Returns:
        list of sequence observers
      • registerSequenceObservers

        void registerSequenceObservers​(SequenceFlowObserver observer)
        Register a sequence observer to the synapse environment
        Parameters:
        observer - sequence observer
      • 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