|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.whirr.service.ClusterActionHandlerSupport
public abstract class ClusterActionHandlerSupport
This is a utility class to make it easier to implement
ClusterActionHandler
. For each 'before' and 'after' action type there
is a corresponding method that implementations may override.
Field Summary |
---|
Fields inherited from interface org.apache.whirr.service.ClusterActionHandler |
---|
BOOTSTRAP_ACTION, CLEANUP_ACTION, CONFIGURE_ACTION, DESTROY_ACTION, START_ACTION, STOP_ACTION |
Constructor Summary | |
---|---|
ClusterActionHandlerSupport()
|
Method Summary | |
---|---|
static void |
addRunUrl(ClusterActionEvent event,
String runUrl,
String... args)
A convenience method for adding a RunUrlStatement to a
ClusterActionEvent . |
static void |
addStatement(ClusterActionEvent event,
org.jclouds.scriptbuilder.domain.Statement statement)
|
void |
afterAction(ClusterActionEvent event)
Called after the action has been performed. |
protected void |
afterBootstrap(ClusterActionEvent event)
|
protected void |
afterCleanup(ClusterActionEvent event)
|
protected void |
afterConfigure(ClusterActionEvent event)
|
protected void |
afterDestroy(ClusterActionEvent event)
|
protected void |
afterOtherAction(ClusterActionEvent event)
|
protected void |
afterStart(ClusterActionEvent event)
|
protected void |
afterStop(ClusterActionEvent event)
|
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. |
protected void |
beforeBootstrap(ClusterActionEvent event)
|
protected void |
beforeCleanup(ClusterActionEvent event)
|
protected void |
beforeConfigure(ClusterActionEvent event)
|
protected void |
beforeDestroy(ClusterActionEvent event)
|
protected void |
beforeOtherAction(ClusterActionEvent event)
|
protected void |
beforeStart(ClusterActionEvent event)
|
protected void |
beforeStop(ClusterActionEvent event)
|
boolean |
equals(Object that)
|
String |
getCleanupFunction(org.apache.commons.configuration.Configuration config,
String service,
String defaultFunction)
Get service cleanup function name from the configuration |
protected org.apache.commons.configuration.Configuration |
getConfiguration(ClusterSpec clusterSpec,
org.apache.commons.configuration.Configuration defaults)
Returns a composite configuration that is made up from the global configuration coming from the Whirr core with the service default properties. |
protected org.apache.commons.configuration.Configuration |
getConfiguration(ClusterSpec clusterSpec,
String defaultsPropertiesFile)
|
String |
getConfigureFunction(org.apache.commons.configuration.Configuration config,
String service,
String defaultFunction)
Get service configure function name from the configuration |
String |
getFunctionName(org.apache.commons.configuration.Configuration config,
String service,
String functionName,
String defaultFunction)
|
String |
getInstallFunction(org.apache.commons.configuration.Configuration config,
String service,
String defaultFunction)
Get service install function name from the configuration |
String |
getStartFunction(org.apache.commons.configuration.Configuration config,
String service,
String defaultFunction)
Get service start function name from the configuration |
String |
getStopFunction(org.apache.commons.configuration.Configuration config,
String service,
String defaultFunction)
Get service start function name from the configuration |
int |
hashCode()
this uses the inefficient Objects implementation as the object count will be
relatively small and therefore efficiency is not a concern. |
static String |
prepareRemoteFileUrl(ClusterActionEvent event,
String rawUrl)
Prepare the file url for the remote machine. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.whirr.service.ClusterActionHandler |
---|
getRole |
Constructor Detail |
---|
public ClusterActionHandlerSupport()
Method Detail |
---|
public void beforeAction(ClusterActionEvent event) throws IOException, InterruptedException
ClusterActionHandler
beforeAction
in interface ClusterActionHandler
IOException
InterruptedException
public void afterAction(ClusterActionEvent event) throws IOException, InterruptedException
ClusterActionHandler
afterAction
in interface ClusterActionHandler
IOException
InterruptedException
protected void beforeBootstrap(ClusterActionEvent event) throws IOException, InterruptedException
IOException
InterruptedException
protected void beforeConfigure(ClusterActionEvent event) throws IOException, InterruptedException
IOException
InterruptedException
protected void beforeStart(ClusterActionEvent event) throws IOException, InterruptedException
IOException
InterruptedException
protected void beforeStop(ClusterActionEvent event) throws IOException, InterruptedException
IOException
InterruptedException
protected void beforeCleanup(ClusterActionEvent event) throws IOException, InterruptedException
IOException
InterruptedException
protected void beforeDestroy(ClusterActionEvent event) throws IOException, InterruptedException
IOException
InterruptedException
protected void beforeOtherAction(ClusterActionEvent event) throws IOException, InterruptedException
IOException
InterruptedException
protected void afterBootstrap(ClusterActionEvent event) throws IOException, InterruptedException
IOException
InterruptedException
protected void afterConfigure(ClusterActionEvent event) throws IOException, InterruptedException
IOException
InterruptedException
protected void afterStart(ClusterActionEvent event) throws IOException, InterruptedException
IOException
InterruptedException
protected void afterStop(ClusterActionEvent event) throws IOException, InterruptedException
IOException
InterruptedException
protected void afterCleanup(ClusterActionEvent event) throws IOException, InterruptedException
IOException
InterruptedException
protected void afterDestroy(ClusterActionEvent event) throws IOException, InterruptedException
IOException
InterruptedException
protected void afterOtherAction(ClusterActionEvent event) throws IOException, InterruptedException
IOException
InterruptedException
protected org.apache.commons.configuration.Configuration getConfiguration(ClusterSpec clusterSpec, org.apache.commons.configuration.Configuration defaults)
clusterSpec
- The cluster specification instance.
protected org.apache.commons.configuration.Configuration getConfiguration(ClusterSpec clusterSpec, String defaultsPropertiesFile) throws IOException
IOException
public static void addRunUrl(ClusterActionEvent event, String runUrl, String... args) throws IOException
RunUrlStatement
to a
ClusterActionEvent
.
IOException
public static void addStatement(ClusterActionEvent event, org.jclouds.scriptbuilder.domain.Statement statement)
public static String prepareRemoteFileUrl(ClusterActionEvent event, String rawUrl) throws IOException
rawUrl
- raw url as provided in the configuration file
IOException
public String getStartFunction(org.apache.commons.configuration.Configuration config, String service, String defaultFunction)
public String getStopFunction(org.apache.commons.configuration.Configuration config, String service, String defaultFunction)
public String getInstallFunction(org.apache.commons.configuration.Configuration config, String service, String defaultFunction)
public String getConfigureFunction(org.apache.commons.configuration.Configuration config, String service, String defaultFunction)
public String getCleanupFunction(org.apache.commons.configuration.Configuration config, String service, String defaultFunction)
public String getFunctionName(org.apache.commons.configuration.Configuration config, String service, String functionName, String defaultFunction)
public int hashCode()
Objects
implementation as the object count will be
relatively small and therefore efficiency is not a concern.
hashCode
in class Object
public boolean equals(Object that)
equals
in class Object
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |