public class AbstractManagedObjectFactory extends ManagedObjectFactory implements ManagedObjectBuilder
| Modifier and Type | Field and Description |
|---|---|
static GenericMetaType |
MANAGED_OBJECT_META_TYPE
The managed object meta type
|
| Constructor and Description |
|---|
AbstractManagedObjectFactory()
Create an AbstractManagedObjectFactory that uses an AbstractInstanceClassFactory
as the defaultInstanceFactory and AbstractManagedObjectPopulator as the
defaultManagedObjectPopulator.
|
AbstractManagedObjectFactory(MetaTypeFactory metaTypeFactory,
MetaValueFactory metaValueFactory,
InstanceClassFactory<?> defaultInstanceFactory,
ManagedObjectPopulator<?> defaultManagedObjectPopulator,
Map<Class<?>,ManagedObjectBuilder> builders,
Map<Class<?>,InstanceClassFactory<?>> instanceFactories)
Create an AbstractManagedObjectFactory the given factories, supporting
information.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addDefaultValueBuilder(DefaultValueBuilder builder) |
void |
addManagedObjectDefinition(ManagedObjectDefinition definition)
Add managed object definition.
|
ManagedObject |
buildManagedObject(Class<?> clazz,
org.jboss.metadata.spi.MetaData metaData)
The ManagedObjectBuilder.buildManagedObject implementation.
|
protected ManagedProperty |
createDefaultManagedProperty(Fields fields)
Create default MangedProperty instance.
|
<T> ManagedObject |
createManagedObject(Class<T> clazz,
org.jboss.metadata.spi.MetaData metaData) |
static ManagedProperty |
createManagedProperty(Class<? extends ManagedProperty> factory,
Fields fields)
Create a ManagedProperty by looking to the factory for ctor(Fields)
|
protected <T> ManagedObject |
createSkeletonManagedObject(Class<T> clazz,
org.jboss.metadata.spi.MetaData metaData)
Create a skeleton managed object
|
protected <X extends Annotation> |
getAnnotation(Class<X> annotationType,
org.jboss.reflect.spi.AnnotatedInfo info,
org.jboss.metadata.spi.MetaData metaData) |
protected Collection<?> |
getAsCollection(Object value) |
protected org.jboss.beans.info.spi.BeanInfo |
getBeanInfo(Class<?> iface)
Build up a BeanInfo from the interface class and all interfaces it
implements.
|
protected ManagedObjectBuilder |
getBuilder(Class<?> clazz)
Get the builder for a class
|
Map<Class<?>,ManagedObjectBuilder> |
getBuilders() |
org.jboss.config.spi.Configuration |
getConfiguration()
Get the configuration
|
InstanceClassFactory<?> |
getDefaultInstanceFactory()
Get the default InstanceClassFactory
|
ManagedObjectPopulator<?> |
getDefaultManagedObjectPopulator() |
<X> InstanceClassFactory<X> |
getInstanceClassFactory(Class<X> clazz,
org.jboss.metadata.spi.MetaData metaData)
Get the instance factory for a class
|
Map<Class<?>,InstanceClassFactory<?>> |
getInstanceFactories() |
protected ManagedOperation |
getManagedOperation(org.jboss.reflect.spi.MethodInfo methodInfo,
ManagementOperation opAnnotation,
org.jboss.metadata.spi.MetaData metaData) |
protected ManagedProperty |
getManagedProperty(Class<? extends ManagedProperty> factory,
Fields fields)
Look for ctor(Fields)
|
protected MetaType |
getMetaType(org.jboss.reflect.spi.AnnotatedInfo info,
org.jboss.reflect.spi.TypeInfo infoType,
org.jboss.metadata.spi.MetaData metaData,
boolean useTypeFactory,
MetaMapper[] mapperReturn)
Get the MetaType for info by looking for MetaMapping/MetaMappingFactory
annotations in addition to the info type.
|
MetaTypeFactory |
getMetaTypeFactory() |
MetaValueFactory |
getMetaValueFactory() |
protected <X> ManagedObjectPopulator<X> |
getPopulator(Class<X> clazz)
Get the populator for a class
|
protected String |
getPropertyName(ManagedProperty property)
Get the property name.
|
protected void |
initDefaultValueBuilders()
Initialize the DefaultValueBuilder map with known implementations
|
ManagedObject |
initManagedObject(Object instance,
Class<?> instanceType,
org.jboss.metadata.spi.MetaData metaData,
String name,
String nameType)
Create a managed object from the given object
|
void |
removeDefaltValueBuilder(DefaultValueBuilder builder) |
void |
removeManagedObjectDefinition(ManagedObjectDefinition definition)
Remove managed object definition.
|
void |
setBuilder(Class<?> clazz,
ManagedObjectBuilder builder)
Set a managed object builder
|
void |
setBuilders(Map<Class<?>,ManagedObjectBuilder> builders) |
void |
setDefaultInstanceFactory(InstanceClassFactory<? extends Serializable> defaultInstanceFactory)
Set the default InstanceClassFactory.
|
void |
setDefaultManagedObjectPopulator(ManagedObjectPopulator<? extends Serializable> defaultManagedObjectPopulator)
A default implementation of ManagedObjectPopulator that is used when
there is no ManagedObjectBuilder registered for a given type.
|
void |
setDefaultsBuilder(MetaType type,
DefaultValueBuilder builder) |
<T> void |
setInstanceClassFactory(Class<T> clazz,
InstanceClassFactory<T> factory)
Set the InstanceClassFactory for an instance type.
|
void |
setInstanceFactories(Map<Class<?>,InstanceClassFactory<?>> instanceFactories) |
void |
setMetaTypeFactory(MetaTypeFactory metaTypeFactory) |
void |
setMetaValueFactory(MetaValueFactory metaValueFactory) |
addInstanceClassFactory, createManagedObject, getInstance, getInstanceClassFactory, initManagedObject, initManagedObject, initManagedObject, removeInstanceClassFactorypublic static final GenericMetaType MANAGED_OBJECT_META_TYPE
public AbstractManagedObjectFactory()
public AbstractManagedObjectFactory(MetaTypeFactory metaTypeFactory, MetaValueFactory metaValueFactory, InstanceClassFactory<?> defaultInstanceFactory, ManagedObjectPopulator<?> defaultManagedObjectPopulator, Map<Class<?>,ManagedObjectBuilder> builders, Map<Class<?>,InstanceClassFactory<?>> instanceFactories)
metaTypeFactory - metaValueFactory - defaultInstanceFactory - defaultManagedObjectPopulator - builders - instanceFactories - public static ManagedProperty createManagedProperty(Class<? extends ManagedProperty> factory, Fields fields)
factory - - the ManagedProperty implementation classfields - - the fields to pass to the ctorpublic void addManagedObjectDefinition(ManagedObjectDefinition definition)
definition - the MO definitionpublic void removeManagedObjectDefinition(ManagedObjectDefinition definition)
definition - the MO definitionpublic void addDefaultValueBuilder(DefaultValueBuilder builder)
public void setDefaultsBuilder(MetaType type, DefaultValueBuilder builder)
public void removeDefaltValueBuilder(DefaultValueBuilder builder)
public org.jboss.config.spi.Configuration getConfiguration()
public MetaTypeFactory getMetaTypeFactory()
public void setMetaTypeFactory(MetaTypeFactory metaTypeFactory)
public MetaValueFactory getMetaValueFactory()
public void setMetaValueFactory(MetaValueFactory metaValueFactory)
public Map<Class<?>,ManagedObjectBuilder> getBuilders()
public void setBuilders(Map<Class<?>,ManagedObjectBuilder> builders)
public Map<Class<?>,InstanceClassFactory<?>> getInstanceFactories()
public void setInstanceFactories(Map<Class<?>,InstanceClassFactory<?>> instanceFactories)
public InstanceClassFactory<?> getDefaultInstanceFactory()
public void setDefaultInstanceFactory(InstanceClassFactory<? extends Serializable> defaultInstanceFactory)
defaultInstanceFactory - the default InstanceClassFactory to fall
back to. It may be null if no default should be used.public ManagedObjectPopulator<?> getDefaultManagedObjectPopulator()
public void setDefaultManagedObjectPopulator(ManagedObjectPopulator<? extends Serializable> defaultManagedObjectPopulator)
defaultManagedObjectPopulator - getBuilder(Class)public <T> ManagedObject createManagedObject(Class<T> clazz, org.jboss.metadata.spi.MetaData metaData)
createManagedObject in class ManagedObjectFactorypublic ManagedObject initManagedObject(Object instance, Class<?> instanceType, org.jboss.metadata.spi.MetaData metaData, String name, String nameType)
ManagedObjectFactoryinitManagedObject in class ManagedObjectFactoryinstance - - the object to build the ManagedObject frominstanceType - - the optional type to determine InstanceClassFactory registration from.
If not specified instance.getClass() is used.metaData - - the optional metadata repository accessor used to query
for management annotation overrides/additions to the clazzname - - the name of the managed object. If null, the name will
be derived from the object annotations or attachment name.nameType - - the name of the managed object. If null, the name will
be derived from the object annotations or default to "".ManagementObjectIDpublic void setBuilder(Class<?> clazz, ManagedObjectBuilder builder)
ManagedObjectFactorysetBuilder in class ManagedObjectFactoryclazz - the classbuilder - the builder (null to remove the builder)public <T> void setInstanceClassFactory(Class<T> clazz, InstanceClassFactory<T> factory)
ManagedObjectFactorysetInstanceClassFactory in class ManagedObjectFactoryclazz - the classfactory - - the factory used to obtain the class to scan for
management annotations.protected <T> ManagedObject createSkeletonManagedObject(Class<T> clazz, org.jboss.metadata.spi.MetaData metaData)
T - the typeclazz - the clazzpublic ManagedObject buildManagedObject(Class<?> clazz, org.jboss.metadata.spi.MetaData metaData)
buildManagedObject in interface ManagedObjectBuilderclazz - the attachment classmetaData - - the optional metadata repository accessor used to query
for management annotation overrides/additions to the clazzprotected ManagedProperty createDefaultManagedProperty(Fields fields)
fields - the fieldsprotected String getPropertyName(ManagedProperty property)
property - managed propertyprotected ManagedOperation getManagedOperation(org.jboss.reflect.spi.MethodInfo methodInfo, ManagementOperation opAnnotation, org.jboss.metadata.spi.MetaData metaData)
methodInfo - opAnnotation - protected MetaType getMetaType(org.jboss.reflect.spi.AnnotatedInfo info, org.jboss.reflect.spi.TypeInfo infoType, org.jboss.metadata.spi.MetaData metaData, boolean useTypeFactory, MetaMapper[] mapperReturn)
methodInfo - metaData - protected ManagedObjectBuilder getBuilder(Class<?> clazz)
clazz - the classpublic <X> InstanceClassFactory<X> getInstanceClassFactory(Class<X> clazz, org.jboss.metadata.spi.MetaData metaData)
getInstanceClassFactory in class ManagedObjectFactoryclazz - the classprotected void initDefaultValueBuilders()
protected <X> ManagedObjectPopulator<X> getPopulator(Class<X> clazz)
clazz - the classprotected Collection<?> getAsCollection(Object value)
protected ManagedProperty getManagedProperty(Class<? extends ManagedProperty> factory, Fields fields)
factory - - the ManagedProperty implementation classfields - - the fields to pass to the ctorprotected <X extends Annotation> X getAnnotation(Class<X> annotationType, org.jboss.reflect.spi.AnnotatedInfo info, org.jboss.metadata.spi.MetaData metaData)
protected org.jboss.beans.info.spi.BeanInfo getBeanInfo(Class<?> iface)
iface - - the interface for the managed objectCopyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.