Package org.apache.activemq.artemis.jndi
Class JNDIReferenceFactory
- java.lang.Object
-
- org.apache.activemq.artemis.jndi.JNDIReferenceFactory
-
- All Implemented Interfaces:
ObjectFactory
public class JNDIReferenceFactory extends Object implements ObjectFactory
Converts objects implementing JNDIStorable into a property fields so they can be stored and regenerated from JNDI- Since:
- 1.0
-
-
Constructor Summary
Constructors Constructor Description JNDIReferenceFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Reference
createReference(String instanceClassName, JNDIStorable po)
Create a Reference instance from a JNDIStorable objectObject
getObjectInstance(Object object, Name name, Context nameCtx, Hashtable<?,?> environment)
This will be called by a JNDIprovider when a Reference is retrieved from a JNDI store - and generates the original instancestatic Properties
getProperties(Reference reference)
static Class<?>
loadClass(Object thisObj, String className)
Retrieve the class loader for a named class
-
-
-
Method Detail
-
getObjectInstance
public Object getObjectInstance(Object object, Name name, Context nameCtx, Hashtable<?,?> environment) throws Exception
This will be called by a JNDIprovider when a Reference is retrieved from a JNDI store - and generates the original instance- Specified by:
getObjectInstance
in interfaceObjectFactory
- Parameters:
object
- the Reference objectname
- the JNDI namenameCtx
- the contextenvironment
- the environment settings used by JNDI- Returns:
- the instance built from the Reference object
- Throws:
Exception
- if building the instance from Reference fails (usually class not found)
-
getProperties
public static Properties getProperties(Reference reference)
-
createReference
public static Reference createReference(String instanceClassName, JNDIStorable po) throws NamingException
Create a Reference instance from a JNDIStorable object- Parameters:
instanceClassName
- The name of the class that is being created.po
- The properties object to use when configuring the new instance.- Returns:
- Reference
- Throws:
NamingException
- if an error occurs while creating the new instance.
-
loadClass
public static Class<?> loadClass(Object thisObj, String className) throws ClassNotFoundException
Retrieve the class loader for a named class- Parameters:
thisObj
- Local object to use when doing the lookup.className
- The name of the class being loaded.- Returns:
- the class that was requested.
- Throws:
ClassNotFoundException
- if a matching class cannot be created.
-
-