站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 messaging API Documentation 英文版文档

SpySession (JBoss Messaging API) - JBoss 4.0.1 sp1 messaging API Documentation 英文版文档


org.jboss.mq
Class SpySession

java.lang.Object
  extended byorg.jboss.mq.SpySession
All Implemented Interfaces:
Runnable, javax.jms.Session, javax.jms.XASession
Direct Known Subclasses:
SpyQueueSession, SpyTopicSession

public class SpySession
extends Object
implements javax.jms.Session, javax.jms.XASession

This class implements javax.jms.Session and javax.jms.XASession

Version:
$Revision: 1.32.2.1 $
Author:
Norbert Lataille (Norbert.Lataille@m4x.org), Hiram Chirino (Cojonudo14@hotmail.com) @created August 16, 2001

Field Summary
protected  int acknowledgeMode
          What is the type of acknowledgement ?
 Connection connection
          The connection object to which this session is linked
protected  HashSet consumers
          MessageConsumers created by this session
protected  Object deliveryLock
          The delivery lock
protected  boolean inDelivery
          Whether we are doing asynchronous delivery
protected  HashSet producers
          MessageProducers created by this session
 boolean running
          Is this session running right now?
protected  HashSet temps
          Temporary destinations created by this session
protected  boolean transacted
          Is this session transacted ?
 
Fields inherited from interface javax.jms.Session
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, SESSION_TRANSACTED
 
