com.ibm.websphere.sca.jms.data

Interface JMSDataBinding

  • All Superinterfaces:
    commonj.connector.runtime.DataBinding, java.io.Serializable
    All Known Subinterfaces:
    JMSObjectBinding
    All Known Implementing Classes:
    JMSDataBindingImplJava, JMSDataBindingImplXML


    public interface JMSDataBinding
    extends commonj.connector.runtime.DataBinding
    A DataBinding represents the mapping between a native data format and an SDO DataObject, and vice-versa.

    This interface is an extension of commonj.connector.runtime.DataBinding, and presents a JMS-specific view which should be implemented for use in JMS Exports and Imports.

    It exposes methods which read and write to and from a JMS message, as well as exporting which type of JMS message is supported.

    See Also:
    DataBinding
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      int getMessageType()
      Return the message type that is supported by this data binding.
      boolean isBusinessException()
      Queries the DataBinding to determine whether the received message contains a fault (carried within a BusinessException).
      void read(javax.jms.Message message)
      Read the contents of the incoming JMS Message into a DataObject.
      void setBusinessException(boolean isBusinessException)
      This method is called by the runtime if the outgoing message contains a BusinessException.
      void write(javax.jms.Message message)
      Write the DataObject into an outgoing JMS Message.
      • Methods inherited from interface commonj.connector.runtime.DataBinding

        getDataObject, setDataObject
    • Method Detail

      • getMessageType

        int getMessageType()
        Return the message type that is supported by this data binding. Message type is one of the following types:
        • ANY_MESSAGE
        • OBJECT_MESSAGE
        • TEXT_MESSAGE
        • BYTES_MESSAGE
        • STREAM_MESSAGE
        • MAP_MESSAGE
        • BASE_MESSAGE
        Returns:
        Message type, represented by one of the static integer definitions above.
      • read

        void read(javax.jms.Message message)
                  throws javax.jms.JMSException
        Read the contents of the incoming JMS Message into a DataObject. Called before the getDataObject method is called by the runtime. An implementation of this method will process the payload of the incoming JMS message and will parse the data into the appropriate DataObject, created like this:

        BOFactory bof =
        (BOFactory)ServiceManager.INSTANCE.locateService("com/ibm/websphere/bo/BOFactory");
        sampleBO = bof.create("http://namespace", "BOName");

        Parameters:
        message - The message whose payload is to be parsed.
        Throws:
        javax.jms.JMSException - Thrown if an error occurs during reading of the message.
      • write

        void write(javax.jms.Message message)
                   throws javax.jms.JMSException
        Write the DataObject into an outgoing JMS Message. Called after the setDataObject method is called by the runtime. The supplied message must be of the same type as returned by getMessageType.

        This method will be the converse of the read method, and will serialize the contents of the DataObject the the wire format in the JMS message.

        Parameters:
        message - The message to be populated with the serialized DataObject.
        Throws:
        javax.jms.JMSException - Thrown if an error occurs during writing of the message.
      • isBusinessException

        boolean isBusinessException()
        Queries the DataBinding to determine whether the received message contains a fault (carried within a BusinessException).
        Returns:
        A boolean value stating whether the message payload is a fault.
      • setBusinessException

        void setBusinessException(boolean isBusinessException)
        This method is called by the runtime if the outgoing message contains a BusinessException. An implementation of this method may set some internal state if this information is important to propagate - and in this case, the interanl state will be acted on by the write() method.
        Parameters:
        isBusinessException - True or false, specified by the caller.
IBM Business Process ManagerTM
Release 8