com.swiftmq.extension.bridge
Class JNDIObjectFactory
java.lang.Object
|
+--com.swiftmq.extension.bridge.JNDIObjectFactory
- All Implemented Interfaces:
- ObjectFactory
- public class JNDIObjectFactory
- extends java.lang.Object
- implements ObjectFactory
Implementation of an ObjectFactory that returns
requested JMS administered objects as a result of JNDI lookup's.
The factory requires a property file with JNDI properties required
for creating the InitialContext object. The property
file must contain all required JNDI properties to create that
object.
Example for Weblogic:
java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
java.naming.provider.url=t3://localhost:7001
Example for MQSeries:
java.naming.factory.initial=com.sun.jndi.fscontext.RefFSContextFactory
java.naming.provider.url=file://mqseries/jndi
All properties contained in the property file are set "as is"
in a Hashtable that is passed as a parameter to the
InitialContext constructor.
- Version:
- 1.0
- Author:
- IIT GmbH, Bremen/Germany
- See Also:
ObjectFactory
Method Summary |
void |
destroy()
Destroys the ObjectFactory and frees all resources. |
javax.jms.Queue |
getQueue(java.lang.String queue)
Returns a Queue. |
javax.jms.QueueConnectionFactory |
getQueueConnectionFactory(java.lang.String name)
Returns a QueueConnectionFactory. |
javax.jms.Topic |
getTopic(java.lang.String topic)
Returns a Topic. |
javax.jms.TopicConnectionFactory |
getTopicConnectionFactory(java.lang.String name)
Returns a TopicConnectionFactory. |
void |
setProperties(java.util.Properties prop)
Set the properties for this ObjectFactory. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JNDIObjectFactory
public JNDIObjectFactory()
setProperties
public void setProperties(java.util.Properties prop)
- Description copied from interface:
ObjectFactory
- Set the properties for this ObjectFactory. A property file can
be specified by creating a bridge. If specified, the file will be loaded
and set immediatly after creation of the ObjectFactory.
- Specified by:
setProperties
in interface ObjectFactory
- Following copied from interface:
com.swiftmq.extension.bridge.ObjectFactory
- Parameters:
prop
- properties
getQueueConnectionFactory
public javax.jms.QueueConnectionFactory getQueueConnectionFactory(java.lang.String name)
throws ObjectFactoryException
- Description copied from interface:
ObjectFactory
- Returns a QueueConnectionFactory.
- Specified by:
getQueueConnectionFactory
in interface ObjectFactory
- Following copied from interface:
com.swiftmq.extension.bridge.ObjectFactory
- Parameters:
name
- Name of the QueueConnectionFactory- Throws:
ObjectFactoryException
- if an error occurs
getTopicConnectionFactory
public javax.jms.TopicConnectionFactory getTopicConnectionFactory(java.lang.String name)
throws ObjectFactoryException
- Description copied from interface:
ObjectFactory
- Returns a TopicConnectionFactory.
- Specified by:
getTopicConnectionFactory
in interface ObjectFactory
- Following copied from interface:
com.swiftmq.extension.bridge.ObjectFactory
- Parameters:
name
- Name of the TopicConnectionFactory- Throws:
ObjectFactoryException
- if an error occurs
getQueue
public javax.jms.Queue getQueue(java.lang.String queue)
throws ObjectFactoryException
- Description copied from interface:
ObjectFactory
- Returns a Queue.
- Specified by:
getQueue
in interface ObjectFactory
- Following copied from interface:
com.swiftmq.extension.bridge.ObjectFactory
- Parameters:
name
- Name of the Queue- Throws:
ObjectFactoryException
- if an error occurs
getTopic
public javax.jms.Topic getTopic(java.lang.String topic)
throws ObjectFactoryException
- Description copied from interface:
ObjectFactory
- Returns a Topic.
- Specified by:
getTopic
in interface ObjectFactory
- Following copied from interface:
com.swiftmq.extension.bridge.ObjectFactory
- Parameters:
name
- Name of the Topic- Throws:
ObjectFactoryException
- if an error occurs
destroy
public void destroy()
throws ObjectFactoryException
- Description copied from interface:
ObjectFactory
- Destroys the ObjectFactory and frees all resources.
- Specified by:
destroy
in interface ObjectFactory
- Following copied from interface:
com.swiftmq.extension.bridge.ObjectFactory
- Throws:
ObjectFactoryException
- if an error occurs