Java Doc for MockSession.java in  » Testing » mockrunner-0.4 » com » mockrunner » mock » jms » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Testing » mockrunner 0.4 » com.mockrunner.mock.jms 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.mockrunner.mock.jms.MockSession

All known Subclasses:   com.mockrunner.mock.jms.MockTopicSession,  com.mockrunner.mock.jms.MockQueueSession,
MockSession
public class MockSession implements Session(Code)
Mock implementation of JMS Session. Please note that this implementation does not implement transaction isolation at the moment. Messages are immediately sent. If acknowledge mode is AUTO_ACKNOWLEDGE or DUPS_OK_ACKNOWLEDGE, the message will be automatically acknowledged, otherwise, it will not be acknowledged. According to JMS specification, the acknowledged mode must be ignored for transacted sessions. This is currently not implemented, i.e. transacted sessions behave like sessions with acknowledge mode AUTO_ACKNOWLEDGE. Messages are acknowledged even if the transaction is rolled back. However, the framework keeps track if a transaction is committed or rolled back, so you can test this and rely on the container for the rest. You can set a MessageListener directly to the session. This is an application server internal feature and not meant for application use in JMS. This mock session dispatches any message of any known Queue and Topic to the distinguished MessageListener, if such a MessageListener is registered.



Constructor Summary
public  MockSession(MockConnection connection, boolean transacted, int acknowledgeMode)
    

Method Summary
public  voidaddSessionToQueue(Queue queue)
    
public  voidaddSessionToTopic(Topic topic)
    
public  voidclose()
    
public  voidcommit()
    
public  QueueBrowsercreateBrowser(Queue queue)
    
public  QueueBrowsercreateBrowser(Queue queue, String messageSelector)
    
public  BytesMessagecreateBytesMessage()
    
public  MessageConsumercreateConsumer(Destination destination)
    
public  MessageConsumercreateConsumer(Destination destination, String messageSelector)
    
public  MessageConsumercreateConsumer(Destination destination, String messageSelector, boolean noLocal)
    
public  TopicSubscribercreateDurableSubscriber(Topic topic, String name)
    
public  TopicSubscribercreateDurableSubscriber(Topic topic, String name, String messageSelector, boolean noLocal)
    
public  MapMessagecreateMapMessage()
    
public  MessagecreateMessage()
    
public  ObjectMessagecreateObjectMessage()
    
public  ObjectMessagecreateObjectMessage(Serializable object)
    
public  MessageProducercreateProducer(Destination destination)
    
protected  MessageProducercreateProducerForNullDestination()
    
public  QueuecreateQueue(String name)
    
public  StreamMessagecreateStreamMessage()
    
public  TemporaryQueuecreateTemporaryQueue()
    
public  TemporaryTopiccreateTemporaryTopic()
    
public  TextMessagecreateTextMessage()
    
public  TextMessagecreateTextMessage(String text)
    
public  TopiccreateTopic(String name)
    
public  intgetAcknowledgeMode()
     Note: Returns 0 if the session is transacted. This method does not exist in JMS 1.0.2.
protected  MockConnectiongetConnection()
    
public  GenericTransmissionManagergetGenericTransmissionManager()
     Returns the com.mockrunner.jms.GenericTransmissionManager .
public  MessageListenergetMessageListener()
    
public  MessageManagergetMessageManager()
     Returns the MessageManager for this session.
public  intgetNumberCommits()
     Returns the number of commits.
public  intgetNumberRollbacks()
     Returns the number of rollbacks.
public  QueueTransmissionManagergetQueueTransmissionManager()
     Returns the com.mockrunner.jms.QueueTransmissionManager .
public  MockTemporaryQueuegetTemporaryQueue(int index)
     Returns a TemporaryQueue by its index.
public  ListgetTemporaryQueueList()
     Returns the list of temporary queues.
public  MockTemporaryTopicgetTemporaryTopic(int index)
     Returns a TemporaryTopic by its index.
public  ListgetTemporaryTopicList()
     Returns the list of temporary topics.
public  TopicTransmissionManagergetTopicTransmissionManager()
     Returns the com.mockrunner.jms.TopicTransmissionManager .
public  booleangetTransacted()
    
public  TransmissionManagerWrappergetTransmissionManager()
    
public  TransmissionManagerWrappergetTransmissionManagerWrapper()
     Returns the com.mockrunner.jms.TransmissionManagerWrapper .
public  booleanisAutoAcknowledge()
     Returns if messages should be automatically acknowledged, i.e.
public  booleanisClosed()
     Returns if this session was closed.
public  booleanisCommitted()
     Returns if the current transaction was committed.
public  booleanisRecovered()
     Returns if this session was recovered.
public  booleanisRolledBack()
     Returns if the current transaction was rolled back.
public  voidrecover()
    
public  voidrollback()
    
public  voidrun()
    
public  voidsetMessageListener(MessageListener messageListener)
    
public  voidunsubscribe(String name)
    


Constructor Detail
MockSession
public MockSession(MockConnection connection, boolean transacted, int acknowledgeMode)(Code)




Method Detail
addSessionToQueue
public void addSessionToQueue(Queue queue)(Code)



addSessionToTopic
public void addSessionToTopic(Topic topic)(Code)



close
public void close() throws JMSException(Code)



commit
public void commit() throws JMSException(Code)



createBrowser
public QueueBrowser createBrowser(Queue queue) throws JMSException(Code)



createBrowser
public QueueBrowser createBrowser(Queue queue, String messageSelector) throws JMSException(Code)



