jgroup.relacs.gm
Class NewDispatcherLayer

java.lang.Object
  extended by jgroup.relacs.gm.NewDispatcherLayer
All Implemented Interfaces:
java.rmi.Remote, Layer, DispatcherService, PingListener, RemoteDispatcher

public class NewDispatcherLayer
extends java.lang.Object
implements DispatcherService, RemoteDispatcher, PingListener

Handle dispatching daemon events to other layers in the stack, e.g., the MembershipLayer and MulticastLayer.

Since:
Jgroup 0.1 (rewritten for Jgroup 3.0)
Author:
Hein Meling

Nested Class Summary
 
Nested classes/interfaces inherited from interface jgroup.core.Layer
Layer.FinalizeLayer
 
Method Summary
 void addEvent(Event event)
          Receives and stores a message from daemon
 void addListener(java.lang.Object listener)
          Add a listener to this layer.
 void dispatch(java.lang.Object obj)
          Dispatch a single event (can be called by an upcall method)
static NewDispatcherLayer getLayer()
           
 RemoteDispatcher getRemoteDispatcher()
          Returns the remote dispatcher reference.
 void halt()
          Stop dispatching events
 void ping()
          This method is invoked periodically by the daemon to verify whether a remote member object is still active or has crashed.
 void start(int gid)
          Start dispatching events for the given group.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getLayer

public static NewDispatcherLayer getLayer()

addListener

public void addListener(java.lang.Object listener)
Description copied from interface: Layer
Add a listener to this layer. Many layers require to be notified of events produced by other layers in order to provide its own functionallity, and this method must be invoked to notify this layer of an interested listener. A listener may be another layer or an application server replica.

Specified by:
addListener in interface Layer
Parameters:
listener - An Object representation of the listener interface. This will typically be cast to the appropriate listener interface type after checking the type with the instanceof operator.

start

public void start(int gid)
Description copied from interface: DispatcherService
Start dispatching events for the given group.

Specified by:
start in interface DispatcherService

halt

public void halt()
Description copied from interface: DispatcherService
Stop dispatching events

Specified by:
halt in interface DispatcherService

dispatch

public void dispatch(java.lang.Object obj)
Description copied from interface: DispatcherService
Dispatch a single event (can be called by an upcall method)

Specified by:
dispatch in interface DispatcherService

getRemoteDispatcher

public RemoteDispatcher getRemoteDispatcher()
                                     throws JgroupException
Description copied from interface: DispatcherService
Returns the remote dispatcher reference.

Specified by:
getRemoteDispatcher in interface DispatcherService
Throws:
JgroupException - Raised if the dispatcher service could be not export for remote access by the Jgroup daemon.

addEvent

public void addEvent(Event event)
              throws java.rmi.RemoteException
Description copied from interface: RemoteDispatcher
Receives and stores a message from daemon

Specified by:
addEvent in interface RemoteDispatcher
Throws:
java.rmi.RemoteException

ping

public void ping()
          throws java.rmi.RemoteException
Description copied from interface: PingListener
This method is invoked periodically by the daemon to verify whether a remote member object is still active or has crashed. If a remote exception is thrown, this means that the member has crashed.

Specified by:
ping in interface PingListener
Throws:
java.rmi.RemoteException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 1998-2006 The Jgroup/ARM development team. All Rights Reserved.