org.jboss.beans.metadata.plugins
Class AbstractBeanMetaData

java.lang.Object
  extended by org.jboss.util.JBossObject
      extended by org.jboss.beans.metadata.plugins.AbstractFeatureMetaData
          extended by org.jboss.beans.metadata.plugins.AbstractBeanMetaData
All Implemented Interfaces:
Serializable, Cloneable, MutableLifecycleHolder, TypeProvider, BeanMetaData, BeanMetaDataFactory, FeatureMetaData, MetaDataVisitorNode, ValueMetaData, org.jboss.util.JBossInterface
Direct Known Subclasses:
AbstractLazyMetaData, GenericBeanFactoryMetaData

public class AbstractBeanMetaData
extends AbstractFeatureMetaData
implements BeanMetaData, BeanMetaDataFactory, MutableLifecycleHolder, Serializable

Metadata for a bean.

Version:
$Revision: 66094 $
Author:
Adrian Brock
See Also:
Serialized Form

Field Summary
protected  Set<Object> aliases
          The aliases
protected  boolean autowireCandidate
          Is contextual injection candidate
protected  AutowireType autowireType
          Autowire type
protected  String bean
          The bean fully qualified class name
protected  ClassLoaderMetaData classLoader
          The bean ClassLoader
protected  ConstructorMetaData constructor
          The constructor
protected  org.jboss.dependency.spi.ControllerContext context
          The context
protected  LifecycleMetaData create
          The create lifecycle
protected  Set<DemandMetaData> demands
          What the bean demands Set
protected  Set<DependencyMetaData> depends
          What the bean dependencies Set
protected  LifecycleMetaData destroy
          The destroy lifecycle
protected  List<CallbackMetaData> installCallbacks
          The install callback List
protected  List<InstallMetaData> installs
          The install operations List
protected  boolean isAbstract
          Is abstract
protected  org.jboss.dependency.spi.ControllerMode mode
          The mode
protected  String name
          The name of this instance
protected  String parent
          The parent
protected  LifecycleMetaData start
          The start lifecycle
protected  LifecycleMetaData stop
          The stop lifecycle
protected  Set<SupplyMetaData> supplies
          What the bean supplies Set
protected  List<CallbackMetaData> uninstallCallbacks
          The uninstall callback List
protected  List<InstallMetaData> uninstalls
          The uninstall operations List
 
Fields inherited from class org.jboss.beans.metadata.plugins.AbstractFeatureMetaData
annotations, description
 
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
AbstractBeanMetaData()
          Create a new bean meta data
AbstractBeanMetaData(String bean)
          Create a new bean meta data
AbstractBeanMetaData(String name, String bean)
          Create a new bean meta data
 
Method Summary
protected  void addBeans(MetaDataVisitorNode current, List<BeanMetaData> list)
           
protected  void addChildren(Set<MetaDataVisitorNode> children)
           
 void addProperty(PropertyMetaData property)
          Add a property
