Jumpi v1.2.0

org.jumpi.spi
Interface Envelope

All Known Implementing Classes:
EnvelopeImpl

public interface Envelope

An Envelope carries all information relating to send and receive operations between Controllers and Connectors. Envelopes are instantiated by Controllers for conveying both message data, addressing information and customizing information between Controller and Connector. A single Envelope is used per send or receive operation at the Connector layer.

See Also:
Connector.recv(org.jumpi.spi.Envelope), Controller.callbackRecv(org.jumpi.spi.Envelope, boolean, java.lang.String), Connector.send(org.jumpi.spi.Envelope), Controller.callbackSend(org.jumpi.spi.Envelope, boolean, java.lang.String)

Method Summary
 void ensureProperties()
          Ensure that internal properties exist such that getProperties does not return null, if removeProperties is not called afterwards.
 java.util.Hashtable getClientProperties()
          Returns the read-only client properties as used in Jumpi.send() or Jumpi.recv().
 Destination getDestination()
          Get the Destination to which message data is sent, or message data is received from.
 java.util.Hashtable getProperties()
          Return any internal properties.
 Destination getSender()
          Get the Destination of the sender of the message data.
 java.lang.Object popContext()
           Pop the topmost Object off the Envelope's context stack.
 void pushContext(java.lang.Object ctx)
           Push an Object onto the top of the Envelope's context stack.
 void removeProperties()
          Remove any internal properties, such that getProperties returns null unless ensureProperties is called afterwards.
 void setClientProperties(java.util.Hashtable clientProps)
          Sets the read-only client properties as used in Jumpi.send() or Jumpi.recv().
 void setDestination(Destination dest)
          Set the Destination to which message data is sent, or message data is received from.
 void setSender(Destination sender)
          Set the Destination of the sender of the message data.
 

Method Detail

getDestination

public Destination getDestination()
Get the Destination to which message data is sent, or message data is received from.

Returns:
the Destination to which message data is to be sent or received from.
See Also:
setDestination(org.jumpi.spi.Destination)

setDestination

public void setDestination(Destination dest)
Set the Destination to which message data is sent, or message data is received from. Set by the Controller before performing Controller.send or Controller.recv.

Parameters:
dest - the Destination to which message data is to be sent or received from.
See Also:
getDestination(), Connector.send(org.jumpi.spi.Envelope), Connector.recv(org.jumpi.spi.Envelope)

getSender

public Destination getSender()
Get the Destination of the sender of the message data. Only available for Envelopes which are associated with receive operations. Set typically by the Connector layer before calling Controller.callbackRecv.

Returns:
the sender of the envelope when receiving if known, or null.
See Also:
setSender(org.jumpi.spi.Destination), Controller.callbackRecv(org.jumpi.spi.Envelope, boolean, java.lang.String)

setSender

public void setSender(Destination sender)
Set the Destination of the sender of the message data. This is performed on receiving message data, primarily by a Connector. Typically different from the Destination in getDestination if the getDestination is a wildcard Destination.

Parameters:
sender - the Destination of the sender of the message data.
See Also:
getSender()

ensureProperties

public void ensureProperties()
Ensure that internal properties exist such that getProperties does not return null, if removeProperties is not called afterwards.

See Also:
getProperties(), removeProperties()

removeProperties

public void removeProperties()
Remove any internal properties, such that getProperties returns null unless ensureProperties is called afterwards.

See Also:
getProperties(), ensureProperties()

getProperties

public java.util.Hashtable getProperties()
Return any internal properties. Internal properties are used to convey internal data between Controllers and Connectors. These are separate and guaranteed different from the client application properties used in Jumpi.send() or Jumpi.recv(). The properties used in internal properties are implementation dependent.

Returns:
internal properties, or null if none available.

getClientProperties

public java.util.Hashtable getClientProperties()
Returns the read-only client properties as used in Jumpi.send() or Jumpi.recv().

Returns:
the read-only client properties as used in Jumpi.send() or Jumpi.recv().
See Also:
setClientProperties(java.util.Hashtable), Jumpi.send(org.jumpi.Destination, java.lang.Object, org.jumpi.Selector, java.util.Hashtable), Jumpi.recv(org.jumpi.Destination, org.jumpi.Selector, java.util.Hashtable)

setClientProperties

public void setClientProperties(java.util.Hashtable clientProps)
Sets the read-only client properties as used in Jumpi.send() or Jumpi.recv().

Parameters:
clientProps - read-only client properties as used in Jumpi.send() or Jumpi.recv().
See Also:
getClientProperties(), Jumpi.send(org.jumpi.Destination, java.lang.Object, org.jumpi.Selector, java.util.Hashtable), Jumpi.recv(org.jumpi.Destination, org.jumpi.Selector, java.util.Hashtable)

popContext

public java.lang.Object popContext()

Pop the topmost Object off the Envelope's context stack. Message data and any other data required for transformation of a message for transmission can be placed on the context stack with pushContext and removed with popContext.

A Transformer accesses the Envelope's context stack in order to get data for message transformation. It is the responsibility of the Controller to put data in the context stack on send. It is the responsibility of the Connector to place data on the context stack on receive.

Returns:
the top of the context stack or null if the stack is empty.
See Also:
Transformer, pushContext(java.lang.Object)

pushContext

public void pushContext(java.lang.Object ctx)

Push an Object onto the top of the Envelope's context stack. Message data and any other data required for transformation of a message for transmission can be placed on the context stack with pushContext and removed with popContext.

A Transformer accesses the Envelope's context stack in order to get data for transformation. It is the responsibility of the Controller to put data in the context stack on send. It is the responsibility of the Connector to place data on the context stack on receive.

Parameters:
ctx - the object to put onto the stack.
See Also:
Transformer, popContext()

Jumpi v1.2.0

Copyright © 2003, Peter Jonathan Klauser.