org.jboss.kernel.plugins.dependency
Class InstallsAwareAction

java.lang.Object
  extended by org.jboss.dependency.plugins.action.AccessControllerContextAction<T,T>
      extended by org.jboss.dependency.plugins.action.SimpleControllerContextAction<KernelControllerContext>
          extended by org.jboss.kernel.plugins.dependency.KernelControllerContextAction
              extended by org.jboss.kernel.plugins.dependency.InstallsAwareAction
All Implemented Interfaces:
ControllerContextAction
Direct Known Subclasses:
AbstractConfigureAction, AnnotationsAction, AutowireAction, InstallAction, LifecycleAction, PreInstallAction

public abstract class InstallsAwareAction
extends KernelControllerContextAction

Installs/Uninstalls aware action.

Author:
Ales Justin

Field Summary
 
Fields inherited from class org.jboss.kernel.plugins.dependency.KernelControllerContextAction
log
 
Constructor Summary
InstallsAwareAction()
           
 
Method Summary
protected  void considerUninstalls(KernelControllerContext context, int index)
          Consider the uninstalls.
protected  void doInstalls(KernelControllerContext context)
          Execute the installs.
protected  void doUninstalls(KernelControllerContext context)
          Execute uninstalls
protected  void doUninstalls(KernelControllerContext context, int index)
          Execute uninstalls from the index.
protected abstract  ControllerState getState()
          Get the action's state.
 void installAction(KernelControllerContext context)
          The install.
protected  void undoInstallAction(KernelControllerContext context)
          Undo the steps from install action in the case of failed installs.
 void uninstallAction(KernelControllerContext context)
          The uninstall.
 
Methods inherited from class org.jboss.kernel.plugins.dependency.KernelControllerContextAction
contextCast, getActionAwareInterface, installActionInternal, setKernelControllerContext, uninstallActionInternal, unsetKernelControllerContext, validateContext
 
Methods inherited from class org.jboss.dependency.plugins.action.SimpleControllerContextAction
fullContextCast, secureInstallAction, secureUninstallAction, simpleContextCast, simpleInstallAction, simpleUninstallAction
 
Methods inherited from class org.jboss.dependency.plugins.action.AccessControllerContextAction
install, uninstall
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InstallsAwareAction

public InstallsAwareAction()
Method Detail

getState

protected abstract ControllerState getState()
Get the action's state.

Returns:
get the action's state

installAction

public void installAction(KernelControllerContext context)
                   throws Throwable
Description copied from class: SimpleControllerContextAction
The install.

Overrides:
installAction in class KernelControllerContextAction
Parameters:
context - the context
Throws:
Throwable - for any error

doInstalls

protected void doInstalls(KernelControllerContext context)
                   throws Throwable
Execute the installs.

Parameters:
context - the context
Throws:
Throwable - for any error

considerUninstalls

protected void considerUninstalls(KernelControllerContext context,
                                  int index)
Consider the uninstalls. This method is here to be able to override the behavior after installs failed. e.g. perhaps only running uninstalls from the index. By default we run all uninstalls in the case at least one install failed.

Parameters:
context - the context
index - current installs index

undoInstallAction

protected void undoInstallAction(KernelControllerContext context)
Undo the steps from install action in the case of failed installs. Usually this is what uninstallActionInternal does.

Parameters:
context - the context

uninstallAction

public void uninstallAction(KernelControllerContext context)
Description copied from class: SimpleControllerContextAction
The uninstall.

Overrides:
uninstallAction in class KernelControllerContextAction
Parameters:
context - the context

doUninstalls

protected void doUninstalls(KernelControllerContext context)
Execute uninstalls

Parameters:
context - the context

doUninstalls

protected void doUninstalls(KernelControllerContext context,
                            int index)
Execute uninstalls from the index. Leaving this method here in case someone wants to use 'symetric' approach to uninstalling installs.

Parameters:
context - the context
index - the current index


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.