createBytesMessage
public BytesMessage createBytesMessage() throws JMSException(Code)



createConsumer
public MessageConsumer createConsumer(Destination destination) throws JMSException(Code)



createConsumer
public MessageConsumer createConsumer(Destination destination, String messageSelector) throws JMSException(Code)



createConsumer
public MessageConsumer createConsumer(Destination destination, String messageSelector, boolean noLocal) throws JMSException(Code)



createDurableSubscriber
public TopicSubscriber createDurableSubscriber(Topic topic, String name) throws JMSException(Code)



createDurableSubscriber
public TopicSubscriber createDurableSubscriber(Topic topic, String name, String messageSelector, boolean noLocal) throws JMSException(Code)



createMapMessage
public MapMessage createMapMessage() throws JMSException(Code)



createMessage
public Message createMessage() throws JMSException(Code)



createObjectMessage
public ObjectMessage createObjectMessage() throws JMSException(Code)



createObjectMessage
public ObjectMessage createObjectMessage(Serializable object) throws JMSException(Code)



createProducer
public MessageProducer createProducer(Destination destination) throws JMSException(Code)



createProducerForNullDestination
protected MessageProducer createProducerForNullDestination()(Code)



createQueue
public Queue createQueue(String name) throws JMSException(Code)



createStreamMessage
public StreamMessage createStreamMessage() throws JMSException(Code)



createTemporaryQueue
public TemporaryQueue createTemporaryQueue() throws JMSException(Code)



createTemporaryTopic
public TemporaryTopic createTemporaryTopic() throws JMSException(Code)



createTextMessage
public TextMessage createTextMessage() throws JMSException(Code)



createTextMessage
public TextMessage createTextMessage(String text) throws JMSException(Code)



createTopic
public Topic createTopic(String name) throws JMSException(Code)



getAcknowledgeMode
public int getAcknowledgeMode() throws JMSException(Code)
Note: Returns 0 if the session is transacted. This method does not exist in JMS 1.0.2. In JMS 1.1 it should return Session.SESSION_TRANSACTED which is specified as 0. In order to avoid different versions for JMS 1.0.2 and 1.1 (Session.SESSION_TRANSACTED does not exist in 1.0.2) this method returns hardcoded 0, if the session is transacted. the acknowledge mode



getConnection
protected MockConnection getConnection()(Code)



getGenericTransmissionManager
public GenericTransmissionManager getGenericTransmissionManager()(Code)
Returns the com.mockrunner.jms.GenericTransmissionManager . the com.mockrunner.jms.GenericTransmissionManager



getMessageListener
public MessageListener getMessageListener() throws JMSException(Code)



getMessageManager
public MessageManager getMessageManager()(Code)
Returns the MessageManager for this session. the MessageManager



getNumberCommits
public int getNumberCommits()(Code)
Returns the number of commits. the number of commits



getNumberRollbacks
public int getNumberRollbacks()(Code)
Returns the number of rollbacks. the number of rollbacks



getQueueTransmissionManager
public QueueTransmissionManager getQueueTransmissionManager()(Code)
Returns the com.mockrunner.jms.QueueTransmissionManager . the com.mockrunner.jms.QueueTransmissionManager



getTemporaryQueue
public MockTemporaryQueue getTemporaryQueue(int index)(Code)
Returns a TemporaryQueue by its index. The index represent the number of the queue. Returns null if no such TemporaryQueue is present.
Parameters:
  index - the index the TemporaryQueue



getTemporaryQueueList
public List getTemporaryQueueList()(Code)
Returns the list of temporary queues. the TemporaryQueue list



getTemporaryTopic
public MockTemporaryTopic getTemporaryTopic(int index)(Code)
Returns a TemporaryTopic by its index. The index represent the number of the topic. Returns null if no such TemporaryTopic is present.
Parameters:
  index - the index the TemporaryTopic



getTemporaryTopicList
public List getTemporaryTopicList()(Code)
Returns the list of temporary topics. the TemporaryTopic list



getTopicTransmissionManager
public TopicTransmissionManager getTopicTransmissionManager()(Code)
Returns the com.mockrunner.jms.TopicTransmissionManager . the com.mockrunner.jms.TopicTransmissionManager



getTransacted
public boolean getTransacted() throws JMSException(Code)



getTransmissionManager
public TransmissionManagerWrapper getTransmissionManager()(Code)
MockSession.getTransmissionManagerWrapper



getTransmissionManagerWrapper
public TransmissionManagerWrapper getTransmissionManagerWrapper()(Code)
Returns the com.mockrunner.jms.TransmissionManagerWrapper . the com.mockrunner.jms.TransmissionManagerWrapper



isAutoAcknowledge
public boolean isAutoAcknowledge()(Code)
Returns if messages should be automatically acknowledged, i.e. if the acknowledge mode is not CLIENT_ACKNOWLEDGE. true if messages are automatically acknowledged



isClosed
public boolean isClosed()(Code)
Returns if this session was closed. true if this session is closed



isCommitted
public boolean isCommitted()(Code)
Returns if the current transaction was committed. true if the transaction was committed



isRecovered
public boolean isRecovered()(Code)
Returns if this session was recovered. true if this session was recovered



isRolledBack
public boolean isRolledBack()(Code)
Returns if the current transaction was rolled back. true if the transaction was rolled back



recover
public void recover() throws JMSException(Code)



rollback
public void rollback() throws JMSException(Code)



run
public void run()(Code)



setMessageListener
public void setMessageListener(MessageListener messageListener) throws JMSException(Code)



unsubscribe
public void unsubscribe(String name) throws JMSException(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.