net.dpml.station.server
Class UnicastEventSource

java.lang.Object
  extended byjava.rmi.server.RemoteObject
      extended byjava.rmi.server.RemoteServer
          extended byjava.rmi.server.UnicastRemoteObject
              extended bynet.dpml.station.server.UnicastEventSource
All Implemented Interfaces:
Remote, Serializable
Direct Known Subclasses:
RemoteApplication

public abstract class UnicastEventSource
extends UnicastRemoteObject

A abstract base class that established an event queue and handles event dispatch operations for listeners declared in a class extending this base class.

Version:
1.0.1
Author:
Digital Product Meta Library
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
UnicastEventSource(Logger logger)
          Creation of a new event producer.
 
Method Summary
protected  void addListener(EventListener listener)
          Add a listener to the set of listeners handled by this producer.
protected  void enqueueEvent(EventObject event)
          Enqueue an event for delivery to registered listeners unless there are no registered listeners.
protected  Logger getLogger()
          Return the assigned logging channel.
protected  EventListener[] listeners()
          Return this node's preference/node change listeners.
protected abstract  void processEvent(EventObject event)
          Abstract operation to be implemented by classes extending this base class.
protected  void removeListener(EventListener listener)
          Remove a listener to the set of listeners handled by this producer.
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UnicastEventSource

public UnicastEventSource(Logger logger)
                   throws RemoteException
Creation of a new event producer.

Parameters:
logger - the logging channel
Throws:
RemoteException - if a remote exception occurs
Method Detail

getLogger

protected Logger getLogger()
Return the assigned logging channel.

Returns:
the logging channel

processEvent

protected abstract void processEvent(EventObject event)
Abstract operation to be implemented by classes extending this base class. An implementation is reposible for the posting of the event to associated listeners. Event posting will be executed under a separate thread to the thread that initiated the event post.

Parameters:
event - the event to process

addListener

protected void addListener(EventListener listener)
Add a listener to the set of listeners handled by this producer.

Parameters:
listener - the event listener

removeListener

protected void removeListener(EventListener listener)
Remove a listener to the set of listeners handled by this producer.

Parameters:
listener - the event listener

listeners

protected EventListener[] listeners()
Return this node's preference/node change listeners. Even though we're using a copy-on-write lists, we use synchronized accessors to ensure information transmission from the writing thread to the reading thread.

Returns:
the event listener array

enqueueEvent

protected void enqueueEvent(EventObject event)
Enqueue an event for delivery to registered listeners unless there are no registered listeners.

Parameters:
event - the event to enqueue