Method Summary
 void close()
           
 void commit()
           
 javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue)
           
 javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue, String messageSelector)
           
 javax.jms.BytesMessage createBytesMessage()
           
 javax.jms.MessageConsumer createConsumer(javax.jms.Destination destination)
           
 javax.jms.MessageConsumer createConsumer(javax.jms.Destination destination, String messageSelector)
           
 javax.jms.MessageConsumer createConsumer(javax.jms.Destination destination, String messageSelector, boolean noLocal)
           
 javax.jms.TopicSubscriber createDurableSubscriber(javax.jms.Topic topic, String name)
           
 javax.jms.TopicSubscriber createDurableSubscriber(javax.jms.Topic topic, String name, String messageSelector, boolean noLocal)
           
 javax.jms.MapMessage createMapMessage()
           
 javax.jms.Message createMessage()
           
 javax.jms.ObjectMessage createObjectMessage()
           
 javax.jms.ObjectMessage createObjectMessage(Serializable object)
           
 javax.jms.MessageProducer createProducer(javax.jms.Destination destination)
           
 javax.jms.TopicPublisher createPublisher(javax.jms.Topic topic)
           
 javax.jms.Queue createQueue(String queueName)
           
 javax.jms.QueueReceiver createReceiver(javax.jms.Queue queue)
           
 javax.jms.QueueReceiver createReceiver(javax.jms.Queue queue, String messageSelector)
           
 javax.jms.QueueSender createSender(javax.jms.Queue queue)
           
 javax.jms.StreamMessage createStreamMessage()
           
 javax.jms.TopicSubscriber createSubscriber(javax.jms.Topic topic)
           
 javax.jms.TopicSubscriber createSubscriber(javax.jms.Topic topic, String messageSelector, boolean noLocal)
           
 javax.jms.TemporaryQueue createTemporaryQueue()
           
 javax.jms.TemporaryTopic createTemporaryTopic()
           
 javax.jms.TextMessage createTextMessage()
           
 javax.jms.TextMessage createTextMessage(String string)
           
 javax.jms.Topic createTopic(String topicName)
           
 void deleteTemporaryDestination(SpyDestination dest)
          Delete a temporary destination
 void doAcknowledge(javax.jms.Message message, AcknowledgementRequest ack)
          JMS 11.2.21.2 Note that the acknowledge method of Message acknowledges all messages received on that messages session.
 int getAcknowledgeMode()
           
 javax.jms.MessageListener getMessageListener()
           
 javax.jms.Session getSession()
           
 boolean getTransacted()
           
 XAResource getXAResource()
           
 SpyXAResourceManager getXAResourceManager()
          Retrieve the XA resource manager
 void recover()
           
 void rollback()
           
 void run()
           
 void setMessageListener(javax.jms.MessageListener listener)
           
 String toString()
           
 void unsubscribe(String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

connection

public Connection connection
The connection object to which this session is linked


running

public boolean running
Is this session running right now?


transacted

protected boolean transacted
Is this session transacted ?


acknowledgeMode

protected int acknowledgeMode
What is the type of acknowledgement ?


consumers

protected HashSet consumers
MessageConsumers created by this session


producers

protected HashSet producers
MessageProducers created by this session


temps

protected HashSet temps
Temporary destinations created by this session


deliveryLock

protected Object deliveryLock
The delivery lock


inDelivery

protected boolean inDelivery
Whether we are doing asynchronous delivery

Method Detail

doAcknowledge

public void doAcknowledge(javax.jms.Message message,
                          AcknowledgementRequest ack)
                   throws javax.jms.JMSException
JMS 11.2.21.2 Note that the acknowledge method of Message acknowledges all messages received on that messages session. JMS 11.3.2.2.3 Message.acknowledge method: Clarify that the method applies to all consumed messages of the session. Rationale for this change: A possible misinterpretation of the existing Java API documentation for Message.acknowledge assumed that only messages received prior to this message should be acknowledged. The updated Java API documentation statement emphasizes that message acknowledgement is really a session-level activity and that this message is only being used to identify the session in order to acknowledge all messages consumed by the session. The acknowledge method was placed in the message object only to enable easy access to acknowledgement capability within a message listeners onMessage method. This change aligns the specification and Java API documentation to define Message.acknowledge in the same manner.

Parameters:
message - the message to acknowledge
ack - the acknowledgement request
Throws:
javax.jms.JMSException - for any error

deleteTemporaryDestination

public void deleteTemporaryDestination(SpyDestination dest)
                                throws javax.jms.JMSException
Delete a temporary destination

Parameters:
dest - the destination
Throws:
javax.jms.JMSException - for any error

getXAResourceManager

public SpyXAResourceManager getXAResourceManager()
Retrieve the XA resource manager

Returns:
the resource manager

setMessageListener

public void setMessageListener(javax.jms.MessageListener listener)
                        throws javax.jms.JMSException
Specified by:
setMessageListener in interface javax.jms.Session
Throws:
javax.jms.JMSException

getTransacted

public boolean getTransacted()
                      throws javax.jms.JMSException
Specified by:
getTransacted in interface javax.jms.Session
Throws:
javax.jms.JMSException

getMessageListener

public javax.jms.MessageListener getMessageListener()
                                             throws javax.jms.JMSException
Specified by:
getMessageListener in interface javax.jms.Session
Throws:
javax.jms.JMSException

createBytesMessage

public javax.jms.BytesMessage createBytesMessage()
                                          throws javax.jms.JMSException
Specified by:
createBytesMessage in interface javax.jms.Session
Throws:
javax.jms.JMSException

createMapMessage

public javax.jms.MapMessage createMapMessage()
                                      throws javax.jms.JMSException
Specified by:
createMapMessage in interface javax.jms.Session
Throws:
javax.jms.JMSException

createMessage

public javax.jms.Message createMessage()
                                throws javax.jms.JMSException
Specified by:
createMessage in interface javax.jms.Session
Throws:
javax.jms.JMSException

createObjectMessage

public javax.jms.ObjectMessage createObjectMessage()
                                            throws javax.jms.JMSException
Specified by:
createObjectMessage in interface javax.jms.Session
Throws:
javax.jms.JMSException

createObjectMessage

public javax.jms.ObjectMessage createObjectMessage(Serializable object)
                                            throws javax.jms.JMSException
Specified by:
createObjectMessage in interface javax.jms.Session
Throws:
javax.jms.JMSException

createStreamMessage

public javax.jms.StreamMessage createStreamMessage()
                                            throws javax.jms.JMSException
Specified by:
createStreamMessage in interface javax.jms.Session
Throws:
javax.jms.JMSException

createTextMessage

public javax.jms.TextMessage createTextMessage()
                                        throws javax.jms.JMSException
Specified by:
createTextMessage in interface javax.jms.Session
Throws:
javax.jms.JMSException

run

public void run()
Specified by:
run in interface javax.jms.Session

close

public void close()
           throws javax.jms.JMSException
Specified by:
close in interface javax.jms.Session
Throws:
javax.jms.JMSException

commit

public void commit()
            throws javax.jms.JMSException
Specified by:
commit in interface javax.jms.Session
Throws:
javax.jms.JMSException

rollback

public void rollback()
              throws javax.jms.JMSException
Specified by:
rollback in interface javax.jms.Session
Throws:
javax.jms.JMSException

recover

public void recover()
             throws javax.jms.JMSException
Specified by:
recover in interface javax.jms.Session
Throws:
javax.jms.JMSException

createTextMessage

public javax.jms.TextMessage createTextMessage(String string)
                                        throws javax.jms.JMSException
Specified by:
createTextMessage in interface javax.jms.Session
Throws:
javax.jms.JMSException

getAcknowledgeMode

public int getAcknowledgeMode()
                       throws javax.jms.JMSException
Specified by:
getAcknowledgeMode in interface javax.jms.Session
Throws:
javax.jms.JMSException

createConsumer

public javax.jms.MessageConsumer createConsumer(javax.jms.Destination destination)
                                         throws javax.jms.JMSException
Specified by:
createConsumer in interface javax.jms.Session
Throws:
javax.jms.JMSException

createConsumer

public javax.jms.MessageConsumer createConsumer(javax.jms.Destination destination,
                                                String messageSelector)
                                         throws javax.jms.JMSException
Specified by:
createConsumer in interface javax.jms.Session
Throws:
javax.jms.JMSException

createConsumer

public javax.jms.MessageConsumer createConsumer(javax.jms.Destination destination,
                                                String messageSelector,
                                                boolean noLocal)
                                         throws javax.jms.JMSException
Specified by:
createConsumer in interface javax.jms.Session
Throws:
javax.jms.JMSException

createProducer

public javax.jms.MessageProducer createProducer(javax.jms.Destination destination)
                                         throws javax.jms.JMSException
Specified by:
createProducer in interface javax.jms.Session
Throws:
javax.jms.JMSException

createBrowser

public javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue)
                                     throws javax.jms.JMSException
