org.jboss.dependency.plugins
Class OwnerCallbackItem<T,C>

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

public abstract class OwnerCallbackItem<T,C>
extends AbstractCallbackItem<T>

Owner callback item.

Author:
Ales Justin

Field Summary
protected  C owner
           
 
Fields inherited from class org.jboss.dependency.plugins.AbstractCallbackItem
attributeName, dependentState, name, whenRequired
 
Fields inherited from class org.jboss.util.JBossObject
hashCode, log, toString
 
Constructor Summary
protected OwnerCallbackItem(T name, ControllerState whenRequired, ControllerState dependentState, String attributeName, C owner)
           
protected OwnerCallbackItem(T name, String attributeName, C owner)
           
 
Method Summary
protected  void addDependency(Controller controller, ControllerContext context, boolean isInstallPhase)
          Add dependency.
 void changeCallback(Controller controller, ControllerContext context, boolean isInstallPhase)
          Execute callback with current changed context.
protected  DependencyItem createDependencyItem(ControllerContext owner)
          Create dependency - if it exists.
protected  void toString(org.jboss.util.JBossStringBuilder buffer)
           
 
Methods inherited from class org.jboss.dependency.plugins.AbstractCallbackItem
changeCallback, getAttributeName, getDependentState, getIDependOn, getWhenRequired, ownerCallback, toShortString
 
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

owner

protected C owner
Constructor Detail

OwnerCallbackItem

protected OwnerCallbackItem(T name,
                            String attributeName,
                            C owner)

OwnerCallbackItem

protected OwnerCallbackItem(T name,
                            ControllerState whenRequired,
                            ControllerState dependentState,
                            String attributeName,
                            C owner)
Method Detail

addDependency

protected void addDependency(Controller controller,
                             ControllerContext context,
                             boolean isInstallPhase)
Add dependency.

Parameters:
controller - the controller
context - changed context
isInstallPhase - install or uninstall phase

createDependencyItem

protected DependencyItem createDependencyItem(ControllerContext owner)
Create dependency - if it exists.

Parameters:
owner - if owner is controller context
Returns:
dependency or null if no such dependency exists

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>
Overrides:
changeCallback in class AbstractCallbackItem<T>
Parameters:
controller - the controller
context - the new context
isInstallPhase - install or uninstall
Throws:
Throwable - for any error

toString

protected void toString(org.jboss.util.JBossStringBuilder buffer)
Overrides:
toString in class AbstractCallbackItem<T>


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