Package org.apache.activemq.jndi
Class JNDIReferenceFactory
java.lang.Object
org.apache.activemq.jndi.JNDIReferenceFactory
- All Implemented Interfaces:
ObjectFactory
Converts objects implementing JNDIStorable into a property fields so they can
be stored and regenerated from JNDI
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Reference
createReference
(String instanceClassName, JNDIStorableInterface po) Create a Reference instance from a JNDIStorable objectgetObjectInstance
(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 Class
Retrieve the class loader for a named class
-
Constructor Details
-
JNDIReferenceFactory
public JNDIReferenceFactory()
-
-
Method Details
-
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)
-
createReference
public static Reference createReference(String instanceClassName, JNDIStorableInterface po) throws NamingException Create a Reference instance from a JNDIStorable object- Parameters:
instanceClassName
-po
-- Returns:
- Throws:
NamingException
-
loadClass
Retrieve the class loader for a named class- Parameters:
thisObj
-className
-- Returns:
- Throws:
ClassNotFoundException
-