jGCS Documentation

Class MultipleMessageListeners

  extended by net.sf.jgcs.adapters.MultipleMessageListeners

public class MultipleMessageListeners
extends java.lang.Object

This adapter is used to register several listeners on the same DataSession. The adapter registers it self in the DataSession and keeps a list of listeners. When a message is received, the adapter delivers the message to all registered listeners.

Nuno Carvalho

Constructor Summary
MultipleMessageListeners(DataSession session, boolean conservative)
          Creates a new Adapter instance.
Method Summary
 void addMessageListener(MessageListener listener)
          Adds a message listener.
 boolean removeMessageListener(MessageListener listener)
          Removes a message listener.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public MultipleMessageListeners(DataSession session,
                                boolean conservative)
                         throws ClosedSessionException
Creates a new Adapter instance. It needs the instance of the DataSession and a boolean that indicates if messages should be delivered on conservative mode (copies of messages to each listener) or not conservative (the same message instance to all listeners).

session - the DataSession where the Messages will be delivered.
conservative - true if messages shoud be delivared on conservative mode.
ClosedSessionException - if the given DataSession is closed.
Method Detail


public void addMessageListener(MessageListener listener)
Adds a message listener.

listener - the listener to add.


public boolean removeMessageListener(MessageListener listener)
Removes a message listener.

listener - the listener to remove
true if the listener was removed, false otherwise.

jGCS Documentation

Copyright (c) 2006, Universidade de Lisboa
For updates and related information please see jGCS home page