protected  List<BeanMetaData> findNestedBeans()
           
 Set<Object> getAliases()
          The aliases
 AutowireType getAutowireType()
          Get the autowire type.
 String getBean()
          Get the bean class name.
 List<BeanMetaData> getBeans()
          Get the beans
 ClassLoaderMetaData getClassLoader()
          Get the bean ClassLoader
 ConstructorMetaData getConstructor()
          Get the constructor
 LifecycleMetaData getCreate()
          Get the create lifecycle
 Set<DemandMetaData> getDemands()
          Get what this bean demands.
 Set<DependencyMetaData> getDepends()
          Get what this bean depends.
 LifecycleMetaData getDestroy()
          Get the destroy lifecycle
 List<CallbackMetaData> getInstallCallbacks()
          Get the installation oeprations.
 List<InstallMetaData> getInstalls()
          Get the installation oeprations.
 org.jboss.dependency.spi.ControllerMode getMode()
          Get the mode
 String getName()
          Get the name
 String getParent()
          Get the parent.
 Set<PropertyMetaData> getProperties()
          Get the properties.
 PropertyMetaData getProperty(String name)
          Get a property
 LifecycleMetaData getStart()
          Get the start lifecycle
 LifecycleMetaData getStop()
          Get the stop lifecycle
 Set<SupplyMetaData> getSupplies()
          Get what this bean supplies.
 org.jboss.reflect.spi.TypeInfo getType(MetaDataVisitor visitor, MetaDataVisitorNode previous)
          Get the injectee type info.
 Object getUnderlyingValue()
          Get the underlying value
 List<CallbackMetaData> getUninstallCallbacks()
          Get the uninstallation operations.
 List<InstallMetaData> getUninstalls()
          Get the uninstallation operations.
 Object getValue(org.jboss.reflect.spi.TypeInfo info, ClassLoader cl)
          Get the value.
 void initialVisit(MetaDataVisitor visitor)
          Visit the node
 boolean isAbstract()
          Is abstract metadata.
 boolean isAutowireCandidate()
          Is this bean is a candidate for getting injected via contextual matching or callback resolution.
 void setAbstract(boolean anAbstract)
          Set abstract.
 void setAliases(Set<Object> aliases)
           
 void setAutowireCandidate(boolean autowireCandidate)
           
 void setAutowireType(AutowireType autowireType)
          Set autowire type.
 void setBean(String bean)
          Set the bean class name and flush the object cache.
 void setClassLoader(ClassLoaderMetaData classLoader)
          Set the bean ClassLoader
 void setConstructor(ConstructorMetaData constructor)
          Set the constructor
 void setCreate(LifecycleMetaData lifecycle)
          Set the lifecycle metadata
 void setDemands(Set<DemandMetaData> demands)
          Set what the bean demands.
 void setDepends(Set<DependencyMetaData> depends)
          Set what the bean depends.
 void setDestroy(LifecycleMetaData lifecycle)
          Set the destroy metadata
 void setInstallCallbacks(List<CallbackMetaData> installCallbacks)
           
 void setInstalls(List<InstallMetaData> installs)
          Set the installs
 void setMode(org.jboss.dependency.spi.ControllerMode mode)
          Set the name
 void setName(String name)
          Set the name.
 void setParent(String parent)
          Set the parent.
 void setProperties(Set<PropertyMetaData> properties)
          Set the propertiess.
 void setStart(LifecycleMetaData lifecycle)
          Set the start metadata
 void setStop(LifecycleMetaData lifecycle)
          Set the stop metadata
 void setSupplies(Set<SupplyMetaData> supplies)
          Set what the bean supplies.
 void setUninstallCallbacks(List<CallbackMetaData> uninstallCallbacks)
           
 void setUninstalls(List<InstallMetaData> uninstalls)
          Set the uninstalls
 void toShortString(org.jboss.util.JBossStringBuilder buffer)
           
 void toString(org.jboss.util.JBossStringBuilder buffer)
           
 
Methods inherited from class org.jboss.beans.metadata.plugins.AbstractFeatureMetaData
applyCollectionOrMapCheck, describeVisit, getAnnotations, getChildren, getDescription, setAnnotations, setDescription
 
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
 
Methods inherited from interface org.jboss.beans.metadata.spi.BeanMetaData
getAnnotations, setAnnotations
 
Methods inherited from interface org.jboss.beans.metadata.spi.FeatureMetaData
getDescription
 
Methods inherited from interface org.jboss.util.JBossInterface
clone, toShortString
 
Methods inherited from interface org.jboss.beans.metadata.spi.MetaDataVisitorNode
describeVisit, getChildren
 
Methods inherited from interface org.jboss.util.JBossInterface
clone, toShortString
 
Methods inherited from interface org.jboss.beans.metadata.spi.MetaDataVisitorNode
describeVisit, getChildren
 

Field Detail

bean

protected String bean
The bean fully qualified class name


name

protected String name
The name of this instance


aliases

protected Set<Object> aliases
The aliases


parent

protected String parent
The parent


isAbstract

protected boolean isAbstract
Is abstract


autowireType

protected AutowireType autowireType
Autowire type


mode

protected org.jboss.dependency.spi.ControllerMode mode
The mode


autowireCandidate

protected boolean autowireCandidate
Is contextual injection candidate


classLoader

protected ClassLoaderMetaData classLoader
The bean ClassLoader


constructor

protected ConstructorMetaData constructor
The constructor


create

protected LifecycleMetaData create
The create lifecycle


start

protected LifecycleMetaData start
The start lifecycle


stop

protected LifecycleMetaData stop
The stop lifecycle


destroy

protected LifecycleMetaData destroy
The destroy lifecycle


demands

protected Set<DemandMetaData> demands
What the bean demands Set


supplies

protected Set<SupplyMetaData> supplies
What the bean supplies Set


depends

protected Set<DependencyMetaData> depends
What the bean dependencies Set


installs

protected List<InstallMetaData> installs
The install operations List


uninstalls

protected List<InstallMetaData> uninstalls
The uninstall operations List


installCallbacks

protected List<CallbackMetaData> installCallbacks
The install callback List


uninstallCallbacks

protected List<CallbackMetaData> uninstallCallbacks
The uninstall callback List


context

protected transient org.jboss.dependency.spi.ControllerContext context
The context

Constructor Detail

AbstractBeanMetaData

public AbstractBeanMetaData()
Create a new bean meta data


AbstractBeanMetaData

public AbstractBeanMetaData(String bean)
Create a new bean meta data

