com.atomikos.jms
Class TopicConnectionFactoryBean

java.lang.Object
  extended by com.atomikos.jms.AbstractConnectionFactoryBean
      extended by com.atomikos.jms.TopicConnectionFactoryBean
All Implemented Interfaces:
Serializable, ConnectionFactory, TopicConnectionFactory, Referenceable

public class TopicConnectionFactoryBean
extends AbstractConnectionFactoryBean
implements TopicConnectionFactory

Copyright © 2006, Atomikos. All rights reserved. Use this class to access JMS topics within your JTA transactions: rollback of the transaction will also cancel any messages sent or received. Instances of this class need a JMS vendor-specific instance of XATopicConnectionFactory to work with. Check your JMS-vendor's documentation on how to do that. Instances can be set up in a GUI wizard tool and saved on disk or in JNDI. No explicit registration with the transaction engine is necessary: this class does everything automatically. As soon as an instance is created, it is fully capable of interacting with the Atomikos transaction manager, and will transparently take part in active transactions.

Note: any property changes made AFTER getting the first connection will NOT have any effect!

Topic functionality in this product was sponsored by Webtide.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.atomikos.jms.AbstractConnectionFactoryBean
resourceName_, xaFactoryJndiName_, xidFactory_
 
Constructor Summary
TopicConnectionFactoryBean()
           
 
Method Summary
protected  void checkSetup()
           
 Connection createConnection()
          Creates a default connection.
 Connection createConnection(String userName, String password)
          Creates a default connection with given user credentials.
 TopicConnection createTopicConnection()
          Creates a default topic connection.
 TopicConnection createTopicConnection(String userName, String password)
          Creates a topic connection with given user credentials.
 boolean equals(Object o)
           
 XATopicConnectionFactory getXaTopicConnectionFactory()
          Get the XATopicConnectionFactory as previously set.
 int hashCode()
           
 void setXaTopicConnectionFactory(XATopicConnectionFactory factory)
          Sets the XATopicConnectionFactory to use.
 
Methods inherited from class com.atomikos.jms.AbstractConnectionFactoryBean
getReference, getResourceName, getXaFactoryJndiName, getXidFactory, init, setResourceName, setXaFactoryJndiName, setXidFactory
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TopicConnectionFactoryBean

public TopicConnectionFactoryBean()
Method Detail

checkSetup

protected void checkSetup()
                   throws JMSException
Specified by:
checkSetup in class AbstractConnectionFactoryBean
Throws:
JMSException

setXaTopicConnectionFactory

public void setXaTopicConnectionFactory(XATopicConnectionFactory factory)
Sets the XATopicConnectionFactory to use. This method is optional and an alternative to setXaFactoryJndiName.

Parameters:
xaFactory - The object to use.

getXaTopicConnectionFactory

public XATopicConnectionFactory getXaTopicConnectionFactory()
Get the XATopicConnectionFactory as previously set.

Returns:
XATopicConnectionFactory The factory, or null if only the JNDI name was set.

createTopicConnection

public TopicConnection createTopicConnection()
                                      throws JMSException
Creates a default topic connection.

Specified by:
createTopicConnection in interface TopicConnectionFactory
Throws:
JMSException

createTopicConnection

public TopicConnection createTopicConnection(String userName,
                                             String password)
                                      throws JMSException
Creates a topic connection with given user credentials.

Specified by:
createTopicConnection in interface TopicConnectionFactory
Throws:
JMSException

createConnection

public Connection createConnection()
                            throws JMSException
Creates a default connection.

Specified by:
createConnection in interface ConnectionFactory
Throws:
JMSException

createConnection

public Connection createConnection(String userName,
                                   String password)
                            throws JMSException
Creates a default connection with given user credentials.

Specified by:
createConnection in interface ConnectionFactory
Throws:
JMSException

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object