Get Bounce at SourceForge.net. Fast secure and Free Open Source software downloads

org.bounce.message
Class DefaultPublisher

java.lang.Object
  extended by org.bounce.message.DefaultPublisher
All Implemented Interfaces:
Publisher

public class DefaultPublisher
extends java.lang.Object
implements Publisher

A default implmenentation of a publisher, used by the distributor to have one publisher for the Message class.

Version:
$Revision: 1.5 $, $Date: 2008/01/28 21:28:37 $
Author:
Edwin Dankert

Constructor Summary
DefaultPublisher()
          Constructs the DefaultPublisher with an empty list of subscribers.
 
Method Summary
 void addSubscriber(Subscriber subscriber)
          Add a new Subscriber.
 void publish(Message message)
          Called when the message needs to be published.
 void removeSubscriber(Subscriber subscriber)
          Remove a Subscriber.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultPublisher

public DefaultPublisher()
Constructs the DefaultPublisher with an empty list of subscribers.

Method Detail

addSubscriber

public void addSubscriber(Subscriber subscriber)
Add a new Subscriber.

Parameters:
subscriber - adds a message subscriber.

removeSubscriber

public void removeSubscriber(Subscriber subscriber)
Remove a Subscriber.

Parameters:
subscriber - removes a message subscriber.

publish

public void publish(Message message)
Called when the message needs to be published. From here the message is distributed to all the subscribers.

Specified by:
publish in interface Publisher
Parameters:
message - the message to be published.

Get Bounce at SourceForge.net. Fast secure and Free Open Source software downloads

Copyright 2002-2002-2009 Edwin Dankert. All Rights Reserved.