Package org.jboss.as.naming.context
Class ObjectFactoryBuilder
- java.lang.Object
-
- org.jboss.as.naming.context.ObjectFactoryBuilder
-
- All Implemented Interfaces:
DirObjectFactory,ObjectFactory,ObjectFactoryBuilder
public class ObjectFactoryBuilder extends Object implements ObjectFactoryBuilder, DirObjectFactory
ObjectFactoryBuilder implementation used to support custom object factories being loaded from modules. This class also provides the default object factory implementation.- Author:
- John Bailey
-
-
Field Summary
Fields Modifier and Type Field Description static ObjectFactoryBuilderINSTANCE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectFactorycreateObjectFactory(Object obj, Hashtable<?,?> environment)Create an object factory.ObjectgetObjectInstance(Object ref, Name name, Context nameCtx, Hashtable<?,?> environment)Create an object instance.ObjectgetObjectInstance(Object ref, Name name, Context nameCtx, Hashtable<?,?> environment, Attributes attributes)Create an object instance.
-
-
-
Field Detail
-
INSTANCE
public static final ObjectFactoryBuilder INSTANCE
-
-
Method Detail
-
createObjectFactory
public ObjectFactory createObjectFactory(Object obj, Hashtable<?,?> environment) throws NamingException
Create an object factory. If the object parameter is a reference it will attempt to create anObjectFactoryfrom the reference. If the parameter is not a reference, or the reference does not create anObjectFactoryit will returnthisas theObjectFactoryto use.- Specified by:
createObjectFactoryin interfaceObjectFactoryBuilder- Parameters:
obj- The object bound in the naming contextenvironment- The environment information- Returns:
- The object factory the object resolves to
- Throws:
NamingException- If any problems occur
-
getObjectInstance
public Object getObjectInstance(Object ref, Name name, Context nameCtx, Hashtable<?,?> environment) throws Exception
Create an object instance.- Specified by:
getObjectInstancein interfaceObjectFactory- Parameters:
ref- Object containing reference informationname- The name relative to nameCtxnameCtx- The naming contextenvironment- The environment information- Returns:
- The object
- Throws:
Exception- If any error occur
-
getObjectInstance
public Object getObjectInstance(Object ref, Name name, Context nameCtx, Hashtable<?,?> environment, Attributes attributes) throws Exception
Create an object instance.- Specified by:
getObjectInstancein interfaceDirObjectFactory- Parameters:
ref- Object containing reference informationname- The name relative to nameCtxnameCtx- The naming contextenvironment- The environment informationattributes- The directory attributes- Returns:
- The object
- Throws:
Exception- If any error occur
-
-