com.sun.sgs.impl.service.nodemap.affinity
Class BasicState

java.lang.Object
  extended by com.sun.sgs.impl.service.nodemap.affinity.BasicState
Direct Known Subclasses:
AbstractAffinityGraphBuilder, AbstractLPA, LabelPropagationServer, LPADriver

public class BasicState
extends Object

A class to encapsulate the basic states required for AffinityGroupFinder and AffinityGraphBuilder.


Nested Class Summary
protected static class BasicState.State
          Valid states.
 
Field Summary
protected  BasicState.State state
          The state.
 
Constructor Summary
BasicState()
           
 
Method Summary
protected  void checkForDisabledOrShutdownState()
          Throws an IllegalStateException if we are in the SHUTDOWN or DISABLED state.
protected  void checkForShutdownState()
          Throws an IllegalStateException if we are in the SHUTDOWN state.
protected  boolean setDisabledState()
          Disable this component.
protected  boolean setEnabledState()
          Enable this component.
protected  boolean setShutdownState()
          Shutdown this component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

state

protected volatile BasicState.State state
The state.

Constructor Detail

BasicState

public BasicState()
Method Detail

setDisabledState

protected boolean setDisabledState()
Disable this component. Multiple calls to disable are allowed. Disabled components can be enabled or shutdown.

Returns:
true if the state has changed

setEnabledState

protected boolean setEnabledState()
Enable this component. Multiple calls to enable are allowed. Enabled components can be disabled or shutdown.

Returns:
true if the state has changed

setShutdownState

protected boolean setShutdownState()
Shutdown this component. Multiple shutdown calls are allowed. Once shut down, a component cannot be enabled or disabled.

Returns:
true if the state has changed

checkForShutdownState

protected void checkForShutdownState()
Throws an IllegalStateException if we are in the SHUTDOWN state.

Throws:
IllegalStateException - if we are stut down

checkForDisabledOrShutdownState

protected void checkForDisabledOrShutdownState()
Throws an IllegalStateException if we are in the SHUTDOWN or DISABLED state.

Throws:
IllegalStateException - if we are shut down or disabled

RedDwarf, Version 0.10.1
2010-03-14 10:56:12

Copyright © 2010 The RedDwarf Authors. All rights reserved
Copyright © 2007-2010 Sun Microsystems, Inc. All rights reserved