com.j_spaces.jms
Class GSConnectionFactoryImpl

java.lang.Object
  extended by com.j_spaces.jms.GSConnectionFactoryImpl
All Implemented Interfaces:
Serializable, Remote, ConnectionFactory, QueueConnectionFactory, TopicConnectionFactory
Direct Known Subclasses:
GSQueueConnectionFactoryImpl, GSTopicConnectionFactoryImpl, GSXAConnectionFactoryImpl

public class GSConnectionFactoryImpl
extends Object
implements ConnectionFactory, QueueConnectionFactory, TopicConnectionFactory, Serializable, Remote

Implements the javax.jms.ConnectionFactory interface.
It also in charge of the following:
- Finding a SpaceProxy according to te provided space url.
- Generating connection id's.
- Managing the gigaspaces space urls used by the jms connections.
- Create LocalTransactionManager instance.
- Creates the ParserManager for selector usage.

See Also:
Serialized Form

Constructor Summary
GSConnectionFactoryImpl(IJSpace space)
           
GSConnectionFactoryImpl(IJSpace space, IMessageConverter messageConverter)
           
GSConnectionFactoryImpl(String spaceURL, IJSpace space)
          Constructor Internal Constructor which is used by the LookupManager to bind initially the connection factory.
 
Method Summary
 Connection createConnection()
          JMS API method
 Connection createConnection(String userName, String password)
          JMS API method
 QueueConnection createQueueConnection()
           
 QueueConnection createQueueConnection(String userName, String password)
           
 TopicConnection createTopicConnection()
           
 TopicConnection createTopicConnection(String userName, String password)
           
 GSJMSAdmin getAdmin()
           
 int getCnxCounter()
           
 TransactionManager getDistributedTransactionManager()
           
 TransactionManager getLocalTransactionManager()
           
 String getSpaceURL()
           
 boolean pingSpace()
          Checks whether the space is alive and accessible.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GSConnectionFactoryImpl

public GSConnectionFactoryImpl(String spaceURL,
                               IJSpace space)
                        throws JMSException
Constructor Internal Constructor which is used by the LookupManager to bind initially the connection factory. This const mode will not initiate the LTM etc. nor find for space proxy, which be called later when the jms client calls for connection factory through the GSJMSAdmin. In that case the GSJMSAdmin will set the space URL as per client side configurations.

Parameters:
spaceURL -
logger -
connFacType -
space -
Throws:
JMSException

GSConnectionFactoryImpl

public GSConnectionFactoryImpl(IJSpace space)
                        throws JMSException
Throws:
JMSException

GSConnectionFactoryImpl

public GSConnectionFactoryImpl(IJSpace space,
                               IMessageConverter messageConverter)
                        throws JMSException
Throws:
JMSException
Method Detail

pingSpace

public boolean pingSpace()
Checks whether the space is alive and accessible.

Returns:
true if the space proxy is alive and accessible, else returns false.

getSpaceURL

public String getSpaceURL()
Returns:
String m_spaceURL

createConnection

public Connection createConnection()
                            throws JMSException
JMS API method

Specified by:
createConnection in interface ConnectionFactory
Throws:
JMSException
See Also:
ConnectionFactory.createConnection()

createConnection

public Connection createConnection(String userName,
                                   String password)
                            throws JMSException
JMS API method

Specified by:
createConnection in interface ConnectionFactory
Throws:
JMSException
See Also:
ConnectionFactory.createConnection(String, String)

getCnxCounter

public int getCnxCounter()
Returns:
cnxC the number of connections associated to this factory

getAdmin

public GSJMSAdmin getAdmin()
                    throws JMSException
Returns:
admin
Throws:
JMSException

getLocalTransactionManager

public TransactionManager getLocalTransactionManager()
                                              throws JMSException
Returns:
LocalTransactionManager ltm
Throws:
JMSException

getDistributedTransactionManager

public TransactionManager getDistributedTransactionManager()
                                                    throws JMSException
Returns:
the distributed transaction manager
Throws:
JMSException

createQueueConnection

public QueueConnection createQueueConnection()
                                      throws JMSException
Specified by:
createQueueConnection in interface QueueConnectionFactory
Throws:
JMSException
See Also:
QueueConnectionFactory.createQueueConnection()

createQueueConnection

public QueueConnection createQueueConnection(String userName,
                                             String password)
                                      throws JMSException
Specified by:
createQueueConnection in interface QueueConnectionFactory
Throws:
JMSException
See Also:
QueueConnectionFactory.createQueueConnection(String, String)

createTopicConnection

public TopicConnection createTopicConnection()
                                      throws JMSException
Specified by:
createTopicConnection in interface TopicConnectionFactory
Throws:
JMSException
See Also:
TopicConnectionFactory.createTopicConnection()

createTopicConnection

public TopicConnection createTopicConnection(String userName,
                                             String password)
                                      throws JMSException
Specified by:
createTopicConnection in interface TopicConnectionFactory
Throws:
JMSException
See Also:
TopicConnectionFactory.createTopicConnection(String, String)