org.objectweb.petals.tools.rmi.common.serializable
Class MessageExchange

java.lang.Object
  extended by org.objectweb.petals.tools.rmi.common.serializable.MessageExchange
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, javax.jbi.messaging.MessageExchange
Direct Known Subclasses:
InOnly, InOut

public class MessageExchange
extends java.lang.Object
implements javax.jbi.messaging.MessageExchange, java.lang.Cloneable, java.io.Serializable

the message exchange implementation.

Author:
nsalatge
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface javax.jbi.messaging.MessageExchange
javax.jbi.messaging.MessageExchange.Role
 
Field Summary
static java.lang.String IN_MSG
          IN_MSG constant.
static java.net.URI IN_ONLY_PATTERN
          IN_ONLY_PATTERN constant.
static java.net.URI IN_OPTIONAL_OUT_PATTERN
          IN_OPTIONAL_OUT_PATTERN constant.
static java.net.URI IN_OUT_PATTERN
          IN_OUT_PATTERN constant.
static java.lang.String OUT_MSG
          OUT_MSG constant.
static java.net.URI ROBUST_IN_ONLY_PATTERN
          ROBUST_IN_ONLY_PATTERN constant.
 
Fields inherited from interface javax.jbi.messaging.MessageExchange
JTA_TRANSACTION_PROPERTY_NAME
 
Constructor Summary
MessageExchange()
          Create a MessageExchangeImpl This constructor is called by a consumer who wants to initialize an exchange.
 
Method Summary
 javax.jbi.messaging.Fault createFault()
           
 javax.jbi.messaging.NormalizedMessage createMessage()
           
 javax.jbi.servicedesc.ServiceEndpoint getEndpoint()
           
 java.lang.Exception getError()
           
 java.lang.String getExchangeId()
           
 javax.jbi.messaging.Fault getFault()
           
 javax.jbi.messaging.FlowAttributes getFlowAttributes()
           
 javax.xml.namespace.QName getInterfaceName()
           
 javax.jbi.messaging.NormalizedMessage getMessage(java.lang.String name)
          get the message associated to the reference.
 java.util.Map<java.lang.String,javax.jbi.messaging.NormalizedMessage> getMessages()
          Get all messages.
 javax.xml.namespace.QName getOperation()
           
 java.net.URI getPattern()
           
 java.lang.Object getProperty(java.lang.String name)
           
 java.util.Set<?> getPropertyNames()
           
 javax.jbi.messaging.MessageExchange.Role getRole()
          (non-Javadoc).
 javax.xml.namespace.QName getService()
           
 javax.jbi.messaging.ExchangeStatus getStatus()
           
 boolean isTransacted()
           
protected  void readObjectDelegate(java.io.ObjectInputStream s)
           
 void setEndpoint(javax.jbi.servicedesc.ServiceEndpoint endpoint)
           
 void setError(java.lang.Exception error)
           
 void setExchangeId(java.lang.String id)
          Set the ExchangeId.
 void setFault(javax.jbi.messaging.Fault fault)
          (non-Javadoc).
 void setFlowAttributes(javax.jbi.messaging.FlowAttributes flowAttributes)
           
 void setInterfaceName(javax.xml.namespace.QName interfaceName)
          (non-Javadoc).
 void setMessage(javax.jbi.messaging.NormalizedMessage msg, java.lang.String name)
           
 void setOperation(javax.xml.namespace.QName name)
           
 void setPattern(java.net.URI p)
          Set the pattern.
 void setProperty(java.lang.String name, java.lang.Object obj)
           
 void setRole(javax.jbi.messaging.MessageExchange.Role r)
          Set the role.
 void setService(javax.xml.namespace.QName service)
           
 void setStatus(javax.jbi.messaging.ExchangeStatus status)
           
