Jadex 0.941

jadex.adapter
Class AbstractMessageAdapter

java.lang.Object
  extended byjadex.adapter.AbstractMessageAdapter
All Implemented Interfaces:
IMessageAdapter, Serializable
Direct Known Subclasses:
FipaMessageAdapter

public abstract class AbstractMessageAdapter
extends Object
implements IMessageAdapter, Serializable

Generic implementation of the message adapter functionality. Only the getValue() method has to be implemented.

See Also:
Serialized Form

Constructor Summary
AbstractMessageAdapter(Object message)
          Create a message adapter for the given message object.
 
Method Summary
 Object getMessage()
          Get the platform message.
abstract  Object getValue(String name)
          Get the value for a parameter, or the values for a parameter set from the native message.
 boolean match(IMMessageEvent msgevent)
          Match a message with a message event.
static void prepareReceiving(jadex.runtime.impl.IRMessageEvent msgevent, IMessageAdapter msg)
          Fill parameters of a message event from a native one.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMessageAdapter

public AbstractMessageAdapter(Object message)
Create a message adapter for the given message object.

Method Detail

match

public boolean match(IMMessageEvent msgevent)
Match a message with a message event.

Specified by:
match in interface IMessageAdapter
Parameters:
msgevent - The message event.
Returns:
True, if message matches the message event.

getMessage

public Object getMessage()
Get the platform message.

Specified by:
getMessage in interface IMessageAdapter
Returns:
The platform specific message.

getValue

public abstract Object getValue(String name)
Get the value for a parameter, or the values for a parameter set from the native message. Parameter set values can be provided as array, collection, iterator or enumeration.

Specified by:
getValue in interface IMessageAdapter
Returns:
The value or array of values of the parameter (set).

prepareReceiving

public static void prepareReceiving(jadex.runtime.impl.IRMessageEvent msgevent,
                                    IMessageAdapter msg)
Fill parameters of a message event from a native one. Uses the abstract method getParameterOrSetValue to retrieve the values from the native message.


Jadex 0.941

Submit a bug or feature
For further API reference and developer documentation, see the Jadex User Guide and the Jadex Tutorial. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, and working code examples.

Copyright (C) 2002-2005 Lars Braubach, Alexander Pokahr, Andrzej Walczak - University of Hamburg. Use is subject to license terms.