org.jboss.dependency.plugins
Class AbstractDependencyItem

java.lang.Object
  extended by org.jboss.util.JBossObject
      extended by org.jboss.dependency.plugins.AbstractDependencyItem
All Implemented Interfaces:
Cloneable, DependencyItem, org.jboss.util.JBossInterface
Direct Known Subclasses:
AbstractDemandMetaData.DemandDependencyItem, AbstractDependencyMetaData.LifecycleDependencyItem, AbstractInstallMetaData.InstallationDependencyItem, ClassDependencyItem, SearchDependencyItem

public class AbstractDependencyItem
extends org.jboss.util.JBossObject
implements DependencyItem

A DependencyItem.

Version:
$Revision: 84514 $
Author:
Adrian Brock, Ales Justin

Field Summary
protected static org.jboss.logging.Logger log
          The log
 
Fields inherited from class org.jboss.util.JBossObject
hashCode, toString
 
Constructor Summary
AbstractDependencyItem()
          Create a new dependency item
AbstractDependencyItem(Object name, Object iDependOn, ControllerState whenRequired, ControllerState dependentState)
          Create a new dependency item
 
Method Summary
protected  void addDependsOnMe(Controller controller, ControllerContext context)
          Register a dependency with another context
 ControllerState getDependentState()
          Get the dependent's state
 Object getIDependOn()
          Get the object name i depend on
 Object getName()
          Get my object name
 ControllerState getWhenRequired()
          Get when the dependency is required
 boolean isResolved()
          Whether we are resolved
 boolean resolve(Controller controller)
          Try to resolve
protected  void setIDependOn(Object iDependOn)
          Set what I depend upon
protected  void setResolved(boolean resolved)
          Set the resolved state
 String toHumanReadableString()
          Return a human readable version of the dependency
protected  void toHumanReadableString(StringBuilder builder)
          Add info to builder.
 void toShortString(org.jboss.util.JBossStringBuilder buffer)
           
 void toString(org.jboss.util.JBossStringBuilder buffer)
           
 void unresolved()
           
 boolean unresolved(Controller controller)
          Mark the dependency as unresolved
 
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

log

protected static final org.jboss.logging.Logger log
The log

Constructor Detail

AbstractDependencyItem

public AbstractDependencyItem()
Create a new dependency item


AbstractDependencyItem

public AbstractDependencyItem(Object name,
                              Object iDependOn,
                              ControllerState whenRequired,
                              ControllerState dependentState)
Create a new dependency item

Parameters:
name - my name
iDependOn - what I depend on
whenRequired - when the dependency is required
dependentState - the required state of the dependent
Method Detail

getName

public Object getName()
Description copied from interface: DependencyItem
Get my object name

Specified by:
getName in interface DependencyItem
Returns:
the name

getIDependOn

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

Specified by:
getIDependOn in interface DependencyItem
Returns:
the name

getWhenRequired

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

Specified by:
getWhenRequired in interface DependencyItem
Returns:
the state when required

getDependentState

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

Specified by:
getDependentState in interface DependencyItem
Returns:
the state of the required of the dependent

isResolved

public boolean isResolved()
Description copied from interface: DependencyItem
Whether we are resolved

Specified by:
isResolved in interface DependencyItem
Returns:
true for resolved, false otherwise

resolve

public boolean resolve(Controller controller)
Description copied from interface: DependencyItem
Try to resolve

Specified by:
resolve in interface DependencyItem
Parameters:
controller - the controller
Returns:
true for resolved, false otherwise

unresolved

public void unresolved()

unresolved

public boolean unresolved(Controller controller)
Description copied from interface: DependencyItem
Mark the dependency as unresolved

Specified by:
unresolved in interface DependencyItem
Parameters:
controller - the controller
Returns:
true if proceed with unresolving, false otherwise

toString

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

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

addDependsOnMe

protected void addDependsOnMe(Controller controller,
                              ControllerContext context)
Register a dependency with another context

Parameters:
controller - the controller
context - the other context

setIDependOn

protected void setIDependOn(Object iDependOn)
Set what I depend upon

Parameters:
iDependOn - what I depend upon

setResolved

protected void setResolved(boolean resolved)
Set the resolved state

Parameters:
resolved - the new resolved state

toHumanReadableString

public String toHumanReadableString()
Description copied from interface: DependencyItem
Return a human readable version of the dependency

Specified by:
toHumanReadableString in interface DependencyItem
Returns:
the string

toHumanReadableString

protected void toHumanReadableString(StringBuilder builder)
Add info to builder.

Parameters:
builder - the string builder


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