org.jboss.beans.metadata.plugins
Class AbstractDependencyValueMetaData

java.lang.Object
  extended by org.jboss.util.JBossObject
      extended by org.jboss.beans.metadata.plugins.AbstractValueMetaData
          extended by org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData
All Implemented Interfaces:
Serializable, Cloneable, TypeProvider, MetaDataVisitorNode, ValueMetaData, org.jboss.util.JBossInterface
Direct Known Subclasses:
AbstractInjectionValueMetaData

public class AbstractDependencyValueMetaData
extends AbstractValueMetaData

Dependency value.

Version:
$Revision: 84514 $
Author:
Adrian Brock, Ales Justin, Radim Marek (obrien)
See Also:
Serialized Form

Nested Class Summary
protected  class AbstractDependencyValueMetaData.OptionalDependencyItem
          Optional depedency item.
 
Field Summary
protected  KernelControllerContext context
          The context
protected  ControllerState dependentState
          The required state of the dependency or null to look in the registry
protected  ControllerState optionalWhenRequired
          The when required, keep it for optional handling
protected  String property
          The property name
protected  SearchInfo search
          The search type
protected  ControllerState whenRequiredState
          The when required state of the dependency or null to use current context state
 
Fields inherited from class org.jboss.util.JBossObject
hashCode, log, toString
 
Fields inherited from interface org.jboss.beans.metadata.plugins.TypeProvider
ERROR_MSG
 
Constructor Summary
AbstractDependencyValueMetaData()
          Create a new dependency value
AbstractDependencyValueMetaData(Object value)
          Create a new dependency value
AbstractDependencyValueMetaData(Object value, String property)
          Create a new dependency value
 
Method Summary
protected  boolean addDependencyItem()
           
protected  void addOptionalDependency(Controller controller, ControllerContext lookup)
          Add optional dependency.
 AbstractDependencyValueMetaData clone()
          Clone the object
protected  ControllerContext getControllerContext(Object name, ControllerState state)
          Get controller context.
 ControllerState getDependentState()
          Get the required state of dependency.
 String getProperty()
          Get the property
 SearchInfo getSearch()
          Get search type.
 Object getValue(org.jboss.reflect.spi.TypeInfo info, ClassLoader cl)
          Get the value.
 ControllerState getWhenRequiredState()
          Get when required state.
 void initialVisit(MetaDataVisitor visitor)
          Visit the node
protected  boolean isLookupValid(ControllerContext lookup)
           
protected  boolean isOptional()
           
protected  boolean isSearchApplied()
          Is search applied.
 void setDependentState(ControllerState dependentState)
          Set the required state of the dependency
 void setProperty(String property)
          Set the property
 void setSearch(SearchInfo search)
          Set search type.
 void setValue(Object value)
           
 void setValueObject(Object value)
           
 void setWhenRequiredState(ControllerState whenRequiredState)
          Set the when required state of the dependency
 void toString(org.jboss.util.JBossStringBuilder buffer)
           
 
Methods inherited from class org.jboss.beans.metadata.plugins.AbstractValueMetaData
describeVisit, getChildren, getType, getUnderlyingValue, getValue, isUseJMXObjectNameFix, toShortString
 
Methods inherited from class org.jboss.util.JBossObject
cacheGetHashCode, cacheToString, 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
 
Methods inherited from interface org.jboss.util.JBossInterface
toShortString
 

Field Detail

context

protected transient KernelControllerContext context
The context


optionalWhenRequired

protected transient ControllerState optionalWhenRequired
The when required, keep it for optional handling


property

protected String property
The property name


whenRequiredState

protected ControllerState whenRequiredState
The when required state of the dependency or null to use current context state


dependentState

protected ControllerState dependentState
The required state of the dependency or null to look in the registry


search

protected SearchInfo search
The search type

Constructor Detail

AbstractDependencyValueMetaData

public AbstractDependencyValueMetaData()
Create a new dependency value


AbstractDependencyValueMetaData

public AbstractDependencyValueMetaData(Object value)
Create a new dependency value

Parameters:
value - the value

AbstractDependencyValueMetaData

public AbstractDependencyValueMetaData(Object value,
                                       String property)
Create a new dependency value

Parameters:
value - the value
property - the property
Method Detail

getProperty

public String getProperty()
Get the property

Returns:
the property

setProperty

public void setProperty(String property)
Set the property

Parameters:
property - the property name

setWhenRequiredState

public void setWhenRequiredState(ControllerState whenRequiredState)
Set the when required state of the dependency

Parameters:
whenRequiredState - the when required state or null if it uses current context state

getWhenRequiredState

public ControllerState getWhenRequiredState()
Get when required state.

Returns:
the when required state

setDependentState

public void setDependentState(ControllerState dependentState)
Set the required state of the dependency

Parameters:
dependentState - the required state or null if it must be in the registry

getDependentState

public ControllerState getDependentState()
Get the required state of dependency.

Returns:
the required dependency state

setValue

public void setValue(Object value)
Overrides:
setValue in class AbstractValueMetaData

setValueObject

public void setValueObject(Object value)

setSearch

public void setSearch(SearchInfo search)
Set search type.

Parameters:
search - the search type

getSearch

public SearchInfo getSearch()
Get search type.

Returns:
the search type

isSearchApplied

protected boolean isSearchApplied()
Is search applied.

Returns:
true if search is applied

isLookupValid

protected boolean isLookupValid(ControllerContext lookup)

isOptional

protected boolean isOptional()

addOptionalDependency

protected void addOptionalDependency(Controller controller,
                                     ControllerContext lookup)
Add optional dependency.

Parameters:
controller - the controller
lookup - the lookup context

getControllerContext

protected ControllerContext getControllerContext(Object name,
                                                 ControllerState state)
Get controller context.

Parameters:
name - the name
state - the state
Returns:
the controller context

getValue

public Object getValue(org.jboss.reflect.spi.TypeInfo info,
                       ClassLoader cl)
                throws Throwable
Description copied from interface: ValueMetaData
Get the value.

Specified by:
getValue in interface ValueMetaData
Overrides:
getValue in class AbstractValueMetaData
Parameters:
info - the type info
cl - the classloader
Returns:
the value.
Throws:
Throwable - for any error

addDependencyItem

protected boolean addDependencyItem()

initialVisit

public void initialVisit(MetaDataVisitor visitor)
Description copied from interface: MetaDataVisitorNode
Visit the node

Specified by:
initialVisit in interface MetaDataVisitorNode
Overrides:
initialVisit in class AbstractValueMetaData
Parameters:
visitor - the visitor

toString

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

clone

public AbstractDependencyValueMetaData clone()
Description copied from interface: MetaDataVisitorNode
Clone the object

Specified by:
clone in interface MetaDataVisitorNode
Specified by:
clone in interface org.jboss.util.JBossInterface
Overrides:
clone in class AbstractValueMetaData
Returns:
a clone of the object


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