Specified by:
createBrowser in interface javax.jms.Session
Throws:
javax.jms.JMSException

createBrowser

public javax.jms.QueueBrowser createBrowser(javax.jms.Queue queue,
                                            String messageSelector)
                                     throws javax.jms.JMSException
Specified by:
createBrowser in interface javax.jms.Session
Throws:
javax.jms.JMSException

createReceiver

public javax.jms.QueueReceiver createReceiver(javax.jms.Queue queue)
                                       throws javax.jms.JMSException
Throws:
javax.jms.JMSException

createReceiver

public javax.jms.QueueReceiver createReceiver(javax.jms.Queue queue,
                                              String messageSelector)
                                       throws javax.jms.JMSException
Throws:
javax.jms.JMSException

createSender

public javax.jms.QueueSender createSender(javax.jms.Queue queue)
                                   throws javax.jms.JMSException
Throws:
javax.jms.JMSException

createDurableSubscriber

public javax.jms.TopicSubscriber createDurableSubscriber(javax.jms.Topic topic,
                                                         String name)
                                                  throws javax.jms.JMSException
Specified by:
createDurableSubscriber in interface javax.jms.Session
Throws:
javax.jms.JMSException

createDurableSubscriber

public javax.jms.TopicSubscriber createDurableSubscriber(javax.jms.Topic topic,
                                                         String name,
                                                         String messageSelector,
                                                         boolean noLocal)
                                                  throws javax.jms.JMSException
Specified by:
createDurableSubscriber in interface javax.jms.Session
Throws:
javax.jms.JMSException

createSubscriber

public javax.jms.TopicSubscriber createSubscriber(javax.jms.Topic topic)
                                           throws javax.jms.JMSException
Throws:
javax.jms.JMSException

createSubscriber

public javax.jms.TopicSubscriber createSubscriber(javax.jms.Topic topic,
                                                  String messageSelector,
                                                  boolean noLocal)
                                           throws javax.jms.JMSException
Throws:
javax.jms.JMSException

createPublisher

public javax.jms.TopicPublisher createPublisher(javax.jms.Topic topic)
                                         throws javax.jms.JMSException
Throws:
javax.jms.JMSException

createQueue

public javax.jms.Queue createQueue(String queueName)
                            throws javax.jms.JMSException
Specified by:
createQueue in interface javax.jms.Session
Throws:
javax.jms.JMSException

createTopic

public javax.jms.Topic createTopic(String topicName)
                            throws javax.jms.JMSException
Specified by:
createTopic in interface javax.jms.Session
Throws:
javax.jms.JMSException

createTemporaryQueue

public javax.jms.TemporaryQueue createTemporaryQueue()
                                              throws javax.jms.JMSException
Specified by:
createTemporaryQueue in interface javax.jms.Session
Throws:
javax.jms.JMSException

createTemporaryTopic

public javax.jms.TemporaryTopic createTemporaryTopic()
                                              throws javax.jms.JMSException
Specified by:
createTemporaryTopic in interface javax.jms.Session
Throws:
javax.jms.JMSException

unsubscribe

public void unsubscribe(String name)
                 throws javax.jms.JMSException
Specified by:
unsubscribe in interface javax.jms.Session
Throws:
javax.jms.JMSException

getXAResource

public XAResource getXAResource()
Specified by:
getXAResource in interface javax.jms.XASession

getSession

public javax.jms.Session getSession()
                             throws javax.jms.JMSException
Specified by:
getSession in interface javax.jms.XASession
Throws:
javax.jms.JMSException

toString

public String toString()


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.