Package org.jboss.as.naming.context
Class ObjectFactoryBuilder
java.lang.Object
org.jboss.as.naming.context.ObjectFactoryBuilder
- All Implemented Interfaces:
DirObjectFactory,ObjectFactory,ObjectFactoryBuilder
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 -
Method Summary
Modifier and TypeMethodDescriptioncreateObjectFactory(Object obj, Hashtable<?, ?> environment) Create an object factory.getObjectInstance(Object ref, Name name, Context nameCtx, Hashtable<?, ?> environment) Create an object instance.getObjectInstance(Object ref, Name name, Context nameCtx, Hashtable<?, ?> environment, Attributes attributes) Create an object instance.
-
Field Details
-
INSTANCE
-
-
Method Details
-
createObjectFactory
public ObjectFactory createObjectFactory(Object obj, Hashtable<?, ?> environment) throws NamingExceptionCreate 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 ExceptionCreate 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 ExceptionCreate 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
-