org.apache.ode.bpel.engine

## Class MyRoleMessageExchangeImpl

- java.lang.Object
- - org.apache.ode.bpel.engine.MyRoleMessageExchangeImpl

- All Implemented Interfaces:
    MessageExchange, MyRoleMessageExchange
  Direct Known Subclasses:
    BrokeredMyRoleMessageExchangeImpl

      public class MyRoleMessageExchangeImpl
      extends java.lang.Object
      implements MyRoleMessageExchange

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.apache.ode.bpel.iapi.MyRoleMessageExchange

      `MyRoleMessageExchange.CorrelationStatus`

    - ### Nested classes/interfaces inherited from interface org.apache.ode.bpel.iapi.MessageExchange

      `MessageExchange.FailureType, MessageExchange.MessageExchangePattern, MessageExchange.Status`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static Messages` | `__msgs`
    `protected MessageExchangeDAO` | `_dao`
    `protected BpelEngineImpl` | `_engine`
    `protected EndpointReference` | `_epr`
    `protected java.lang.Long` | `_iid` Process-Instance identifier.
    `protected javax.wsdl.Operation` | `_operation`
    `protected javax.wsdl.PortType` | `_portType`
    `protected BpelProcess` | `_process`
    `protected static java.util.Map<java.lang.String,org.apache.ode.bpel.engine.MyRoleMessageExchangeImpl.ResponseCallback>` | `_waitingCallbacks`

    - ### Fields inherited from interface org.apache.ode.bpel.iapi.MessageExchange

      `PROPERTY_SEP_MYROLE_SESSIONID, PROPERTY_SEP_PARTNERROLE_EPR, PROPERTY_SEP_PARTNERROLE_SESSIONID`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MyRoleMessageExchangeImpl(BpelProcess process, BpelEngineImpl engine, MessageExchangeDAO mexdao)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected Message` | `cloneMessage(Message message)` Return a deep clone of the given message
    `void` | `complete()` Complete the message, exchange: indicates that the client has receive the response (if any).
    `Message` | `createMessage(javax.xml.namespace.QName msgType)` Create a message associated with this exchange.
    `java.lang.String` | `getClientId()` Get the previously associated client key for this exchange.
    `MyRoleMessageExchange.CorrelationStatus` | `getCorrelationStatus()` Get the correlation state of the the invocation.
    `MessageExchangeDAO` | `getDAO()`
    `EndpointReference` | `getEndpointReference()` Get a reference to the end-point targeted by this message exchange.
    `javax.xml.namespace.QName` | `getFault()` Get the fault type.
    `java.lang.String` | `getFaultExplanation()`
    `Message` | `getFaultResponse()` Get the fault resposne message.
    `java.lang.String` | `getMessageExchangeId()` Get the message exchange identifier.
    `MessageExchange.MessageExchangePattern` | `getMessageExchangePattern()` Return the type of message-exchange that resulted form this invocation (request only/request-respone).
    `javax.wsdl.Operation` | `getOperation()` Get the operation description for this message exchange.
    `java.lang.String` | `getOperationName()` Get the name of the operation (WSDL 1.1) / message exchange (WSDL 1.2?).
    `MessageExchange.MessageExchangePattern` | `getPattern()`
    `javax.wsdl.PortType` | `getPortType()` Get the port type description for this message exchange.
    `java.lang.String` | `getProperty(java.lang.String key)` Get a message exchange property.
    `java.util.Set<java.lang.String>` | `getPropertyNames()` Get a set containing the names of the defined properties.
    `Message` | `getRequest()` Get the request message.
    `Message` | `getResponse()` Get the response message.
    `javax.xml.namespace.QName` | `getServiceName()` Get the name of the service targetted in this message exchange.
    `MessageExchange.Status` | `getStatus()` Get the message exchange status.
    `int` | `getSubscriberCount()`
    `java.util.concurrent.Future` | `invoke(Message request)` "Invoke" a process hosted by the BPEL engine.
    `boolean` | `isAsynchronous()`
    `boolean` | `isTransactionPropagated()`
    `void` | `release()` Should be called by the external partner when it's done with the message exchange.
    `void` | `release(boolean instanceSucceeded)` Should be called by the external partner when it's done with the message exchange.
    `protected void` | `responseReceived()`
    `void` | `setClientId(java.lang.String clientKey)` Associate a client key with this message exchange.
    `void` | `setCorrelationStatus(MyRoleMessageExchange.CorrelationStatus status)`
    `void` | `setEndpointReference(EndpointReference ref)`
    `void` | `setProperty(java.lang.String key, java.lang.String value)` Set a message exchange property.
    `void` | `setSubscriberCount(int subscriberCount)`
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.apache.ode.bpel.iapi.MessageExchange

      `createMessage, getEndpointReference, getFault, getFaultExplanation, getFaultResponse, getMessageExchangeId, getMessageExchangePattern, getOperation, getOperationName, getPortType, getProperty, getPropertyNames, getRequest, getResponse, getStatus, isTransactionPropagated, release, setProperty`

