|
Vordel SDK | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap<K,V>
java.util.HashMap<java.lang.String,java.lang.Object>
com.vordel.circuit.Message
public class Message
Represents the state of a request as it passes through a Circuit
This object maps property names to Objects.
MessageProcessor
s can inspect, add, and remove properties as they
perform their work. Co-operating MessageProcessors can share these properties,
once a type is agreed for them.
The MessageListener
interface can be used to listen to Message lifecycle events. A MessageListener can be
registered with a Message instance by listening first for a Message creation event via the
addCreationListener(MessageCreationListener)
then calling the
addMessageListener(MessageListener)
method on the Message parameter, e.g.
Message.addCreationListener(new MessageCreationListener() { public void messageCreated(Message m, Object source) { m.addMessageListener(new MessageListenerAdapter(){ public void preCircuitProcessing(Circuit initialContext, Message message, Object context) { System.out.println("Message about to be processed in circuits, id: "+message.correlationId); } }); } });Notification of completion of a message in the circuit can be monitored, to allow for cleanup of resources when the message is no longer useful.
MessageListener.onMessageCompletion(com.vordel.circuit.Message)
callbacks are called in the reverse order to that in which they
are registered.
MessageProperties, which contains a list of well-known
message properties.
,
Serialized FormNested Class Summary |
---|
Nested classes/interfaces inherited from class java.util.AbstractMap |
---|
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V> |
Nested classes/interfaces inherited from interface java.util.Map |
---|
java.util.Map.Entry<K,V> |
Nested classes/interfaces inherited from interface com.vordel.common.Dictionary |
---|
com.vordel.common.Dictionary.MapAs |
Field Summary | |
---|---|
com.vordel.dwe.CorrelationID |
correlationId
|
protected static java.util.List<MessageCreationListener> |
creationCallbacks
|
long |
creationTime
|
Constructor Summary | |
---|---|
Message(com.vordel.dwe.CorrelationID correlationId,
java.lang.Object source)
Create a new message object. |
Method Summary | |
---|---|
static void |
addCreationListener(MessageCreationListener mcl)
When a new message is created, each MessageCreationListener is informed, so it may decorate the message with its own private annotations. |
void |
addMessageListener(MessageListener listener)
Add a listener to intercept this Message before and after filter and circuit invocations. |
void |
addPropertiesListener(java.beans.PropertyChangeListener listener)
|
void |
addPropertiesListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
|
java.lang.String |
allocID()
|
void |
complete()
Called once the message has been entirely processed and the client transaction complete. |
boolean |
containsKey(java.lang.String key)
|
static void |
deregisterMessageLocalStorage(int slot)
Deregister a message local slot. |
void |
firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
|
void |
forceGenerateAttributes()
|
java.lang.Object |
get(java.lang.String key)
|
com.vordel.dwe.CorrelationID |
getIDBase()
|
int |
getLogMask()
|
java.lang.Object |
getMessageLocalStorage(int slot)
Get the caller-specific Object previously set in the Message by setMessageLocalStorage(int, java.lang.Object) . |
int |
getPayloadMask()
|
com.vordel.circuit.log.LogMessagePayloadProcessor |
getPayloadProcessor()
|
void |
logPayload(Circuit c,
int maskItem,
MessageProcessor caller)
|
java.lang.Object |
put(java.lang.String key,
java.lang.Object value)
|
static void |
registerGenerator(java.lang.String property,
MessagePropertyGenerator generator)
|
static int |
registerMessageLocalStorage()
Reserve a slot in each new Message instance in which to store an Object. |
java.lang.Object |
remove(java.lang.String key)
|
static boolean |
removeCreationListener(MessageCreationListener mcl)
Remove the message creation listener |
void |
removeMessageListener(MessageListener listener)
Remove all occurrences of a listener added in the corresponding addMessageListener(com.vordel.circuit.MessageListener) method. |
void |
removePropertiesListener(java.beans.PropertyChangeListener listener)
|
void |
removePropertiesListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
|
java.lang.String |
replaceAttributeValues(java.lang.String inputString)
takes a string containing message attribute names delimited by "%" characters and replaces the so-encoded substrings with the named values from the message. |
void |
setLogMask(int logMask)
|
void |
setMessageLocalStorage(int slot,
java.lang.Object o)
Set a caller-specific Object in a previously registered slot in the Message. |
void |
setPayloadMask(int payloadMask)
|
void |
setPayloadProcessor(com.vordel.circuit.log.LogMessagePayloadProcessor payloadProcessor)
|
void |
storeOpsField(com.vordel.dwe.http.Transaction txn,
java.lang.String msgField,
java.lang.String opsDBField)
|
Methods inherited from class java.util.HashMap |
---|
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, putAll, remove, size, values |
Methods inherited from class java.util.AbstractMap |
---|
equals, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, putAll, remove, size, values |
Field Detail |
---|
public final com.vordel.dwe.CorrelationID correlationId
public final long creationTime
protected static final java.util.List<MessageCreationListener> creationCallbacks
Constructor Detail |
---|
public Message(com.vordel.dwe.CorrelationID correlationId, java.lang.Object source)
correlationId
: A unique id for this messagecreationTime
: The creation time of this messageMessageProperties.MESSAGE_RECEPTION_TIME
: The creationTime
available via the propertiesMessageCreationListener
s are informed of the
construction of this message, after the specified fields are initialized.
Method Detail |
---|
public com.vordel.dwe.CorrelationID getIDBase()
public java.lang.String allocID()
public static final int registerMessageLocalStorage()
LoadableModule.load(com.vordel.dwe.LoadableModule, java.lang.String)
method, which may wish to reserve one slot for all instances of its
type to say track transport-specific information in each Message. Lookup of Message-local Objects is optimized as
it is a simple indexing into an internal array, and Objects stored in this way are isolated from the
MessageProperties.
java.lang.RuntimeException
- if the 64 slot maximum is exceeded.getMessageLocalStorage(int)
,
setMessageLocalStorage(int, Object)
,
deregisterMessageLocalStorage(int)
public static final void deregisterMessageLocalStorage(int slot)
LoadableModule.unload()
method.
slot
- The slot number to release. This slot becomes available to further
registerMessageLocalStorage()
calls. There is no guarantee that subsequent calls to
registerMessageLocalStorage()
by the same caller will result in the same slot being returned.public void setMessageLocalStorage(int slot, java.lang.Object o)
MessageListener
callback method, early on in the Message lifecycle.
slot
- The slot in which to set the Object.o
- The Object.public java.lang.Object getMessageLocalStorage(int slot)
setMessageLocalStorage(int, java.lang.Object)
.
slot
- The slot to lookup.
public void complete()
TransportModule
when finished with the client transactions on this Message.
public static final void addCreationListener(MessageCreationListener mcl)
public static final boolean removeCreationListener(MessageCreationListener mcl)
public final void addMessageListener(MessageListener listener)
listener
- The MessageListener
public final void removeMessageListener(MessageListener listener)
addMessageListener(com.vordel.circuit.MessageListener)
method.
listener
- The MessageListener
public void setLogMask(int logMask)
public int getLogMask()
public void setPayloadMask(int payloadMask)
public int getPayloadMask()
public void setPayloadProcessor(com.vordel.circuit.log.LogMessagePayloadProcessor payloadProcessor)
public com.vordel.circuit.log.LogMessagePayloadProcessor getPayloadProcessor()
public final void addPropertiesListener(java.beans.PropertyChangeListener listener)
public final void addPropertiesListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
public final void removePropertiesListener(java.beans.PropertyChangeListener listener)
public final void removePropertiesListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
public void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
public java.lang.Object put(java.lang.String key, java.lang.Object value)
put
in interface java.util.Map<java.lang.String,java.lang.Object>
put
in class java.util.HashMap<java.lang.String,java.lang.Object>
public java.lang.Object remove(java.lang.String key)
public static void registerGenerator(java.lang.String property, MessagePropertyGenerator generator)
public void forceGenerateAttributes()
public java.lang.String replaceAttributeValues(java.lang.String inputString)
inputString
- The string with the attributes names.
public java.lang.Object get(java.lang.String key)
get
in interface com.vordel.common.Dictionary
public boolean containsKey(java.lang.String key)
containsKey
in interface com.vordel.common.Dictionary
public void logPayload(Circuit c, int maskItem, MessageProcessor caller)
public void storeOpsField(com.vordel.dwe.http.Transaction txn, java.lang.String msgField, java.lang.String opsDBField)
|
Vordel SDK | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |