net.sf.genuine.organizer.internal
Class DefaultChannel

java.lang.Object
  extended bynet.sf.genuine.organizer.internal.DefaultChannel
All Implemented Interfaces:
Channel

public class DefaultChannel
extends java.lang.Object
implements Channel

Default implementation of a channel.

Author:
Tim Wellhausen

Constructor Summary
(package private) DefaultChannel(java.lang.String channelName)
           
 
Method Summary
 void deregisterMessageListener(MessageListener messageListener)
          Deregisters the given message listener so that it won't receive any messages any more.
 void registerMessageListener(MessageListener messageListener)
          Registers the given message listener to retrieve all upcoming messages.
 void sendMessage(Message message)
          Sends a fire-and-forget message that is forwarded to all message listener.
 void sendVetoableMessage(Message message)
          Sends a vetoable message.
 java.lang.String toString()
          Prints the name of the channel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultChannel

DefaultChannel(java.lang.String channelName)
Method Detail

registerMessageListener

public void registerMessageListener(MessageListener messageListener)
Description copied from interface: Channel
Registers the given message listener to retrieve all upcoming messages.

Specified by:
registerMessageListener in interface Channel

deregisterMessageListener

public void deregisterMessageListener(MessageListener messageListener)
Description copied from interface: Channel
Deregisters the given message listener so that it won't receive any messages any more.

Specified by:
deregisterMessageListener in interface Channel

sendMessage

public void sendMessage(Message message)
Description copied from interface: Channel
Sends a fire-and-forget message that is forwarded to all message listener. The sender does not have to register themself at the channel to send a message.

Specified by:
sendMessage in interface Channel

sendVetoableMessage

public void sendVetoableMessage(Message message)
                         throws MessageVetoException
Description copied from interface: Channel
Sends a vetoable message. If any message listener files a veto against the message, a MessageVetoException is thrown by the listener itself. In that case, the message is not forwarded to any listeners. If no veto is filed, the message is forwarded to all listeners.

Specified by:
sendVetoableMessage in interface Channel
Throws:
MessageVetoException

toString

public java.lang.String toString()
Prints the name of the channel