JSlim  


com.gtcgroup.jslim
Class JSlimTopicConnectionFactory

java.lang.Object
  extended bycom.gtcgroup.jslim.JSlimTopicConnectionFactory
All Implemented Interfaces:
javax.jms.ConnectionFactory, IJSlimCachable, javax.jms.TopicConnectionFactory

final class JSlimTopicConnectionFactory
extends java.lang.Object
implements javax.jms.TopicConnectionFactory, IJSlimCachable

This class wraps a TopicConnectionFactory in order to intercept methods throwing a JMSException. If an exception is thrown all cached objects are discarded preventing further use. The typical scenario supported is the unavailability of a previously available resource.

Copyright (c) 1999 - 2004 by Global Technology Consulting Group, Inc. at gtcGroup.com.
Use is authorized, provided the source is acknowledged by inclusion of this copyright notice.

Since:
v. 1.0
Author:
MDT (MarvinToll@gtcGroup.com)

Field Summary
private  int intUrlSelected
          Identifies which of the descriptor document URLs were used to obtain the initial context for the instantiation of this object.
private  javax.jms.TopicConnectionFactory topicConnectionFactory
          A client uses a TopicConnectionFactory object to create TopicConnection objects with a publish/subscribe JMS provider.
 
Constructor Summary
JSlimTopicConnectionFactory(javax.jms.TopicConnectionFactory topicConnectionFactory, int intURLSelected)
          Constructor.
 
Method Summary
 javax.jms.Connection createConnection()
           
 javax.jms.Connection createConnection(java.lang.String strElementKey, java.lang.String strElementKey1)
           
 javax.jms.TopicConnection createTopicConnection()
          Creates a topic connection with the default user identity.
 javax.jms.TopicConnection createTopicConnection(java.lang.String userName, java.lang.String password)
          Creates a topic connection with the specified user identity.
 int getUrlSelected()
          Identifies which of the descriptor document URLs were used to obtain the initial context for the instantiation of this object.
private static java.lang.Object rethrowJMSException(javax.jms.JMSException e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

topicConnectionFactory

private final javax.jms.TopicConnectionFactory topicConnectionFactory
A client uses a TopicConnectionFactory object to create TopicConnection objects with a publish/subscribe JMS provider.


intUrlSelected

private final int intUrlSelected
Identifies which of the descriptor document URLs were used to obtain the initial context for the instantiation of this object.

Constructor Detail

JSlimTopicConnectionFactory

public JSlimTopicConnectionFactory(javax.jms.TopicConnectionFactory topicConnectionFactory,
                                   int intURLSelected)
Constructor.

Parameters:
topicConnectionFactory - A client uses a TopicConnectionFactory object to create TopicConnection objects with a publish/subscribe JMS provider.
intURLSelected - Identifies which of the descriptor document URLs were used to obtain the initial context for the instantiation of this object.
Method Detail

getUrlSelected

public final int getUrlSelected()
Identifies which of the descriptor document URLs were used to obtain the initial context for the instantiation of this object.

Specified by:
getUrlSelected in interface IJSlimCachable
Returns:
Which of the descriptor document URLs were used to obtain the initial context for the instantiation of this object.

createTopicConnection

public final javax.jms.TopicConnection createTopicConnection()
                                                      throws javax.jms.JMSException
Creates a topic connection with the default user identity. The connection is created in stopped mode. No messages will be delivered until the Connection.start method is explicitly called.

Specified by:
createTopicConnection in interface javax.jms.TopicConnectionFactory
Returns:
a newly created topic connection
Throws:
javax.jms.JMSException - if the JMS provider fails to create a topic connection due to some internal error.
javax.jms.JMSSecurityException - if client authentication fails due to an invalid user name or password.

createTopicConnection

public final javax.jms.TopicConnection createTopicConnection(java.lang.String userName,
                                                             java.lang.String password)
                                                      throws javax.jms.JMSException
Creates a topic connection with the specified user identity. The connection is created in stopped mode. No messages will be delivered until the Connection.start method is explicitly called.

Specified by:
createTopicConnection in interface javax.jms.TopicConnectionFactory
Parameters:
userName - the caller's user name
password - the caller's password
Returns:
a newly created topic connection
Throws:
javax.jms.JMSException - if the JMS provider fails to create a topic connection due to some internal error.
javax.jms.JMSSecurityException - if client authentication fails due to an invalid user name or password.

createConnection

public final javax.jms.Connection createConnection()
                                            throws javax.jms.JMSException
Specified by:
createConnection in interface javax.jms.ConnectionFactory
Throws:
javax.jms.JMSException

createConnection

public final javax.jms.Connection createConnection(java.lang.String strElementKey,
                                                   java.lang.String strElementKey1)
                                            throws javax.jms.JMSException
Specified by:
createConnection in interface javax.jms.ConnectionFactory
Throws:
javax.jms.JMSException

rethrowJMSException

private static java.lang.Object rethrowJMSException(javax.jms.JMSException e)
                                             throws javax.jms.JMSException
Throws:
javax.jms.JMSException

JSlim  


Copyright (c) 1999 - 2004 by Global Technology Consulting Group, Inc. at gtcGroup.com.
Use is authorized, provided the source is acknowledged by inclusion of this copyright notice.