org.apache.servicemix.jbi.messaging
Class ExchangePacket

java.lang.Object
  extended by org.apache.servicemix.jbi.messaging.ExchangePacket
All Implemented Interfaces:
Externalizable, Serializable

public class ExchangePacket
extends Object
implements Externalizable

ExchangePacket is responsible for carrying MessageExchange payloads

Version:
$Revision: 564607 $
See Also:
Serialized Form

Field Summary
protected  boolean aborted
           
protected  ComponentNameSpace destinationId
           
protected  javax.jbi.servicedesc.ServiceEndpoint endpoint
           
protected  Exception error
           
protected  String exchangeId
           
protected  FaultImpl fault
           
protected  NormalizedMessageImpl in
           
protected  QName interfaceName
           
protected  QName operationName
           
protected  NormalizedMessageImpl out
           
protected  URI pattern
           
protected  Boolean persistent
           
protected  Map properties
           
protected  QName serviceName
           
protected  ComponentNameSpace sourceId
           
protected  javax.jbi.messaging.ExchangeStatus status
           
protected  Transaction transactionContext
           
 
Constructor Summary
ExchangePacket()
           
ExchangePacket(ExchangePacket packet)
           
 
Method Summary
 ExchangePacket copy()
          Creates a copy of the packet so it can be sent to another destination
 byte[] getData()
          Retrieve the serialized from of this packet
 ComponentNameSpace getDestinationId()
           
 javax.jbi.servicedesc.ServiceEndpoint getEndpoint()
           
 Exception getError()
           
 String getExchangeId()
           
 javax.jbi.messaging.Fault getFault()
           
 javax.jbi.messaging.NormalizedMessage getIn()
           
 QName getInterfaceName()
           
 QName getOperationName()
           
 javax.jbi.messaging.NormalizedMessage getOut()
           
 URI getPattern()
           
 Boolean getPersistent()
           
 Map getProperties()
           
 Object getProperty(String name)
           
 Set getPropertyNames()
           
 QName getServiceName()
           
 ComponentNameSpace getSourceId()
           
 javax.jbi.messaging.ExchangeStatus getStatus()
           
 Transaction getTransactionContext()
           
 boolean isAborted()
           
 void readExternal(ObjectInput input)
          Read from a stream
static ExchangePacket readPacket(byte[] data)
          Deserialize an ExchangePacket.
 void setAborted(boolean timedOut)
           
 void setDestinationId(ComponentNameSpace destinationId)
           
 void setEndpoint(javax.jbi.servicedesc.ServiceEndpoint endpoint)
           
 void setError(Exception error)
           
 void setExchangeId(String exchangeId)
           
 void setFault(FaultImpl fault)
           
 void setIn(NormalizedMessageImpl in)
           
 void setInterfaceName(QName interfaceName)
           
 void setOperationName(QName operationName)
           
 void setOut(NormalizedMessageImpl out)
           
 void setPattern(URI pattern)
           
 void setPersistent(Boolean persistent)
           
 void setProperty(String name, Object value)
          set a named property on the exchange
 void setServiceName(QName serviceName)
           
 void setSourceId(ComponentNameSpace sourceId)
           
 void setStatus(javax.jbi.messaging.ExchangeStatus status)
           
 void setTransactionContext(Transaction transactionContext)
           
 String toString()
           
 void writeExternal(ObjectOutput output)
          Write to a Stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pattern

protected URI pattern

exchangeId

protected String exchangeId

destinationId

protected ComponentNameSpace destinationId

sourceId

protected ComponentNameSpace sourceId

status

protected javax.jbi.messaging.ExchangeStatus status

serviceName

protected QName serviceName

interfaceName

protected QName interfaceName

operationName

protected QName operationName

error

protected Exception error

properties

protected Map properties

in

protected NormalizedMessageImpl in

out

protected NormalizedMessageImpl out

fault

protected FaultImpl fault

endpoint

protected javax.jbi.servicedesc.ServiceEndpoint endpoint

transactionContext

protected transient Transaction transactionContext

persistent

protected Boolean persistent

aborted

protected boolean aborted
Constructor Detail

ExchangePacket

public ExchangePacket()

ExchangePacket

public ExchangePacket(ExchangePacket packet)
               throws javax.jbi.messaging.MessagingException
Throws:
javax.jbi.messaging.MessagingException
Method Detail

