|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
The MessagingService allows for system wide messaging. All
MessageListeners subscribed on both clients
and servers will hear messages published through this service.
A reference to this service may be obtained by calling the static
ServiceManager.getMessagingService()
method.
Example Usage:
MessagingService messagingService = ServiceManager.getMessagingService();
messagingService.publish( "MyTopic.MySubTopic", "My message" );
Topics specified to methods defined by this interface must consist only of alphanumeric characters and the following ( '-', '.', '_', ':' ).
| Method Summary | |
boolean |
isClientSubscribed(ServerSession session,
java.lang.String topic)
Returns true if the client for the specified ServerSession has a subscription to the specified topic. |
void |
publish(java.lang.String topic,
byte[] array)
Send a byte array to the subscribed listeners on both clients and servers. |
void |
publish(java.lang.String topic,
Document document)
Send a Document to the subscribed listeners on both clients and servers. |
void |
publish(java.lang.String topic,
Element element)
Send an Element and all of its descendants to the subscribed listeners on both clients and servers. |
void |
publish(java.lang.String topic,
java.io.Serializable serializable)
Send a Serializable object to the subscribed listeners on both clients and servers. |
void |
publish(java.lang.String topic,
java.lang.String content)
Send a String to the subscribed listeners on both clients and servers. |
void |
publish(java.lang.String topic,
XmlSerializable xmlSerializable)
Send an XmlSerializable object to the subscribed listeners on both clients and servers. |
void |
send(ServerSession session,
java.lang.String topic,
byte[] bytes)
Send a byte array to subscribed listeners on the client. |
void |
send(ServerSession session,
java.lang.String topic,
Document document)
Send a Document to subscribed listeners on the client. |
void |
send(ServerSession session,
java.lang.String topic,
Element element)
Send an Element and all of its descendants to subscribed listeners on the client. |
void |
send(ServerSession session,
java.lang.String topic,
java.io.Serializable serializable)
Send a Serializable object to subscribed listeners on the client. |
void |
send(ServerSession session,
java.lang.String topic,
java.lang.String content)
Send a String to subscribed listeners on the client. |
void |
send(ServerSession session,
java.lang.String topic,
XmlSerializable xmlSerializable)
Send an XmlSerializable object to subscribed listeners on the client. |
void |
sendAsynchronously(ServerSession session,
java.lang.String topic,
byte[] bytes)
Send a byte array to subscribed listeners on the client. |
void |
sendAsynchronously(ServerSession session,
java.lang.String topic,
Document document)
Send a Document to subscribed listeners on the client. |
void |
sendAsynchronously(ServerSession session,
java.lang.String topic,
Element element)
Send an Element and all of its descendants to subscribed listeners on the client. |
void |
sendAsynchronously(ServerSession session,
java.lang.String topic,
java.io.Serializable serializable)
Send a Serializable object to subscribed listeners on the client. |
void |
sendAsynchronously(ServerSession session,
java.lang.String topic,
java.lang.String content)
Send a String to subscribed listeners on the client. |
void |
sendAsynchronously(ServerSession session,
java.lang.String topic,
XmlSerializable xmlSerializable)
Send an XmlSerializable object to subscribed listeners on the client. |
void |
subscribe(java.lang.String topic,
MessageListener listener)
Subscribes the specified MessageListener to the specified topic. |
void |
unsubscribe(java.lang.String topic,
MessageListener listener)
Unsubscribes the specified MessageListener from the specified topic. |
| Methods inherited from interface com.nexaweb.server.services.Service |
getDescription, getLog, getName, getPerformanceMeter, getStatus, getStatusReport, start, stop |
| Method Detail |
public void publish(java.lang.String topic,
Element element)
throws MessageDispatchException
topic - The topic to which MessageListeners must be
subscribed in order to receive the specified Element.element - The Element to send.
MessageDispatchException
public void publish(java.lang.String topic,
Document document)
throws MessageDispatchException
topic - The topic to which MessageListeners must be
subscribed in order to receive the specified Document.document - The Document to send.
MessageDispatchException
public void publish(java.lang.String topic,
java.io.Serializable serializable)
throws MessageDispatchException
topic - The topic to which MessageListeners must be
subscribed in order to receive the specified Serializable object.serializable - The Serializable object to send.
MessageDispatchException
public void publish(java.lang.String topic,
XmlSerializable xmlSerializable)
throws MessageDispatchException
topic - The topic to which MessageListeners must be
subscribed in order to receive the specified XmlSerializable object.xmlSerializable - The XmlSerializable object to send.
MessageDispatchException
public void publish(java.lang.String topic,
byte[] array)
throws MessageDispatchException
topic - The topic to which MessageListeners must be
subscribed in order to receive the specified byte array.array - The byte array to send.
MessageDispatchException
public void publish(java.lang.String topic,
java.lang.String content)
throws MessageDispatchException
topic - The topic to which MessageListeners must be
subscribed in order to receive the specified String.content - The String to send.
MessageDispatchException
public void send(ServerSession session,
java.lang.String topic,
Element element)
throws MessageDispatchException
session - The session to which the message should be sent.topic - The topic to which MessageListeners must be
subscribed on the client in order to receive this message.element - The Element to send.
MessageDispatchException - thrown if the message could not
be sent.
public void sendAsynchronously(ServerSession session,
java.lang.String topic,
Element element)
session - The session to which the message should be sent.topic - The topic to which MessageListeners must be
subscribed on the client in order to receive this message.element - The Element to send.
public void send(ServerSession session,
java.lang.String topic,
Document document)
throws MessageDispatchException
session - The session to which the message should be sent.topic - The topic to which MessageListeners must be
subscribed on the client in order to receive this message.
MessageDispatchException - thrown if the message could not
be sent.
public void sendAsynchronously(ServerSession session,
java.lang.String topic,
Document document)
session - The session to which the message should be sent.topic - The topic to which MessageListeners must be
subscribed on the client in order to receive this message.document - The Document to send.
public void send(ServerSession session,
java.lang.String topic,
java.io.Serializable serializable)
throws MessageDispatchException
session - The session to which the message should be sent.topic - The topic to which MessageListeners must be
subscribed on the client in order to receive this message.serializable - The Serializable object to send.
MessageDispatchException - thrown if the message could not
be sent.
public void sendAsynchronously(ServerSession session,
java.lang.String topic,
java.io.Serializable serializable)
session - The session to which the message should be sent.topic - The topic to which MessageListeners must be
subscribed on the client in order to receive this message.serializable - The Serializable object to send.
public void send(ServerSession session,
java.lang.String topic,
XmlSerializable xmlSerializable)
throws MessageDispatchException
session - The session to which the message should be sent.topic - The topic to which MessageListeners must be
subscribed on the client in order to receive this message.xmlSerializable - The XmlSerializable object to send.
MessageDispatchException - thrown if the message could not
be sent.
public void sendAsynchronously(ServerSession session,
java.lang.String topic,
XmlSerializable xmlSerializable)
session - The session to which the message should be sent.topic - The topic to which MessageListeners must be
subscribed on the client in order to receive this message.xmlSerializable - The XmlSerializable object to send.
public void send(ServerSession session,
java.lang.String topic,
byte[] bytes)
throws MessageDispatchException
session - The session to which the message should be sent.topic - The topic to which MessageListeners must be
subscribed on the client in order to receive this message.
MessageDispatchException - thrown if the message could not
be sent.
public void sendAsynchronously(ServerSession session,
java.lang.String topic,
byte[] bytes)
session - The session to which the message should be sent.topic - The topic to which MessageListeners must be
subscribed on the client in order to receive this message.
public void send(ServerSession session,
java.lang.String topic,
java.lang.String content)
throws MessageDispatchException
session - The session to which the message should be sent.topic - The topic to which MessageListeners must be
subscribed on the client in order to receive this message.content - The String to send.
MessageDispatchException - thrown if the message could not
be sent.
public void sendAsynchronously(ServerSession session,
java.lang.String topic,
java.lang.String content)
session - The session to which the message should be sent.topic - The topic to which MessageListeners must be
subscribed on the client in order to receive this message.content - The String to send.
public void subscribe(java.lang.String topic,
MessageListener listener)
topic - The topic that the MessageListener will
be subscribed to.listener - The MessageListener to notify when messages
arrive on the specified topic.
InvalidTopicException - thrown if the topic contains
the '*' character.
public void unsubscribe(java.lang.String topic,
MessageListener listener)
topic - The topic that the MessageListener will
be unsubscribed from.listener - The MessageListener to unsubscribe.
public boolean isClientSubscribed(ServerSession session,
java.lang.String topic)
session - The session to check.topic - The topic to check.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||