protected  void writeObjectDelegate(java.io.ObjectOutputStream s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IN_MSG

public static final java.lang.String IN_MSG
IN_MSG constant.

See Also:
Constant Field Values

IN_ONLY_PATTERN

public static final java.net.URI IN_ONLY_PATTERN
IN_ONLY_PATTERN constant.


IN_OPTIONAL_OUT_PATTERN

public static final java.net.URI IN_OPTIONAL_OUT_PATTERN
IN_OPTIONAL_OUT_PATTERN constant.


IN_OUT_PATTERN

public static final java.net.URI IN_OUT_PATTERN
IN_OUT_PATTERN constant.


OUT_MSG

public static final java.lang.String OUT_MSG
OUT_MSG constant.

See Also:
Constant Field Values

ROBUST_IN_ONLY_PATTERN

public static final java.net.URI ROBUST_IN_ONLY_PATTERN
ROBUST_IN_ONLY_PATTERN constant.

Constructor Detail

MessageExchange

public MessageExchange()
Create a MessageExchangeImpl This constructor is called by a consumer who wants to initialize an exchange.

Parameters:
consumerDeliveryChannel -
Method Detail

createFault

public javax.jbi.messaging.Fault createFault()
                                      throws javax.jbi.messaging.MessagingException
Specified by:
createFault in interface javax.jbi.messaging.MessageExchange
Returns:
the fault message
Throws:
javax.jbi.messaging.MessagingException - Impossible to create the fault
See Also:
MessageExchange.createFault()

createMessage

public javax.jbi.messaging.NormalizedMessage createMessage()
                                                    throws javax.jbi.messaging.MessagingException
Specified by:
createMessage in interface javax.jbi.messaging.MessageExchange
Returns:
the normalized message
Throws:
javax.jbi.messaging.MessagingException - Impossible to create the message
See Also:
MessageExchange.createMessage()

getEndpoint

public javax.jbi.servicedesc.ServiceEndpoint getEndpoint()
Specified by:
getEndpoint in interface javax.jbi.messaging.MessageExchange
Returns:
the service endpoint
See Also:
MessageExchange.getEndpoint()

getError

public java.lang.Exception getError()
Specified by:
getError in interface javax.jbi.messaging.MessageExchange
Returns:
the exception
See Also:
MessageExchange.getError()

getExchangeId

public java.lang.String getExchangeId()
Specified by:
getExchangeId in interface javax.jbi.messaging.MessageExchange
Returns:
the exchange id
See Also:
MessageExchange.getExchangeId()

getFault

public javax.jbi.messaging.Fault getFault()
Specified by:
getFault in interface javax.jbi.messaging.MessageExchange
Returns:
the fault message
See Also:
MessageExchange.getFault()

getInterfaceName

public javax.xml.namespace.QName getInterfaceName()
Specified by:
getInterfaceName in interface javax.jbi.messaging.MessageExchange
Returns:
the interface name
See Also:
MessageExchange.getInterfaceName()

getMessage

public javax.jbi.messaging.NormalizedMessage getMessage(java.lang.String name)
get the message associated to the reference. It is Not Case Sensitive.

Specified by:
getMessage in interface javax.jbi.messaging.MessageExchange
Parameters:
name - the name of message
Returns:
the normalized message
See Also:
MessageExchange.getMessage(java.lang.String)

getOperation

public javax.xml.namespace.QName getOperation()
Specified by:
getOperation in interface javax.jbi.messaging.MessageExchange
Returns:
the opretation
See Also:
MessageExchange.getOperation()

getPattern

public java.net.URI getPattern()
Specified by:
getPattern in interface javax.jbi.messaging.MessageExchange
Returns:
the pattern
See Also:
MessageExchange.getPattern()

getProperty

public java.lang.Object getProperty(java.lang.String name)
Specified by:
getProperty in interface javax.jbi.messaging.MessageExchange
Parameters:
name - the property name
Returns:
the object property
See Also:
MessageExchange.getProperty(java.lang.String)

getPropertyNames

public java.util.Set<?> getPropertyNames()
Specified by:
getPropertyNames in interface javax.jbi.messaging.MessageExchange
Returns:
the set of properties
See Also:
MessageExchange.getPropertyNames()

getRole

public javax.jbi.messaging.MessageExchange.Role getRole()
(non-Javadoc).

Specified by:
getRole in interface javax.jbi.messaging.MessageExchange
Returns:
the role
See Also:
MessageExchange.getRole()

getService

public javax.xml.namespace.QName getService()
Specified by:
getService in interface javax.jbi.messaging.MessageExchange
Returns:
the service.
See Also:
MessageExchange.getService()

getStatus

public javax.jbi.messaging.ExchangeStatus getStatus()
Specified by:
getStatus in interface javax.jbi.messaging.MessageExchange
Returns:
the exchange status
See Also:
MessageExchange.getStatus()

isTransacted

public boolean isTransacted()
Specified by:
isTransacted in interface javax.jbi.messaging.MessageExchange
Returns:
true if is transacted
See Also:
MessageExchange.isTransacted()

setEndpoint

public void setEndpoint(javax.jbi.servicedesc.ServiceEndpoint endpoint)
Specified by:
setEndpoint in interface javax.jbi.messaging.MessageExchange
Parameters:
endpoint - the endpoint
See Also:
javax.jbi.messaging.MessageExchange#setEndpoint(java.lang.Exception)

setError

public void setError(java.lang.Exception error)
Specified by:
setError in interface javax.jbi.messaging.MessageExchange
Parameters:
error - the error
See Also:
MessageExchange.setError(java.lang.Exception)

setFault

public void setFault(javax.jbi.messaging.Fault fault)
              throws javax.jbi.messaging.MessagingException
(non-Javadoc).

Specified by:
setFault in interface javax.jbi.messaging.MessageExchange
Parameters:
fault - the fault
Throws:
javax.jbi.messaging.MessagingException - Impossible to set the fault
See Also:
MessageExchange.setFault(javax.jbi.messaging.Fault)

setInterfaceName

public void setInterfaceName(javax.xml.namespace.QName interfaceName)
(non-Javadoc).

Specified by:
setInterfaceName in interface javax.jbi.messaging.MessageExchange
Parameters:
interfaceName - the interfaceName
See Also:
javax.jbi.messaging.MessageExchange#setFault(javax.jbi.messaging.setInterfaceName)

setMessage

public void setMessage(javax.jbi.messaging.NormalizedMessage msg,
                       java.lang.String name)
                throws javax.jbi.messaging.MessagingException
Specified by:
setMessage in interface javax.jbi.messaging.MessageExchange
Parameters:
msg - the message
name - the name
Throws:
javax.jbi.messaging.MessagingException - impossible to set the message
See Also:
MessageExchange.setMessage(javax.jbi.messaging.NormalizedMessage, java.lang.String)

setOperation

public void setOperation(javax.xml.namespace.QName name)
Specified by:
setOperation in interface javax.jbi.messaging.MessageExchange
Parameters:
name - the name of the operation
See Also:
MessageExchange.setOperation(javax.xml.namespace.QName)

setProperty

public void setProperty(java.lang.String name,
                        java.lang.Object obj)
Specified by:
setProperty in interface javax.jbi.messaging.MessageExchange
Parameters:
name - the name
obj - the property object
See Also:
MessageExchange.setProperty(java.lang.String, java.lang.Object)

setService

public void setService(javax.xml.namespace.QName service)
Specified by:
setService in interface javax.jbi.messaging.MessageExchange
Parameters:
service - the service name
See Also:
MessageExchange.setService(QName service)

setStatus

public void setStatus(javax.jbi.messaging.ExchangeStatus status)
               throws javax.jbi.messaging.MessagingException
Specified by:
setStatus in interface javax.jbi.messaging.MessageExchange
Parameters:
status - the status
Throws:
javax.jbi.messaging.MessagingException - Impossible to set the status
See Also:
MessageExchange.setStatus(javax.jbi.messaging.ExchangeStatus)

setExchangeId

public void setExchangeId(java.lang.String id)
Set the ExchangeId.

Parameters:
id - the id of message

setPattern

public void setPattern(java.net.URI p)
Set the pattern.

Parameters:
p - the pattern

setRole

public void setRole(javax.jbi.messaging.MessageExchange.Role r)
Set the role.

Parameters:
r - the role

getMessages

public java.util.Map<java.lang.String,javax.jbi.messaging.NormalizedMessage> getMessages()
Get all messages.

Returns:
all the messages

readObjectDelegate

protected void readObjectDelegate(java.io.ObjectInputStream s)
                           throws java.io.IOException
Parameters:
s - the object input stream
Throws:
java.io.IOException - impossible to read the object
See Also:
MessageExchangeImpl#readObject(ObjectInputStream)

writeObjectDelegate

protected void writeObjectDelegate(java.io.ObjectOutputStream s)
                            throws java.io.IOException
Parameters:
s - the object output stream
Throws:
java.io.IOException - impossible to write object delegate
See Also:
MessageExchangeImpl#writeObject(ObjectOutputStream).

getFlowAttributes

public javax.jbi.messaging.FlowAttributes getFlowAttributes()
Specified by:
getFlowAttributes in interface javax.jbi.messaging.MessageExchange

setFlowAttributes

public void setFlowAttributes(javax.jbi.messaging.FlowAttributes flowAttributes)
Specified by:
setFlowAttributes in interface javax.jbi.messaging.MessageExchange


Copyright © 2005-2011 Petals Link (EBM Websourcing). All Rights Reserved.