org.apache.whirr.service
Class ClusterActionHandler

java.lang.Object
  extended by org.apache.whirr.service.ClusterActionHandler
Direct Known Subclasses:
ClusterActionHandlerSupport

public abstract class ClusterActionHandler
extends Object

A callback interface for cluster actions that apply to instances in a given role.

Implementation note. ClusterActionHandler implementations are discovered using a Service Provider Interface (SPI), described in ServiceLoader.


Field Summary
static String BOOTSTRAP_ACTION
           
static String CONFIGURE_ACTION
           
static String DESTROY_ACTION
           
 
Constructor Summary
ClusterActionHandler()
           
 
Method Summary
 void afterAction(ClusterActionEvent event)
          Called after the action has been performed.
 void beforeAction(ClusterActionEvent event)
          Called before the action is performed, giving the implementation an opportunity to specify scripts that should be run as a part of this action.
 boolean equals(Object that)
           
abstract  String getRole()
           
 int hashCode()
          this uses the inefficient Objects implementation as the object count will be relatively small and therefore efficiency is not a concern.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

BOOTSTRAP_ACTION

public static final String BOOTSTRAP_ACTION
See Also:
Constant Field Values

CONFIGURE_ACTION

public static final String CONFIGURE_ACTION
See Also:
Constant Field Values

DESTROY_ACTION

public static final String DESTROY_ACTION
See Also:
Constant Field Values
Constructor Detail

ClusterActionHandler

public ClusterActionHandler()
Method Detail

getRole

public abstract String getRole()

beforeAction

public void beforeAction(ClusterActionEvent event)
                  throws IOException,
                         InterruptedException
Called before the action is performed, giving the implementation an opportunity to specify scripts that should be run as a part of this action.

Parameters:
event -
Throws:
IOException
InterruptedException

afterAction

public void afterAction(ClusterActionEvent event)
                 throws IOException,
                        InterruptedException
Called after the action has been performed.

Parameters:
event -
Throws:
IOException
InterruptedException

hashCode

public int hashCode()
this uses the inefficient Objects implementation as the object count will be relatively small and therefore efficiency is not a concern.

Overrides:
hashCode in class Object

equals

public boolean equals(Object that)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2010-2011 The Apache Software Foundation. All Rights Reserved.