org.jboss.dependency.plugins
Class AbstractCallbackItem<T>

java.lang.Object
  extended by org.jboss.util.JBossObject
      extended by org.jboss.dependency.plugins.AbstractCallbackItem<T>
Type Parameters:
T - the callback type
All Implemented Interfaces:
Cloneable, CallbackItem<T>, org.jboss.util.JBossInterface
Direct Known Subclasses:
OwnerCallbackItem

public abstract class AbstractCallbackItem<T>
extends org.jboss.util.JBossObject
implements CallbackItem<T>

Abstract callback item.

Author:
Ales Justin

Field Summary
protected  String attributeName
           
protected  ControllerState dependentState
           
protected  T name
           
protected  ControllerState whenRequired
           
 
Fields inherited from class org.jboss.util.JBossObject
hashCode, log, toString
 
Constructor Summary
protected AbstractCallbackItem(T name)
           
protected AbstractCallbackItem(T name, ControllerState whenRequired, ControllerState dependentState, String attributeName)
           
 
Method Summary
protected  void changeCallback(ControllerContext context, boolean isInstallPhase)
          Helper method.
 void changeCallback(Controller controller, ControllerContext context, boolean isInstallPhase)
          Execute callback with current changed context.
 String getAttributeName()
          Get the method/attribute/property name
 ControllerState getDependentState()
          Get the dependent's state
 T getIDependOn()
          Get the object name i depend on
 ControllerState getWhenRequired()
          Get when the dependency is required
 void ownerCallback(Controller controller, boolean isInstallPhase)
          Execute callback when item added to controller.
 void toShortString(org.jboss.util.JBossStringBuilder buffer)
           
protected  void toString(org.jboss.util.JBossStringBuilder buffer)
           
 
Methods inherited from class org.jboss.util.JBossObject
cacheGetHashCode, cacheToString, clone, equals, flushJBossObjectCache, getClassShortName, getHashCode, hashCode, list, notEqual, toShortString, toString, toStringImplementation
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected T name

whenRequired

protected ControllerState whenRequired

dependentState

protected ControllerState dependentState

attributeName

protected String attributeName
Constructor Detail

AbstractCallbackItem

protected AbstractCallbackItem(T name)

AbstractCallbackItem

protected AbstractCallbackItem(T name,
                               ControllerState whenRequired,
                               ControllerState dependentState,
                               String attributeName)
Method Detail

ownerCallback

public void ownerCallback(Controller controller,
                          boolean isInstallPhase)
                   throws Throwable
Description copied from interface: CallbackItem
Execute callback when item added to controller.

Specified by:
ownerCallback in interface CallbackItem<T>
Parameters:
controller - the controller
isInstallPhase - install or uninstall
Throws:
Throwable - for any error

changeCallback

protected void changeCallback(ControllerContext context,
                              boolean isInstallPhase)
                       throws Throwable
Helper method.

Parameters:
context - changed context
isInstallPhase - install or uninstall phase
Throws:
Throwable - for any error

changeCallback

public void changeCallback(Controller controller,
                           ControllerContext context,
                           boolean isInstallPhase)
                    throws Throwable
Description copied from interface: CallbackItem
Execute callback with current changed context.

Specified by:
changeCallback in interface CallbackItem<T>
Parameters:
controller - the controller
context - the new context
isInstallPhase - install or uninstall
Throws:
Throwable - for any error

getIDependOn

public T getIDependOn()
Description copied from interface: CallbackItem
Get the object name i depend on

Specified by:
getIDependOn in interface CallbackItem<T>
Returns:
the name

getWhenRequired

public ControllerState getWhenRequired()
Description copied from interface: CallbackItem
Get when the dependency is required

Specified by:
getWhenRequired in interface CallbackItem<T>
Returns:
the state when required

getDependentState

public ControllerState getDependentState()
Description copied from interface: CallbackItem
Get the dependent's state

Specified by:
getDependentState in interface CallbackItem<T>
Returns:
the state of the required of the dependent

getAttributeName

public String getAttributeName()
Description copied from interface: CallbackItem
Get the method/attribute/property name

Specified by:
getAttributeName in interface CallbackItem<T>
Returns:
the name

toShortString

public void toShortString(org.jboss.util.JBossStringBuilder buffer)
Specified by:
toShortString in interface org.jboss.util.JBossInterface
Overrides:
toShortString in class org.jboss.util.JBossObject

toString

protected void toString(org.jboss.util.JBossStringBuilder buffer)
Overrides:
toString in class org.jboss.util.JBossObject


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