| Constructor: |
public SpyConnection(GenericConnectionFactory gcf) throws JMSException {
super(gcf);
}
Create a new SpyConnection Parameters:
gcf - the constructing class
Throws:
JMSException - for any error
|
public SpyConnection(int type,
GenericConnectionFactory gcf) throws JMSException {
super(gcf);
this.type = type;
}
Create a new SpyConnection Parameters:
type - the type of connection
gcf - the constructing class
Throws:
JMSException - for any error
|
public SpyConnection(String userId,
String password,
GenericConnectionFactory gcf) throws JMSException {
super(userId, password, gcf);
}
Create a new SpyConnection Parameters:
userId - the user
password - the password
gcf - the constructing class
Throws:
JMSException - for any error
|
public SpyConnection(int type,
String userId,
String password,
GenericConnectionFactory gcf) throws JMSException {
super(userId, password, gcf);
this.type = type;
}
Create a new SpyConnection Parameters:
type - the type of connection
userId - the user
password - the password
gcf - the constructing class
Throws:
JMSException - for any error
|
| Method from org.jboss.mq.SpyConnection Detail: |
public ConnectionConsumer createConnectionConsumer(Destination destination,
String messageSelector,
ServerSessionPool sessionPool,
int maxMessages) throws JMSException {
checkClosed();
if (destination == null)
throw new InvalidDestinationException("Null destination");
checkTemporary(destination);
return new SpyConnectionConsumer(this, destination, messageSelector, sessionPool, maxMessages);
}
|
public ConnectionConsumer createConnectionConsumer(Topic topic,
String messageSelector,
ServerSessionPool sessionPool,
int maxMessages) throws JMSException {
checkClosed();
if (type == QUEUE)
throw new IllegalStateException("Cannot create a topic consumer on a QueueConnection");
if (topic == null)
throw new InvalidDestinationException("Null topic");
checkClientID();
checkTemporary(topic);
return new SpyConnectionConsumer(this, topic, messageSelector, sessionPool, maxMessages);
}
|
public ConnectionConsumer createConnectionConsumer(Queue queue,
String messageSelector,
ServerSessionPool sessionPool,
int maxMessages) throws JMSException {
checkClosed();
if (type == TOPIC)
throw new IllegalStateException("Cannot create a queue consumer on a TopicConnection");
if (queue == null)
throw new InvalidDestinationException("Null queue");
checkTemporary(queue);
return new SpyConnectionConsumer(this, queue, messageSelector, sessionPool, maxMessages);
}
|
public ConnectionConsumer createDurableConnectionConsumer(Topic topic,
String subscriptionName,
String messageSelector,
ServerSessionPool sessionPool,
int maxMessages) throws JMSException {
checkClosed();
if (type == QUEUE)
throw new IllegalStateException("Cannot create a topic consumer on a QueueConnection");
if (topic == null)
throw new InvalidDestinationException("Null topic");
if (topic instanceof TemporaryTopic)
throw new InvalidDestinationException("Attempt to create a durable subscription for a temporary topic");
if (subscriptionName == null || subscriptionName.trim().length() == 0)
throw new JMSException("Null or empty subscription");
SpyTopic t = new SpyTopic((SpyTopic) topic, getClientID(), subscriptionName, messageSelector);
return new SpyConnectionConsumer(this, t, messageSelector, sessionPool, maxMessages);
}
|
Queue createQueue(String name) throws JMSException {
checkClosed();
checkClientID();
try
{
return serverIL.createQueue(connectionToken, name);
}
catch (Throwable t)
{
SpyJMSException.rethrowAsJMSException("Cannot get the Queue from the provider", t);
throw new UnreachableStatementException();
}
}
|
public QueueSession createQueueSession(boolean transacted,
int acknowledgeMode) throws JMSException {
checkClosed();
checkClientID();
if (transacted)
acknowledgeMode = 0;
QueueSession session = new SpyQueueSession(this, transacted, acknowledgeMode);
//add the new session to the createdSessions list
synchronized (createdSessions)
{
createdSessions.add(session);
}
return session;
}
|
public Session createSession(boolean transacted,
int acknowledgeMode) throws JMSException {
checkClosed();
checkClientID();
if (transacted)
acknowledgeMode = 0;
Session session = new SpySession(this, transacted, acknowledgeMode, false);
//add the new session to the createdSessions list
synchronized (createdSessions)
{
createdSessions.add(session);
}
return session;
}
|
Topic createTopic(String name) throws JMSException {
checkClosed();
checkClientID();
try
{
return serverIL.createTopic(connectionToken, name);
}
catch (Throwable t)
{
SpyJMSException.rethrowAsJMSException("Cannot get the Topic from the provider", t);
throw new UnreachableStatementException();
}
}
|
public TopicSession createTopicSession(boolean transacted,
int acknowledgeMode) throws JMSException {
checkClosed();
checkClientID();
if (transacted)
acknowledgeMode = 0;
TopicSession session = new SpyTopicSession(this, transacted, acknowledgeMode);
//add the new session to the createdSessions list
synchronized (createdSessions)
{
createdSessions.add(session);
}
return session;
}
|
TemporaryQueue getTemporaryQueue() throws JMSException {
checkClosed();
checkClientID();
try
{
SpyTemporaryQueue temp = (SpyTemporaryQueue) serverIL.getTemporaryQueue(connectionToken);
temp.setConnection(this);
synchronized (temps)
{
temps.add(temp);
}
return temp;
}
catch (Throwable t)
{
SpyJMSException.rethrowAsJMSException("Cannot create a Temporary Queue", t);
throw new UnreachableStatementException();
}
}
|
TemporaryTopic getTemporaryTopic() throws JMSException {
checkClosed();
checkClientID();
try
{
SpyTemporaryTopic temp = (SpyTemporaryTopic) serverIL.getTemporaryTopic(connectionToken);
temp.setConnection(this);
synchronized (temps)
{
temps.add(temp);
}
return temp;
}
catch (Throwable t)
{
SpyJMSException.rethrowAsJMSException("Cannot create a Temporary Topic", t);
throw new UnreachableStatementException();
}
}
|