com.swiftmq.extension.bridge
Interface ObjectFactory

All Known Implementing Classes:
JNDIObjectFactory

public interface ObjectFactory

Factory used from the JMS bridge to create the appropriate JMS administered objects (destinations, connection factories) for the foreign JMS server. The bridge provides an implementation for JNDI lookups. Because this is the standard way of getting administered JMS objects, it should match most cases. If you are in the situation where you have to bridge to a JMS server which doesn't provide a JNDI lookup and where you have to use their proprietary connection factories directly, then you can create your own ObjectFactory by implementing this interface.

The ObjectFactory must be specified while setting up the bridge through the property objectfactory. Implementations have to provide a public constructor without parameters. If specified, the bridge will set loaded properties immediatly after creating of the ObjectFactory with setProperties.

Version:
1.0
Author:
IIT GmbH, Bremen/Germany
See Also:
JNDIObjectFactory

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.
 

Method Detail

setProperties

public void setProperties(java.util.Properties prop)
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.
Parameters:
prop - properties

getQueueConnectionFactory

public javax.jms.QueueConnectionFactory getQueueConnectionFactory(java.lang.String name)
                                                           throws ObjectFactoryException
Returns a QueueConnectionFactory.
Parameters:
name - Name of the QueueConnectionFactory
Throws:
ObjectFactoryException - if an error occurs

getTopicConnectionFactory

public javax.jms.TopicConnectionFactory getTopicConnectionFactory(java.lang.String name)
                                                           throws ObjectFactoryException
Returns a TopicConnectionFactory.
Parameters:
name - Name of the TopicConnectionFactory
Throws:
ObjectFactoryException - if an error occurs

getQueue

public javax.jms.Queue getQueue(java.lang.String queue)
                         throws ObjectFactoryException
Returns a Queue.
Parameters:
name - Name of the Queue
Throws:
ObjectFactoryException - if an error occurs

getTopic

public javax.jms.Topic getTopic(java.lang.String topic)
                         throws ObjectFactoryException
Returns a Topic.
Parameters:
name - Name of the Topic
Throws:
ObjectFactoryException - if an error occurs

destroy

public void destroy()
             throws ObjectFactoryException
Destroys the ObjectFactory and frees all resources.
Throws:
ObjectFactoryException - if an error occurs