org.globus.ogsa.impl.core.notification.framework.jms
Class JMSAdapter

java.lang.Object
  extended byorg.globus.ogsa.impl.core.notification.framework.jms.JMSAdapter
Direct Known Subclasses:
OpenJMSAdapter

public abstract class JMSAdapter
extends java.lang.Object

The JMSAdapter class. This class is used to set create and set a JMS Topic Connection Factory.


Field Summary
protected static Log logger
           
protected  TopicConnectionFactory theTopicConnectionFactory
          The TopicConnectionFactory
 
Constructor Summary
JMSAdapter()
          The Constructor of the class.
 
Method Summary
 void close()
          Closes the connection
 Topic createTopic(java.lang.String aTopicName)
          The createTopic method This method creates a topic for the given name.
static JMSAdapter getJMSAdapter()
          A Static method to get the JMSAdapter by the name of the class.
 Topic getTopic(java.lang.String aTopicName)
          The getTopic method.
 TopicConnection getTopicConnection()
          The getTopicConnection method.
abstract  TopicConnectionFactory getTopicConnectionFactory()
          The getTopicConnectionFactory method.
 TopicSession getTopicSession()
          The getTopicSession method.
protected  void setTopicConnectionFactory(TopicConnectionFactory aTCF)
          The setTopicConnectionFactory method.
 void start()
          Starts the connection with the broker
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static Log logger

theTopicConnectionFactory

protected TopicConnectionFactory theTopicConnectionFactory
The TopicConnectionFactory

Constructor Detail

JMSAdapter

public JMSAdapter()
The Constructor of the class.

Method Detail

getJMSAdapter

public static JMSAdapter getJMSAdapter()
                                throws java.lang.Exception
A Static method to get the JMSAdapter by the name of the class. The name of the class is obtained from a config file. The two adapters that currently exsist are: "org.globus.ogsa.notification.jms.GryphonAdapter" "org.globus.ogsa.notification.jms.OpenJMSAdapter"

Returns:
JMSAdapter the adapter that was dynamically instantiated.
Throws:
java.lang.Exception - if the adapter can not be returned.

getTopicConnectionFactory

public abstract TopicConnectionFactory getTopicConnectionFactory()
                                                          throws JMSException,
                                                                 java.lang.Exception
The getTopicConnectionFactory method. This method is the accessor for the TopicConnectionFactory. This is an abstract method, so we can have any kind of factory plugged in.

Returns:
Topic Connection Factory - The connection factory to be used.
Throws:
JMSException
java.lang.Exception

setTopicConnectionFactory

protected void setTopicConnectionFactory(TopicConnectionFactory aTCF)
                                  throws java.lang.Exception
The setTopicConnectionFactory method. This method is the setter for the TopicConnectionFactory.

Parameters:
aTCF - - The connection factory to be set.
Throws:
java.lang.Exception

createTopic

public Topic createTopic(java.lang.String aTopicName)
The createTopic method This method creates a topic for the given name.

Parameters:
aTopicName - - The topic to be created.
Returns:
Topic.

getTopic

public Topic getTopic(java.lang.String aTopicName)
The getTopic method. This method gets the topic from JNDI by name. If the topic does not exist, then a new topic is created.

Parameters:
aTopicName - - The topic to be retrived.
Returns:
Topic.

getTopicSession

public TopicSession getTopicSession()
The getTopicSession method. This method is the accessor for the topic session.

Returns:
TopicSession.

getTopicConnection

public TopicConnection getTopicConnection()
The getTopicConnection method. This method is the accessor for the TopicConnection.

Returns:
TopicConnection.

start

public void start()
           throws JMSException
Starts the connection with the broker

Throws:
JMSException

close

public void close()
           throws JMSException
Closes the connection

Throws:
JMSException