Interface BeanMetadata
-
- All Superinterfaces:
ComponentMetadata
,Metadata
,NonNullMetadata
,Target
@ConsumerType public interface BeanMetadata extends Target, ComponentMetadata
Metadata for a Bean component.This is specified by the
bean
element.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
SCOPE_PROTOTYPE
The bean hasprototype
scope.static java.lang.String
SCOPE_SINGLETON
The bean hassingleton
scope.-
Fields inherited from interface org.osgi.service.blueprint.reflect.ComponentMetadata
ACTIVATION_EAGER, ACTIVATION_LAZY
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.List<BeanArgument>
getArguments()
Return the arguments for the factory method or constructor of the bean.java.lang.String
getClassName()
Return the name of the class specified for the bean.java.lang.String
getDestroyMethod()
Return the name of the destroy method specified for the bean.Target
getFactoryComponent()
Return the Metadata for the factory component on which to invoke the factory method for the bean.java.lang.String
getFactoryMethod()
Return the name of the factory method for the bean.java.lang.String
getInitMethod()
Return the name of the init method specified for the bean.java.util.List<BeanProperty>
getProperties()
Return the properties for the bean.java.lang.String
getScope()
Return the scope for the bean.-
Methods inherited from interface org.osgi.service.blueprint.reflect.ComponentMetadata
getActivation, getDependsOn, getId
-
-
-
-
Field Detail
-
SCOPE_SINGLETON
static final java.lang.String SCOPE_SINGLETON
The bean hassingleton
scope.- See Also:
getScope()
, Constant Field Values
-
SCOPE_PROTOTYPE
static final java.lang.String SCOPE_PROTOTYPE
The bean hasprototype
scope.- See Also:
getScope()
, Constant Field Values
-
-
Method Detail
-
getClassName
java.lang.String getClassName()
Return the name of the class specified for the bean. This is specified by theclass
attribute of the bean definition.- Returns:
- The name of the class specified for the bean. If no class is
specified in the bean definition, because the a factory component
is used instead, then this method will return
null
.
-
getInitMethod
java.lang.String getInitMethod()
Return the name of the init method specified for the bean. This is specified by theinit-method
attribute of the bean definition.- Returns:
- The name of the init method specified for the bean, or
null
if no init method is specified.
-
getDestroyMethod
java.lang.String getDestroyMethod()
Return the name of the destroy method specified for the bean. This is specified by thedestroy-method
attribute of the bean definition.- Returns:
- The name of the destroy method specified for the bean, or
null
if no destroy method is specified.
-
getArguments
java.util.List<BeanArgument> getArguments()
Return the arguments for the factory method or constructor of the bean. This is specified by the childargument
elements.- Returns:
- An immutable List of
BeanArgument
objects for the factory method or constructor of the bean. The List is empty if no arguments are specified for the bean.
-
getProperties
java.util.List<BeanProperty> getProperties()
Return the properties for the bean. This is specified by the childproperty
elements.- Returns:
- An immutable List of
BeanProperty
objects, with one entry for each property to be injected in the bean. The List is empty if no property injection is specified for the bean.
-
getFactoryMethod
java.lang.String getFactoryMethod()
Return the name of the factory method for the bean. This is specified by thefactory-method
attribute of the bean.- Returns:
- The name of the factory method of the bean or
null
if no factory method is specified for the bean.
-
getFactoryComponent
Target getFactoryComponent()
Return the Metadata for the factory component on which to invoke the factory method for the bean. This is specified by thefactory-ref
attribute of the bean.When a factory method and factory component have been specified for the bean, this method returns the factory component on which to invoke the factory method for the bean. When no factory component has been specified this method will return
null
. When a factory method has been specified for the bean but a factory component has not been specified, the factory method must be invoked as a static method on the bean's class.- Returns:
- The Metadata for the factory component on which to invoke the
factory method for the bean or
null
if no factory component is specified.
-
getScope
java.lang.String getScope()
Return the scope for the bean.- Returns:
- The scope for the bean. Returns
null
if the scope has not been explicitly specified in the bean definition. - See Also:
SCOPE_SINGLETON
,SCOPE_PROTOTYPE
-
-