FileDocCategorySizeDatePackage
MembershipService.javaAPI DocApache Tomcat 6.0.144579Fri Jul 20 04:20:32 BST 2007org.apache.catalina.tribes

MembershipService

public interface MembershipService
MembershipService Interface
The MembershipService interface is the membership component at the bottom layer, the IO layer (for layers see the javadoc for the {@link Channel} interface).
author
Filip Hanik
version
$Revision: 467222 $, $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $

Fields Summary
public static final int
MBR_RX
public static final int
MBR_TX
Constructors Summary
Methods Summary
public MemberfindMemberByName(java.lang.String name)
Return the member by name

public MembergetLocalMember(boolean incAliveTime)
Returns the member object that defines this member

public MembergetMember(Member mbr)

param
mbr Member
return
Member

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

public java.lang.String[]getMembersByName()
Return all members by name

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

public booleanhasMembers()

return
true if the the group contains members

public voidremoveMembershipListener()
removes the membership listener.

public voidsetDomain(byte[] domain)

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

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

param
listener The listener

public voidsetPayload(byte[] payload)
Set a payload to be broadcasted with each membership broadcast.

param
payload byte[]

public voidsetProperties(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.

param
properties - to be used to configure the membership service.

public voidstart()
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.

public voidstart(int level)
Starts the membership service. If a membership listeners is added the listener will start to receive membership events.

param
level - level MBR_RX starts listening for members, level MBR_TX starts broad casting the server
throws
java.lang.Exception if the service fails to start.
throws
java.lang.IllegalArgumentException if the level is incorrect.

public voidstop(int level)
Starts the membership service. If a membership listeners is added the listener will start to receive membership events.

param
level - level MBR_RX stops listening for members, level MBR_TX stops broad casting the server
throws
java.lang.Exception if the service fails to stop
throws
java.lang.IllegalArgumentException if the level is incorrect.