Parameters:
bean - the bean class name

AbstractBeanMetaData

public AbstractBeanMetaData(String name,
                            String bean)
Create a new bean meta data

Parameters:
name - the name
bean - the bean class name
Method Detail

getBeans

public List<BeanMetaData> getBeans()
Description copied from interface: BeanMetaDataFactory
Get the beans

Specified by:
getBeans in interface BeanMetaDataFactory
Returns:
a List

findNestedBeans

protected List<BeanMetaData> findNestedBeans()

addBeans

protected void addBeans(MetaDataVisitorNode current,
                        List<BeanMetaData> list)

getBean

public String getBean()
Get the bean class name.

Specified by:
getBean in interface BeanMetaData
Returns:
the fully qualified bean class name.

setBean

public void setBean(String bean)
Set the bean class name and flush the object cache.

Parameters:
bean - The bean class name to set.

getProperty

public PropertyMetaData getProperty(String name)
Get a property

Parameters:
name - the name
Returns:
the property name

addProperty

public void addProperty(PropertyMetaData property)
Add a property

Parameters:
property - the property

setProperties

public void setProperties(Set<PropertyMetaData> properties)
Set the propertiess.

Parameters:
properties - Set

getClassLoader

public ClassLoaderMetaData getClassLoader()
Description copied from interface: BeanMetaData
Get the bean ClassLoader

Specified by:
getClassLoader in interface BeanMetaData
Returns:
the ClassLoader metadata

setClassLoader

public void setClassLoader(ClassLoaderMetaData classLoader)
Description copied from interface: BeanMetaData
Set the bean ClassLoader

Specified by:
setClassLoader in interface BeanMetaData
Parameters:
classLoader - the ClassLoader metadata

setConstructor

public void setConstructor(ConstructorMetaData constructor)
Set the constructor

Parameters:
constructor - the constructor metadata

setDemands

public void setDemands(Set<DemandMetaData> demands)
Set what the bean demands.

Parameters:
demands - Set

setSupplies

public void setSupplies(Set<SupplyMetaData> supplies)
Set what the bean supplies.

Parameters:
supplies - Set

setDepends

public void setDepends(Set<DependencyMetaData> depends)
Set what the bean depends.

Parameters:
depends - Set

getName

public String getName()
Description copied from interface: BeanMetaData
Get the name

Specified by:
getName in interface BeanMetaData
Returns:
the name

setName

public void setName(String name)
Set the name.

Specified by:
setName in interface BeanMetaData
Parameters:
name - The name to set.

getAliases

public Set<Object> getAliases()
Description copied from interface: BeanMetaData
The aliases

Specified by:
getAliases in interface BeanMetaData
Returns:
the aliases or null if there are no aliases

setAliases

public void setAliases(Set<Object> aliases)

getParent

public String getParent()
Description copied from interface: BeanMetaData
Get the parent.

Specified by:
getParent in interface BeanMetaData
Returns:
the parent

setParent

public void setParent(String parent)
Set the parent.

Parameters:
parent - the parent name

isAbstract

public boolean isAbstract()
Description copied from interface: BeanMetaData
Is abstract metadata.

Specified by:
isAbstract in interface BeanMetaData
Returns:
is abstract

setAbstract

public void setAbstract(boolean anAbstract)
Set abstract.

Parameters:
anAbstract - is abstract

getAutowireType

public AutowireType getAutowireType()
Description copied from interface: BeanMetaData
Get the autowire type.

Specified by:
getAutowireType in interface BeanMetaData
Returns:
the autowire type

setAutowireType

public void setAutowireType(AutowireType autowireType)
Set autowire type.

Parameters:
autowireType - the type

getMode

public org.jboss.dependency.spi.ControllerMode getMode()
Description copied from interface: BeanMetaData
Get the mode

Specified by:
getMode in interface BeanMetaData
Returns:
the mode

setMode

public void setMode(org.jboss.dependency.spi.ControllerMode mode)
Description copied from interface: BeanMetaData
Set the name

Specified by:
setMode in interface BeanMetaData
Parameters:
mode - the mode

isAutowireCandidate

public boolean isAutowireCandidate()
Description copied from interface: BeanMetaData
Is this bean is a candidate for getting injected via contextual matching or callback resolution.

Specified by:
isAutowireCandidate in interface BeanMetaData
Returns:
true (default) if used for autowiring

setAutowireCandidate

public void setAutowireCandidate(boolean autowireCandidate)

getProperties

public Set<PropertyMetaData> getProperties()
Description copied from interface: BeanMetaData
Get the properties.

Specified by:
getProperties in interface BeanMetaData
Returns:
List.

getConstructor

public ConstructorMetaData getConstructor()
Description copied from interface: BeanMetaData
Get the constructor

