org.apache.catalina.cluster
Interface MembershipService

All Known Implementing Classes:
McastService

public interface MembershipService

The membership service helps the cluster determine the membership logic in the cluster.

Version:
$Revision: 1.5 $, $Date: 2004/05/26 16:31:27 $
Author:
Filip Hanik

Method Summary
 void addMembershipListener(MembershipListener listener)
          Sets the membership listener, only one listener can be added.
 Member getLocalMember()
          Returns the member object that defines this member
 Member[] getMembers()
          Returns a list of all the members in the cluster.
 java.util.Properties getProperties()
          Returns the properties for the configuration used.
 void removeMembershipListener()
          removes the membership listener.
 void setLocalMemberProperties(java.lang.String listenHost, int listenPort)
          Sets the local member properties for broadcasting
 void setProperties(java.util.Properties properties)
          Sets the properties for the membership service.
 void start()
          Starts the membership service.
 void start(int level)
          Starts the membership service.
 void stop()
          Stops the membership service
 

Method Detail

setProperties

public void setProperties(java.util.Properties properties)
Sets the properties for the membership service. This must be called before the start() method is called. The properties are implementation specific.

Parameters:
properties - - to be used to configure the membership service.

getProperties

public java.util.Properties getProperties()
Returns the properties for the configuration used.


start

public void start()
           throws java.lang.Exception
Starts the membership service. If a membership listeners is added the listener will start to receive membership events. Performs a start level 1 and 2

Throws:
java.lang.Exception - if the service fails to start.

start

public void start(int level)
           throws java.lang.Exception
Starts the membership service. If a membership listeners is added the listener will start to receive membership events.

Parameters:
level - - level 1 starts listening for members, level 2 starts broad casting the server
Throws:
java.lang.Exception - if the service fails to start.

stop

public void stop()
Stops the membership service


getMembers

public Member[] getMembers()
Returns a list of all the members in the cluster.


getLocalMember

public Member getLocalMember()
Returns the member object that defines this member


setLocalMemberProperties

public void setLocalMemberProperties(java.lang.String listenHost,
                                     int listenPort)
Sets the local member properties for broadcasting


addMembershipListener

public void addMembershipListener(MembershipListener listener)
Sets the membership listener, only one listener can be added. If you call this method twice, the last listener will be used.

Parameters:
listener - The listener

removeMembershipListener

public void removeMembershipListener()
removes the membership listener.



Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.