jGCS Documentation

net.sf.jgcs
Class AbstractControlSession

java.lang.Object
  extended by net.sf.jgcs.AbstractControlSession
All Implemented Interfaces:
ControlSession
Direct Known Subclasses:
AbstractMembershipSession

public abstract class AbstractControlSession
extends java.lang.Object
implements ControlSession

This class defines a AbstractControlSession. It partially implements the ControlSession interface by handling the listeners. It provides methods for notification of listeners that can be used by final implementations.

Version:
1.0
Author:
Nuno Carvalho

Constructor Summary
AbstractControlSession()
           
 
Method Summary
protected  void boot()
          Initializes any variables needed by this session.
protected  boolean hasAllListeners()
          Returns true if all listeners are registered.
protected  void notifyExceptionListeners(JGCSException exception)
          Notifies the exception listener.
protected  void notifyFailed(java.net.SocketAddress peer)
          Notifies the control listener that a member has failed.
protected  void notifyJoin(java.net.SocketAddress peer)
          Notifies the control listener of a new member in the group.
protected  void notifyLeave(java.net.SocketAddress peer)
          Notifies the control listener of a leaved member.
 void setControlListener(ControlListener listener)
          Sets the control listener.
 void setExceptionListener(ExceptionListener listener)
          Sets the exception listener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.jgcs.ControlSession
getLocalAddress, isJoined, join, leave
 

Constructor Detail

AbstractControlSession

public AbstractControlSession()
Method Detail

boot

protected void boot()
Initializes any variables needed by this session.


setControlListener

public void setControlListener(ControlListener listener)
Sets the control listener.

Specified by:
setControlListener in interface ControlSession
Parameters:
listener - The listener to be bound to the membership service.

setExceptionListener

public void setExceptionListener(ExceptionListener listener)
Sets the exception listener.

Specified by:
setExceptionListener in interface ControlSession
Parameters:
listener - the exception thrown by the implementation of the interface.

hasAllListeners

protected boolean hasAllListeners()
Returns true if all listeners are registered.

Returns:

notifyExceptionListeners

protected void notifyExceptionListeners(JGCSException exception)
Notifies the exception listener.

Parameters:
exception - the exception to notify.

notifyJoin

protected void notifyJoin(java.net.SocketAddress peer)
Notifies the control listener of a new member in the group.

Parameters:
peer - the address of the new member.

notifyLeave

protected void notifyLeave(java.net.SocketAddress peer)
Notifies the control listener of a leaved member.

Parameters:
peer - the address of the old member.

notifyFailed

protected void notifyFailed(java.net.SocketAddress peer)
Notifies the control listener that a member has failed.

Parameters:
peer - the address of the old member.

jGCS Documentation

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