Specified by:
getConstructor in interface BeanMetaData
Returns:
the constructor metadata

getCreate

public LifecycleMetaData getCreate()
Description copied from interface: BeanMetaData
Get the create lifecycle

Specified by:
getCreate in interface BeanMetaData
Returns:
the create lifecycle

setCreate

public void setCreate(LifecycleMetaData lifecycle)
Set the lifecycle metadata

Specified by:
setCreate in interface MutableLifecycleHolder
Parameters:
lifecycle - the lifecycle metadata

getStart

public LifecycleMetaData getStart()
Description copied from interface: BeanMetaData
Get the start lifecycle

Specified by:
getStart in interface BeanMetaData
Returns:
the start lifecycle

setStart

public void setStart(LifecycleMetaData lifecycle)
Set the start metadata

Specified by:
setStart in interface MutableLifecycleHolder
Parameters:
lifecycle - the lifecycle metadata

getStop

public LifecycleMetaData getStop()
Description copied from interface: BeanMetaData
Get the stop lifecycle

Specified by:
getStop in interface BeanMetaData
Returns:
the stop lifecycle

setStop

public void setStop(LifecycleMetaData lifecycle)
Set the stop metadata

Specified by:
setStop in interface MutableLifecycleHolder
Parameters:
lifecycle - the lifecycle metadata

getDestroy

public LifecycleMetaData getDestroy()
Description copied from interface: BeanMetaData
Get the destroy lifecycle

Specified by:
getDestroy in interface BeanMetaData
Returns:
the destroy lifecycle

setDestroy

public void setDestroy(LifecycleMetaData lifecycle)
Set the destroy metadata

Specified by:
setDestroy in interface MutableLifecycleHolder
Parameters:
lifecycle - the lifecycle metadata

getDemands

public Set<DemandMetaData> getDemands()
Description copied from interface: BeanMetaData
Get what this bean demands.

Specified by:
getDemands in interface BeanMetaData
Returns:
Set

getSupplies

public Set<SupplyMetaData> getSupplies()
Description copied from interface: BeanMetaData
Get what this bean supplies.

Specified by:
getSupplies in interface BeanMetaData
Returns:
Set

getDepends

public Set<DependencyMetaData> getDepends()
Description copied from interface: BeanMetaData
Get what this bean depends.

Specified by:
getDepends in interface BeanMetaData
Returns:
Set

getInstalls

public List<InstallMetaData> getInstalls()
Description copied from interface: BeanMetaData
Get the installation oeprations.

Specified by:
getInstalls in interface BeanMetaData
Returns:
List

setInstalls

public void setInstalls(List<InstallMetaData> installs)
Set the installs

Parameters:
installs - List

getUninstalls

public List<InstallMetaData> getUninstalls()
Description copied from interface: BeanMetaData
Get the uninstallation operations.

Specified by:
getUninstalls in interface BeanMetaData
Returns:
List

setUninstalls

public void setUninstalls(List<InstallMetaData> uninstalls)
Set the uninstalls

Parameters:
uninstalls - List

getInstallCallbacks

public List<CallbackMetaData> getInstallCallbacks()
Description copied from interface: BeanMetaData
Get the installation oeprations.

Specified by:
getInstallCallbacks in interface BeanMetaData
Returns:
List

setInstallCallbacks

public void setInstallCallbacks(List<CallbackMetaData> installCallbacks)

getUninstallCallbacks

public List<CallbackMetaData> getUninstallCallbacks()
Description copied from interface: BeanMetaData
Get the uninstallation operations.

Specified by:
getUninstallCallbacks in interface BeanMetaData
Returns:
List

setUninstallCallbacks

public void setUninstallCallbacks(List<CallbackMetaData> uninstallCallbacks)

initialVisit

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

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

addChildren

protected void addChildren(Set<MetaDataVisitorNode> children)
Overrides:
addChildren in class AbstractFeatureMetaData

getType

public org.jboss.reflect.spi.TypeInfo getType(MetaDataVisitor visitor,
                                              MetaDataVisitorNode previous)
                                       throws Throwable
Description copied from interface: TypeProvider
Get the injectee type info.

Specified by:
getType in interface TypeProvider
Parameters:
visitor - meda data visitor
previous - previous node in the stack
Returns:
TypeInfo type info for injection ByClass
Throws:
Throwable - if could not determine class

getUnderlyingValue

public Object getUnderlyingValue()
Description copied from interface: ValueMetaData
Get the underlying value

Specified by:
getUnderlyingValue in interface ValueMetaData
Returns:
the underlying value

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
Parameters:
info - the type info
cl - the classloader
Returns:
the value.
Throws:
Throwable - for any error

toString

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

toShortString

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


Copyright ? 2007 JBoss Inc.. All Rights Reserved.