com.nexaweb.messaging
Class MessageListener

java.lang.Object
  extended bycom.nexaweb.messaging.MessageListener

public abstract class MessageListener
extends java.lang.Object

MessageListener may be extended to listen for messages sent across the Nexaweb Internet Messaging Bus (IMB).

Subclasses should override the methods to receive messages of specific types. The onMessage() variant called will always correspond to the variant of the publsh() or send() method called to put the message on the IMB.

All messaging on the server side is accessed through the MessagingService. All messaging on the client side is accessed through the NetService.

Since:
4.0
See Also:
MessagingService, NetService

Constructor Summary
MessageListener()
           
 
Method Summary
 void onMessage(java.lang.String topic, byte[] bytes)
          This method is called when a message arrives on one of the topics to which this listener is subscribed and the type of the message content is byte[].
 void onMessage(java.lang.String topic, Document document)
          This method is called when a message arrives on one of the topics to which this listener is subscribed and the type of the message content is Document.
 void onMessage(java.lang.String topic, Element element)
          This method is called when a message arrives on one of the topics to which this listener is subscribed and the type of the message content is Element.
 void onMessage(java.lang.String topic, java.io.Serializable serializable)
          This method is called when a message arrives on one of the topics to which this listener is subscribed and the type of the message content is java.io.Serializable.
 void onMessage(java.lang.String topic, java.lang.String content)
          This method is called when a message arrives on one of the topics to which this listener is subscribed and the type of the message content is java.lang.String.
 void onMessage(java.lang.String topic, XmlSerializable xmlSerializable)
          This method is called when a message arrives on one of the topics to which this listener is subscribed and the type of the message content is com.nexaweb.xml.XmlSerializable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageListener

public MessageListener()
Method Detail

onMessage

public void onMessage(java.lang.String topic,
                      Document document)
This method is called when a message arrives on one of the topics to which this listener is subscribed and the type of the message content is Document.

If this method is not overridden, its default behavior is to output an info message to the log stating that there was an unhandled message.

Parameters:
topic - The topic on which the message was sent.
document - The Document payload of the message.
Since:
4.0

onMessage

public void onMessage(java.lang.String topic,
                      Element element)
This method is called when a message arrives on one of the topics to which this listener is subscribed and the type of the message content is Element.

If this method is not overridden, its default behavior is to output an info message to the log stating that there was an unhandled message.

Parameters:
topic - The topic on which the message was sent.
element - The Element payload of the message.
Since:
4.0

onMessage

public void onMessage(java.lang.String topic,
                      java.io.Serializable serializable)
This method is called when a message arrives on one of the topics to which this listener is subscribed and the type of the message content is java.io.Serializable.

If this method is not overridden, its default behavior is to output an info message to the log stating that there was an unhandled message.

Parameters:
topic - The topic on which the message was sent.
serializable - The Serializable payload of the message.
Since:
4.0

onMessage

public void onMessage(java.lang.String topic,
                      XmlSerializable xmlSerializable)
This method is called when a message arrives on one of the topics to which this listener is subscribed and the type of the message content is com.nexaweb.xml.XmlSerializable.

If this method is not overridden, its default behavior is to output an info message to the log stating that there was an unhandled message.

Parameters:
topic - The topic on which the message was sent.
xmlSerializable - The XmlSerializable payload of the message.
Since:
4.0

onMessage

public void onMessage(java.lang.String topic,
                      byte[] bytes)
This method is called when a message arrives on one of the topics to which this listener is subscribed and the type of the message content is byte[].

If this method is not overridden, its default behavior is to output an info message to the log stating that there was an unhandled message.

Parameters:
topic - The topic on which the message was sent.
bytes - The byte array payload of the message.
Since:
4.0

onMessage

public void onMessage(java.lang.String topic,
                      java.lang.String content)
This method is called when a message arrives on one of the topics to which this listener is subscribed and the type of the message content is java.lang.String.

If this method is not overridden, its default behavior is to output an info message to the log stating that there was an unhandled message.

Parameters:
topic - The topic on which the message was sent.
content - The String payload of the message.
Since:
4.0


Copyright © 2005 Nexaweb Technologies, Inc. All Rights Reserved.