- - ### Field Detail

    - #### _process

          protected BpelProcess _process

    - #### _waitingCallbacks

          protected static java.util.Map<java.lang.String,org.apache.ode.bpel.engine.MyRoleMessageExchangeImpl.ResponseCallback> _waitingCallbacks

    - #### __msgs

          protected static final Messages __msgs

    - #### _iid

          protected java.lang.Long _iid

      Process-Instance identifier.

    - #### _portType

          protected javax.wsdl.PortType _portType

    - #### _operation

          protected javax.wsdl.Operation _operation

    - #### _engine

          protected final BpelEngineImpl _engine

    - #### _epr

          protected EndpointReference _epr

    - #### _dao

          protected MessageExchangeDAO _dao

  - ### Constructor Detail

    - #### MyRoleMessageExchangeImpl

          public MyRoleMessageExchangeImpl(BpelProcess process,
                                   BpelEngineImpl engine,
                                   MessageExchangeDAO mexdao)

  - ### Method Detail

    - #### getCorrelationStatus

          public MyRoleMessageExchange.CorrelationStatus getCorrelationStatus()

      Description copied from interface: `MyRoleMessageExchange`
      Get the correlation state of the the invocation. An invocation will either create a new process instance, match an existing instance, or be queued for consumption by an instance in the future (see `CorrelationType` for details).
      Specified by:
        `getCorrelationStatus` in interface `MyRoleMessageExchange`
      Returns:
        correlation state of the invocation

    - #### setCorrelationStatus

          public void setCorrelationStatus(MyRoleMessageExchange.CorrelationStatus status)

    - #### invoke

          public java.util.concurrent.Future invoke(Message request)

      Description copied from interface: `MyRoleMessageExchange`
      "Invoke" a process hosted by the BPEL engine. The state of the invocation may be obtained by a call to the `MessageExchange.getStatus()` method. It is possible that the response for the operation is not immediately available (i.e the call to `MyRoleMessageExchange.invoke(Message)` will return before a response is available). In such cases, `MessageExchange.getStatus()` == `Status#ASYNC` and the integration layer will receive an asynchronous notification from the BPEL engine via the `MessageExchangeContext.onAsyncReply(MyRoleMessageExchange)` when the response become available.
      Specified by:
        `invoke` in interface `MyRoleMessageExchange`

    - #### complete

          public void complete()

      Description copied from interface: `MyRoleMessageExchange`
      Complete the message, exchange: indicates that the client has receive the response (if any).
      Specified by:
        `complete` in interface `MyRoleMessageExchange`

    - #### getServiceName

          public javax.xml.namespace.QName getServiceName()

      Description copied from interface: `MyRoleMessageExchange`
      Get the name of the service targetted in this message exchange.
      Specified by:
        `getServiceName` in interface `MyRoleMessageExchange`
      Returns:
        service name

    - #### setClientId

          public void setClientId(java.lang.String clientKey)

      Description copied from interface: `MyRoleMessageExchange`
      Associate a client key with this message exchange.
      Specified by:
        `setClientId` in interface `MyRoleMessageExchange`

    - #### getClientId

          public java.lang.String getClientId()

      Description copied from interface: `MyRoleMessageExchange`
      Get the previously associated client key for this exchange.
      Specified by:
        `getClientId` in interface `MyRoleMessageExchange`
      Returns:

    - #### toString

          public java.lang.String toString()

    - #### isAsynchronous

          public boolean isAsynchronous()

    - #### release

          public void release(boolean instanceSucceeded)

      Description copied from interface: `MyRoleMessageExchange`
      Should be called by the external partner when it's done with the message exchange. Ncessary for a better resource management and proper mex cleanup.
      Specified by:
        `release` in interface `MyRoleMessageExchange`

    - #### cloneMessage

          protected Message cloneMessage(Message message)

      Return a deep clone of the given message
      Parameters:
        `message` -
      Returns:

    - #### responseReceived

          protected void responseReceived()

    - #### getMessageExchangeId

          public java.lang.String getMessageExchangeId()
                                                throws BpelEngineException

      Description copied from interface: `MessageExchange`
      Get the message exchange identifier. This identifier should be globally unique as the BPEL engine may keep identifiers for extended periods of time.
      Specified by:
        `getMessageExchangeId` in interface `MessageExchange`
      Returns:
        unique message exchange identifier
      Throws:
        `BpelEngineException`

    - #### getOperationName

          public java.lang.String getOperationName()
                                            throws BpelEngineException

      Description copied from interface: `MessageExchange`
      Get the name of the operation (WSDL 1.1) / message exchange (WSDL 1.2?).
      Specified by:
        `getOperationName` in interface `MessageExchange`
      Returns:
        name of the operation (WSDL 1.1) /message exchange (WSDL 1.2?).
      Throws:
        `BpelEngineException`

    - #### getMessageExchangePattern

          public MessageExchange.MessageExchangePattern getMessageExchangePattern()

      Description copied from interface: `MessageExchange`
      Return the type of message-exchange that resulted form this invocation (request only/request-respone). If a `MessageExchange.MessageExchangePattern.REQUEST_RESPONSE` message-exchange was created, then the caller should expect a response in the future.
      Specified by:
        `getMessageExchangePattern` in interface `MessageExchange`
      Returns:
        type of message exchange created by the invocation

    - #### isTransactionPropagated

          public boolean isTransactionPropagated()
                                          throws BpelEngineException

      Specified by:
        `isTransactionPropagated` in interface `MessageExchange`
      Throws:
        `BpelEngineException`

    - #### getResponse

          public Message getResponse()

      Description copied from interface: `MessageExchange`
      Get the response message.
      Specified by:
        `getResponse` in interface `MessageExchange`
      Returns:
        response message (or null if not avaiable)

    - #### getFault

          public javax.xml.namespace.QName getFault()

      Description copied from interface: `MessageExchange`
      Get the fault type.
      Specified by:
        `getFault` in interface `MessageExchange`
      Returns:
        fault type, or `null` if not available/applicable.

    - #### getFaultResponse

          public Message getFaultResponse()

      Description copied from interface: `MessageExchange`
      Get the fault resposne message.
      Specified by:
        `getFaultResponse` in interface `MessageExchange`
      Returns:
        fault response, or `null` if not available/applicable.

    - #### getFaultExplanation

          public java.lang.String getFaultExplanation()

      Specified by:
        `getFaultExplanation` in interface `MessageExchange`

    - #### getPattern

          public MessageExchange.MessageExchangePattern getPattern()

    - #### getStatus

          public MessageExchange.Status getStatus()

      Description copied from interface: `MessageExchange`
      Get the message exchange status.
      Specified by:
        `getStatus` in interface `MessageExchange`
      Returns:

    - #### getRequest

          public Message getRequest()

      Description copied from interface: `MessageExchange`
      Get the request message.
      Specified by:
        `getRequest` in interface `MessageExchange`
      Returns:
        request message

    - #### getOperation

          public javax.wsdl.Operation getOperation()

      Description copied from interface: `MessageExchange`
      Get the operation description for this message exchange. It is possible that the description cannot be resolved, for example if the EPR is unknown or if the operation does not exist. TODO: How to get rid of the WSDL4j dependency?
      Specified by:
        `getOperation` in interface `MessageExchange`
      Returns:
        WSDL operation description or `null` if not availble

    - #### getPortType

          public javax.wsdl.PortType getPortType()

      Description copied from interface: `MessageExchange`
      Get the port type description for this message exchange. It is possible that the description cannot be resolved, for example if the EPR is unknown or if the operation does not exist. TODO: How to get rid of the WSDL4j dependency?
      Specified by:
        `getPortType` in interface `MessageExchange`
      Returns:
        WSDL port type description or `null` if not available.

    - #### getDAO

          public MessageExchangeDAO getDAO()

    - #### createMessage

          public Message createMessage(javax.xml.namespace.QName msgType)

      Description copied from interface: `MessageExchange`
      Create a message associated with this exchange.
      Specified by:
        `createMessage` in interface `MessageExchange`
      Parameters:
        `msgType` - message type
      Returns:
        a new `Message`

    - #### setEndpointReference

          public void setEndpointReference(EndpointReference ref)

    - #### getEndpointReference

          public EndpointReference getEndpointReference()
                                                 throws BpelEngineException

      Description copied from interface: `MessageExchange`
      Get a reference to the end-point targeted by this message exchange.
      Specified by:
        `getEndpointReference` in interface `MessageExchange`
      Returns:
        end-point reference for this message exchange
      Throws:
        `BpelEngineException`

    - #### getProperty

          public java.lang.String getProperty(java.lang.String key)

      Description copied from interface: `MessageExchange`
      Get a message exchange property.
      Specified by:
        `getProperty` in interface `MessageExchange`
      Parameters:
        `key` - property key
      Returns:
        property value

    - #### setProperty

          public void setProperty(java.lang.String key,
                         java.lang.String value)

      Description copied from interface: `MessageExchange`
      Set a message exchange property. Message exchange properties are not interpreted by the engine--they exist to enable the integration layer to persist information about the exchange.
      Specified by:
        `setProperty` in interface `MessageExchange`
      Parameters:
        `key` - property key
        `value` - property value

    - #### getPropertyNames

          public java.util.Set<java.lang.String> getPropertyNames()

      Description copied from interface: `MessageExchange`
      Get a set containing the names of the defined properties.
      Specified by:
        `getPropertyNames` in interface `MessageExchange`
      Returns:
        set of property names.

    - #### getSubscriberCount

          public int getSubscriberCount()

    - #### setSubscriberCount

          public void setSubscriberCount(int subscriberCount)

    - #### release

          public void release()

      Description copied from interface: `MessageExchange`
      Should be called by the external partner when it's done with the message exchange. Ncessary for a better resource management and proper mex cleanup.
      Specified by:
        `release` in interface `MessageExchange`