JTR 5.0 API Documentation

jtr.config.jms
Class JMSConnection

java.lang.Object
  extended by jtr.config.jms.JMSConnection
All Implemented Interfaces:
java.io.Serializable

public class JMSConnection
extends java.lang.Object
implements java.io.Serializable

This class is the object oriented representation of the connection element you can find inside the jtr.xml configuration file.
It is logically mapped to a javax.jms.Connection. A JMSConnection holds one or more JMSSessions.

Since:
1.1
Version:
5.0
Author:
Francesco Russo (frusso@dev.java.net)
See Also:
Serialized Form

Field Summary
static java.lang.String QUEUE_CONNECTION
           
static java.lang.String TOPIC_CONNECTION
           
static java.lang.String XA_QUEUE_CONNECTION
           
static java.lang.String XA_TOPIC_CONNECTION
           
 
Constructor Summary
JMSConnection()
          Default constructor.
 
Method Summary
 void addSession(JMSSession session)
          Every connection can have multiple sessions.
 java.lang.String getClientId()
          Get the clientID for the current javax.jms.Connection.
 java.lang.String getPassword()
          Get the password required to establish this javax.jms.Connection.
 java.lang.String getProperty()
          Get the name of the property of the concrete runner that will hold the actual Connection instance.
 java.util.Collection<JMSSession> getSessions()
          Returns all the configured sessions.
 java.lang.String getType()
          Get the type of the connection.
 java.lang.String getUserName()
          Get the user name required to establish this javax.jms.Connection.
static boolean isQueueConnection(JMSConnection jmsConn)
          States whether the given JMSConnection is a queue connection or not
 boolean isShared()
          Is this javax.jms.Connection shareable?
static boolean isTopicConnection(JMSConnection jmsConn)
          States whether the given JMSConnection is a topic connection or not
static boolean isXaQueueConnection(JMSConnection jmsConn)
          States whether the given JMSConnection is an XA queue connection or not
static boolean isXaTopicConnection(JMSConnection jmsConn)
          States whether the given JMSConnection is an XA topic connection or not
 void setClientId(java.lang.String cid)
          Set the clientID for the current javax.jms.Connection.
 void setPassword(java.lang.String passw)
          Set the password required to establish this javax.jms.Connection.
 void setProperty(java.lang.String property)
          Set the name of the property of the concrete runner that will hold the actual Connection instance.
 void setShared(boolean val)
          Set whether this javax.jms.Connection is shareable or not.
 void setType(java.lang.String type)
          Set the type of the connection.
 void setUserName(java.lang.String name)
          Set the user name required to establish this javax.jms.Connection.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

QUEUE_CONNECTION

public static final java.lang.String QUEUE_CONNECTION
See Also:
Constant Field Values

TOPIC_CONNECTION

public static final java.lang.String TOPIC_CONNECTION
See Also:
Constant Field Values

XA_QUEUE_CONNECTION

public static final java.lang.String XA_QUEUE_CONNECTION
See Also:
Constant Field Values

XA_TOPIC_CONNECTION

public static final java.lang.String XA_TOPIC_CONNECTION
See Also:
Constant Field Values
Constructor Detail

JMSConnection

public JMSConnection()
Default constructor.

Method Detail

setType

public void setType(java.lang.String type)
Set the type of the connection. It can be queue | topic.

Parameters:
type - One of the following two values: queue | topic

getType

public java.lang.String getType()
Get the type of the connection. It can be queue | topic.

Returns:
String One of the following two values: queue | topic

setProperty

public void setProperty(java.lang.String property)
Set the name of the property of the concrete runner that will hold the actual Connection instance.

Parameters:
property - The property

getProperty

public java.lang.String getProperty()
Get the name of the property of the concrete runner that will hold the actual Connection instance.

Returns:
String The property

setUserName

public void setUserName(java.lang.String name)
Set the user name required to establish this javax.jms.Connection.

Parameters:
name - The user name

getUserName

public java.lang.String getUserName()
Get the user name required to establish this javax.jms.Connection.

Returns:
String The user name

setPassword

public void setPassword(java.lang.String passw)
Set the password required to establish this javax.jms.Connection.

Parameters:
passw - The password

getPassword

public java.lang.String getPassword()
Get the password required to establish this javax.jms.Connection.

Returns:
String The password

setClientId

public void setClientId(java.lang.String cid)
Set the clientID for the current javax.jms.Connection.

Parameters:
cid - The clientID

getClientId

public java.lang.String getClientId()
Get the clientID for the current javax.jms.Connection.

Returns:
String The clientID

setShared

public void setShared(boolean val)
Set whether this javax.jms.Connection is shareable or not.

Parameters:
val - boolean

isShared

public boolean isShared()
Is this javax.jms.Connection shareable?

Returns:
boolean

addSession

public void addSession(JMSSession session)
Every connection can have multiple sessions. This method adds a session to the current connection.

Parameters:
session - The session

getSessions

public java.util.Collection<JMSSession> getSessions()
Returns all the configured sessions.

Returns:
Collection A Collection of JMSSessions

isQueueConnection

public static boolean isQueueConnection(JMSConnection jmsConn)
States whether the given JMSConnection is a queue connection or not

Parameters:
jmsConn - The JMSConnection to be analized
Returns:
boolean true iff it is a queue connection

isTopicConnection

public static boolean isTopicConnection(JMSConnection jmsConn)
States whether the given JMSConnection is a topic connection or not

Parameters:
jmsConn - The JMSConnection to be analized
Returns:
boolean true iff it is a topic connection

isXaQueueConnection

public static boolean isXaQueueConnection(JMSConnection jmsConn)
States whether the given JMSConnection is an XA queue connection or not

Parameters:
jmsConn - The JMSConnection to be analized
Returns:
boolean true iff it is an XA queue connection

isXaTopicConnection

public static boolean isXaTopicConnection(JMSConnection jmsConn)
States whether the given JMSConnection is an XA topic connection or not

Parameters:
jmsConn - The JMSConnection to be analized
Returns:
boolean true iff it is an XA topic connection

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

The JTR Project is licensed under GPL version 2