com.sun.enterprise.mgmt
Class ClusterViewManager

java.lang.Object
  extended by com.sun.enterprise.mgmt.ClusterViewManager

public class ClusterViewManager
extends Object

Manages Cluster Views and notifies cluster view listeners when cluster view changes


Constructor Summary
ClusterViewManager(SystemAdvertisement advertisement, ClusterManager manager, List<ClusterViewEventListener> listeners)
          Constructor for the ClusterViewManager object
 
Method Summary
 void addClusterViewEventListener(ClusterViewEventListener listener)
           
 boolean containsKey(PeerID id)
           
 boolean containsKey(PeerID id, boolean debug)
           
 SystemAdvertisement get(PeerID id)
          Retrieves a system advertisement from a the table
 PeerID getID(String name)
           
 ClusterView getLocalView()
          Returns a sorted localView
 SystemAdvertisement getMaster()
          Gets the master advertisement
 long getMasterViewID()
           
 int getViewSize()
          Gets the viewSize attribute of the ClusterViewManager object
 int indexOf(PeerID id)
          the index of id this view, or -1 if this view does not contain this element.
 boolean isFirst()
          Determines whether this node is at the top of the list
 boolean isMaster()
          Determines whether this node is the Master
 void removeClusterViewEventListener(ClusterViewEventListener listener)
           
 void setClusterStoppingState(SystemAdvertisement adv)
           
 void setInDoubtPeerState(SystemAdvertisement adv)
           
 void setMasterViewID(long masterViewID)
           
 void setPeerNoLongerInDoubtState(SystemAdvertisement adv)
           
 void setPeerReadyState(SystemAdvertisement adv)
           
 void setPeerStoppingState(SystemAdvertisement adv)
           
 void start()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClusterViewManager

public ClusterViewManager(SystemAdvertisement advertisement,
                          ClusterManager manager,
                          List<ClusterViewEventListener> listeners)
Constructor for the ClusterViewManager object

Parameters:
advertisement - the advertisement of the instance associated with this object
manager - the cluster manager
listeners - List of ClusterViewEventListener
Method Detail

start

public void start()

addClusterViewEventListener

public void addClusterViewEventListener(ClusterViewEventListener listener)

removeClusterViewEventListener

public void removeClusterViewEventListener(ClusterViewEventListener listener)

getMaster

public SystemAdvertisement getMaster()
Gets the master advertisement

Returns:
SystemAdvertisement Master system adverisement

get

public SystemAdvertisement get(PeerID id)
Retrieves a system advertisement from a the table

Parameters:
id - instance id
Returns:
Returns the SystemAdvertisement associated with id

containsKey

public boolean containsKey(PeerID id)

containsKey

public boolean containsKey(PeerID id,
                           boolean debug)

getLocalView

public ClusterView getLocalView()
Returns a sorted localView

Returns:
The localView List

getViewSize

public int getViewSize()
Gets the viewSize attribute of the ClusterViewManager object

Returns:
The viewSize

isMaster

public boolean isMaster()
Determines whether this node is the Master

Returns:
true if this node is the master node

isFirst

public boolean isFirst()
Determines whether this node is at the top of the list

Returns:
true if this node is a the top of the list, false otherwise

indexOf

public int indexOf(PeerID id)
the index of id this view, or -1 if this view does not contain this element.

Parameters:
id - id
Returns:
the index of id this view, or -1 if this view does not contain this element.

getID

public PeerID getID(String name)

setInDoubtPeerState

public void setInDoubtPeerState(SystemAdvertisement adv)

setPeerStoppingState

public void setPeerStoppingState(SystemAdvertisement adv)

setClusterStoppingState

public void setClusterStoppingState(SystemAdvertisement adv)

setPeerNoLongerInDoubtState

public void setPeerNoLongerInDoubtState(SystemAdvertisement adv)

getMasterViewID

public long getMasterViewID()

setMasterViewID

public void setMasterViewID(long masterViewID)

setPeerReadyState

public void setPeerReadyState(SystemAdvertisement adv)


Copyright © 2012. All Rights Reserved.