getEndpoint

public javax.jbi.servicedesc.ServiceEndpoint getEndpoint()
Returns:
Returns the endpoint.

setEndpoint

public void setEndpoint(javax.jbi.servicedesc.ServiceEndpoint endpoint)
Parameters:
endpoint - The endpoint to set.

getTransactionContext

public Transaction getTransactionContext()
Returns:
Returns the transactionContext.

setTransactionContext

public void setTransactionContext(Transaction transactionContext)
Parameters:
transactionContext - The transactionContext to set.

getInterfaceName

public QName getInterfaceName()
Returns:
Returns the interfaceName.

setInterfaceName

public void setInterfaceName(QName interfaceName)
Parameters:
interfaceName - The interfaceName to set.

getOperationName

public QName getOperationName()
Returns:
Returns the operationName.

setOperationName

public void setOperationName(QName operationName)
Parameters:
operationName - The operationName to set.

getServiceName

public QName getServiceName()
Returns:
Returns the serviceName.

setServiceName

public void setServiceName(QName serviceName)
Parameters:
serviceName - The serviceName to set.

setStatus

public void setStatus(javax.jbi.messaging.ExchangeStatus status)
Parameters:
status - The status to set.

getStatus

public javax.jbi.messaging.ExchangeStatus getStatus()
Returns:
the status

getPattern

public URI getPattern()
Returns:
Returns the pattern.

setPattern

public void setPattern(URI pattern)
Parameters:
pattern - The pattern to set.

getError

public Exception getError()
Returns:
Returns the error.

setError

public void setError(Exception error)
Parameters:
error - The error to set.

getExchangeId

public String getExchangeId()
Returns:
Returns the exchangeId.

setExchangeId

public void setExchangeId(String exchangeId)
Parameters:
exchangeId - The exchangeId to set.

getProperties

public Map getProperties()
Returns:
Returns the properties.

getProperty

public Object getProperty(String name)
Parameters:
name -
Returns:
the property from the exchange

setProperty

public void setProperty(String name,
                        Object value)
set a named property on the exchange

Parameters:
name -
value -

getPropertyNames

public Set getPropertyNames()
Returns:
property names

getSourceId

public ComponentNameSpace getSourceId()
Returns:
Returns the sourceId.

setSourceId

public void setSourceId(ComponentNameSpace sourceId)
Parameters:
sourceId - The sourceId to set.

getDestinationId

public ComponentNameSpace getDestinationId()
Returns:
Returns the destinationId.

setDestinationId

public void setDestinationId(ComponentNameSpace destinationId)
Parameters:
destinationId - The destinationId to set.

getFault

public javax.jbi.messaging.Fault getFault()
Returns:
Returns the fault.

setFault

public void setFault(FaultImpl fault)
Parameters:
fault - The fault to set.

getIn

public javax.jbi.messaging.NormalizedMessage getIn()
Returns:
Returns the in.

setIn

public void setIn(NormalizedMessageImpl in)
Parameters:
in - The in to set.

getOut

public javax.jbi.messaging.NormalizedMessage getOut()
Returns:
Returns the out.

setOut

public void setOut(NormalizedMessageImpl out)
Parameters:
out - The out to set.

toString

public String toString()
Overrides:
toString in class Object
Returns:
pretty print

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Write to a Stream

Specified by:
writeExternal in interface Externalizable
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Read from a stream

Specified by:
readExternal in interface Externalizable
Parameters:
input -
Throws:
IOException
ClassNotFoundException

copy

public ExchangePacket copy()
                    throws javax.jbi.messaging.MessagingException
Creates a copy of the packet so it can be sent to another destination

Throws:
javax.jbi.messaging.MessagingException

getPersistent

public Boolean getPersistent()

setPersistent

public void setPersistent(Boolean persistent)

isAborted

public boolean isAborted()

setAborted

public void setAborted(boolean timedOut)

getData

public byte[] getData()
               throws IOException
Retrieve the serialized from of this packet

Returns:
the serialized packet
Throws:
IOException

readPacket

public static ExchangePacket readPacket(byte[] data)
                                 throws IOException,
                                        ClassNotFoundException
Deserialize an ExchangePacket.

Parameters:
data - the serialized packet
Returns:
the deserialized packet
Throws:
IOException
ClassNotFoundException


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