The ongoing development of Aglets has changed the messaging API. Changes are due to a refactoring process which aim is to provide a better modularity and more power.
The first change regards the introduction of the com.ibm.aglet.message package, that contains all the message related stuff (i.e., message classes, arguments and exceptions). New applications should use the classes contained in this package for the messaging. This means that instead of using com.ibm.aglet.Message, developers should now refer to com.ibm.aglet.message.Message. Similar considerations for the other classes, in particular:
Nevertheless, in order to not break backward compatibility, there are still the same classes in the com.ibm.aglet package. The latter classes inherit from the com.ibm.aglet.message ones and are now deprecated. In other words, com.ibm.aglet.Message inherits from com.ibm.aglet.message.Message. This allows you to still compile and run your old applications, but please note that new applications should use the new com.ibm.aglet.message classes.
Another change introduces the message priority. Now the Message class has a set/get priority methods, declared final, that can be used to manage the priority of the message. Thanks to this, an agent can post a message to another agent specifying a priority at which the addressee agent should process such message. The message queue objects have been adapted to use such priority in order to push and pop messages depending on their priority.
An agent can specify the message priority chosing among a few constants defined in the Message class itself, in particular among MIN_PRIORITY, MAX_PRIORITY and NORMAL_PRIORITY. The priority is specified as an integer (int), and in the current implementation the priority is normalized at NORMAL_PRIORITY if it does not fit the priority range.
For details about the implementation please see the mailing list thread: http://sourceforge.net/mailarchive/forum.php?thread_name=200708270952.07763.cat4hire%40users.sourceforge.net&forum_name=aglets-developer
Log in to post a comment.