Jumpi v1.2.0

org.jumpi.impl
Class EnvelopeImpl

java.lang.Object
  |
  +--org.jumpi.impl.EnvelopeImpl
All Implemented Interfaces:
Envelope

public class EnvelopeImpl
extends java.lang.Object
implements Envelope

An Envelope implementation.


Field Summary
protected  java.util.Hashtable clientProps_
          Read-only client customization properties.
protected  Destination dest_
          The Destination to which message data is sent to or received from.
protected  java.util.Hashtable props_
          Internal customization properties.
protected  Destination sender_
          The sender of the message, if any.
protected  Stack stack_
          The context stack used for storing message data and performing transformations.
 
Constructor Summary
EnvelopeImpl()
          Creates a new EnvelopeImpl object, typically used for testing purposes.
EnvelopeImpl(Destination dest, java.util.Hashtable clientProps)
          Creates a new EnvelopeImpl object, typically used for receiving operations.
EnvelopeImpl(java.lang.Object message, Destination dest, java.util.Hashtable clientProps)
          Creates a new EnvelopeImpl object, typically used for sending operations.
 
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()
          Return the Destination to which messages are sent or received.
 java.util.Hashtable getProperties()
          Return any internal properties.
 Destination getSender()
          Return the sender of received messages.
 java.lang.Object popContext()
          Return the topmost Object from the Envelope's context stack.
 void pushContext(java.lang.Object obj)
          Push the 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 messages are sent or received.
 void setSender(Destination sender)
          Set the sender of received messages.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dest_

protected Destination dest_
The Destination to which message data is sent to or received from.


sender_

protected Destination sender_
The sender of the message, if any.


clientProps_

protected java.util.Hashtable clientProps_
Read-only client customization properties.


stack_

protected Stack stack_
The context stack used for storing message data and performing transformations.


props_

protected java.util.Hashtable props_
Internal customization properties.

Constructor Detail

EnvelopeImpl

public EnvelopeImpl()
Creates a new EnvelopeImpl object, typically used for testing purposes.


EnvelopeImpl

public EnvelopeImpl(java.lang.Object message,
                    Destination dest,
                    java.util.Hashtable clientProps)
Creates a new EnvelopeImpl object, typically used for sending operations.

Parameters:
message - the message to place on top of the envelope's context stack.
dest - the Destination to which message data is to be sent or received from.
clientProps - the read-only client properties as used in Jumpi.send() or Jumpi.recv().

EnvelopeImpl

public EnvelopeImpl(Destination dest,
                    java.util.Hashtable clientProps)
Creates a new EnvelopeImpl object, typically used for receiving operations.

Parameters:
dest - the Destination from which to receive a message.
clientProps - the read-only client properties as used in Jumpi.send() or Jumpi.recv().
Method Detail

getDestination

public Destination getDestination()
Return the Destination to which messages are sent or received.

Specified by:
getDestination in interface Envelope
Returns:
the Destination to which messages are sent or received.
See Also:
setDestination(org.jumpi.spi.Destination)

setDestination

public void setDestination(Destination dest)
Set the Destination to which messages are sent or received.

Specified by:
setDestination in interface Envelope
Parameters:
dest - the Destination to which messages are sent or received.
See Also:
getDestination()

getSender

public Destination getSender()
Return the sender of received messages.

Specified by:
getSender in interface Envelope
Returns:
the sender of received messages.
See Also:
setSender(org.jumpi.spi.Destination)

setSender

public void setSender(Destination sender)
Set the sender of received messages.

Specified by:
setSender in interface Envelope
Parameters:
sender - the sender of received messages.
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.

Specified by:
ensureProperties in interface Envelope
See Also:
getProperties()

removeProperties

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

Specified by:
removeProperties in interface Envelope
See Also:
getProperties()

getProperties

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

Specified by:
getProperties in interface Envelope
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().

Specified by:
getClientProperties in interface Envelope
Returns:
the read-only client properties as used in Jumpi.send() or Jumpi.recv().
See Also:
setClientProperties(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().

Specified by:
setClientProperties in interface Envelope
Parameters:
clientProps - read-only client properties as used in Jumpi.send() or Jumpi.recv().
See Also:
getClientProperties()

popContext

public java.lang.Object popContext()
Return the topmost Object from the Envelope's context stack.

Specified by:
popContext in interface Envelope
Returns:
the topmost Object from the Envelope's context stack, or null if none available.
See Also:
Transformer, Envelope.pushContext(java.lang.Object)

pushContext

public void pushContext(java.lang.Object obj)
Push the Object onto the top of the Envelope's context stack.

Specified by:
pushContext in interface Envelope
Parameters:
obj - the Object to put onto the top of the Envelope's context stack.
Throws:
java.lang.IllegalArgumentException - if obj is null.
See Also:
Transformer, Envelope.popContext()

Jumpi v1.2.0

Copyright 2003, Peter Jonathan Klauser.