jGCS Documentation

net.sf.jgcs
Interface ControlSession

All Known Subinterfaces:
BlockSession, MembershipSession
All Known Implementing Classes:
AbstractBlockSession, AbstractControlSession, AbstractMembershipSession

public interface ControlSession

This class defines a ControlSession. This Session is used to join and leave a simple group. It is also used to register a ControlListener. An instance of this session must be created by the Protocol interface.

Version:
1.0
Author:
Nuno Carvalho
See Also:
Protocol

Method Summary
 java.net.SocketAddress getLocalAddress()
          Gets the local address.
 boolean isJoined()
          Verifies if the member belongs to a group.
 void join()
          Joins the group.
 void leave()
          Leaves the group.
 void setControlListener(ControlListener listener)
          Adds a listener to deliver group membership notifications.
 void setExceptionListener(ExceptionListener exception)
          Adds a listener to deliver exceptions related to message reception and membership notifications.
 

Method Detail

join

void join()
          throws ClosedSessionException,
                 JGCSException
Joins the group. It must block until the join process is finished.

Throws:
ClosedSessionException
JGCSException

leave

void leave()
           throws ClosedSessionException,
                  JGCSException
Leaves the group. It must block until the leave process is finished.

Throws:
ClosedSessionException
JGCSException

isJoined

boolean isJoined()
Verifies if the member belongs to a group.

Returns:
true if the member is correctly joined, false otherwise.

getLocalAddress

java.net.SocketAddress getLocalAddress()
Gets the local address. It should return null if the member is not joined to any group.

Returns:
the local address.

setControlListener

void setControlListener(ControlListener listener)
Adds a listener to deliver group membership notifications.

Parameters:
listener - The listener to be bound to the membership service.

setExceptionListener

void setExceptionListener(ExceptionListener exception)
                          throws ClosedSessionException
Adds a listener to deliver exceptions related to message reception and membership notifications.

Parameters:
exception - the exception thrown by the implementation of the interface.
Throws:
ClosedSessionException

jGCS Documentation

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