Java Doc for BaseMsg.java in  » EJB-Server-JBoss-4.2.1 » messaging » org » jboss » mq » il » uil2 » msgs » 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 » EJB Server JBoss 4.2.1 » messaging » org.jboss.mq.il.uil2.msgs 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.jboss.mq.il.uil2.msgs.BaseMsg

All known Subclasses:   org.jboss.mq.il.uil2.msgs.TemporaryDestMsg,  org.jboss.mq.il.uil2.msgs.ReceiveRequestMsg,  org.jboss.mq.il.uil2.msgs.CheckIDMsg,  org.jboss.mq.il.uil2.msgs.ConnectionTokenMsg,  org.jboss.mq.il.uil2.msgs.ReceiveMsg,  org.jboss.mq.il.uil2.msgs.CreateDestMsg,  org.jboss.mq.il.uil2.msgs.TransactMsg,  org.jboss.mq.il.uil2.msgs.DeleteTemporaryDestMsg,  org.jboss.mq.il.uil2.msgs.BrowseMsg,  org.jboss.mq.il.uil2.msgs.GetIDMsg,  org.jboss.mq.il.uil2.msgs.PingMsg,  org.jboss.mq.il.uil2.msgs.CheckUserMsg,  org.jboss.mq.il.uil2.msgs.EnableConnectionMsg,  org.jboss.mq.il.uil2.msgs.AcknowledgementRequestMsg,  org.jboss.mq.il.uil2.msgs.SubscribeMsg,  org.jboss.mq.il.uil2.msgs.DeleteSubscriptionMsg,  org.jboss.mq.il.uil2.msgs.RecoverMsg,  org.jboss.mq.il.uil2.msgs.CloseMsg,  org.jboss.mq.il.uil2.msgs.UnsubscribeMsg,  org.jboss.mq.il.uil2.msgs.AddMsg,
BaseMsg
public class BaseMsg implements Runnable(Code)
The base msg class for all msgs used by the UIL2 invoker. Msgs consist of a msg type, id and exception and can operate as two way items that are sent with the request content and received with the reply content for the request. Such round-trip behavior is based on matching the request msgID with the reply msgID. The msgID parameter is segmented into value 1 to 2147483647 for client originated msgs and -1 to -2147483647 for server originated msgs.

The message is a Runnable to avoid constructing a Runnable object when asynchronously handling the message from the ReadTask.
author:
   Scott.Stark@jboss.org
author:
   Adrian.Brock@HappeningTimes.com
version:
   $Revision: 57198 $



Field Summary
public  Exceptionerror
    
public  intmsgID
    
public  intmsgType
    

Constructor Summary
public  BaseMsg(int msgType)
    
public  BaseMsg(int msgType, int msgID)
    

Method Summary
public static  BaseMsgcreateMsg(int msgType)
     Create a BaseMsg subclass based on the msgType.
public  booleanequals(Object o)
    
public  ExceptiongetError()
    
public synchronized  intgetMsgID()
     Access the msgID, initializing it if it has not been set yet.
public  intgetMsgType()
    
public  inthashCode()
    
public  voidread(ObjectInputStream in)
     Read the hasError flag and optionally the error.
public  voidrun()
    
public  voidsetError(Throwable e)
     Set an exception that should be used as the msg return value.
public  voidsetHandler(ReadTask handler)
    
public  voidsetMsgID(int msgID)
     Set the msgID.
public static  voidsetUseJMSServerMsgIDs(boolean flag)
     Set the msgID parameter range.
public static  StringtoString(int msgType)
     Translate a msgType into its string menmonic.
public  StringtoString()
    
public  voidtrimReply()
    
public  voidwrite(ObjectOutputStream out)
    

Field Detail
error
public Exception error(Code)
Any error thrown by the remote side



msgID
public int msgID(Code)
A msg id used to associated a reply with its request



msgType
public int msgType(Code)
The MsgTypes constant representing the type of the msg




Constructor Detail
BaseMsg
public BaseMsg(int msgType)(Code)



BaseMsg
public BaseMsg(int msgType, int msgID)(Code)




Method Detail
createMsg
public static BaseMsg createMsg(int msgType) throws IllegalArgumentException(Code)
Create a BaseMsg subclass based on the msgType.
Parameters:
  msgType - A MsgTypes.m_xxx constant the derived BaseMsg
throws:
  IllegalArgumentException - thrown for a msgType that does notmatch any MsgTypes.m_xxx constant



equals
public boolean equals(Object o)(Code)
Equality is based on BaseMsg.msgID
Parameters:
  o - a BaseMsg true if o.msgID == msgID



getError
public Exception getError()(Code)
Access any exception associated with the msg



getMsgID
public synchronized int getMsgID()(Code)
Access the msgID, initializing it if it has not been set yet. This is used by the SocketManager.internalSendMessage to setup the unique msgID for a request msg. the msgID value



getMsgType
public int getMsgType()(Code)



hashCode
public int hashCode()(Code)
Hash code is simply the msgID



read
public void read(ObjectInputStream in) throws IOException, ClassNotFoundException(Code)
Read the hasError flag and optionally the error. This method is not a complete analog of write because the SocketManager read task reads the msgType and msgID off of the socket.
Parameters:
  in -
throws:
  IOException -
throws:
  ClassNotFoundException -



run
public void run()(Code)



setError
public void setError(Throwable e)(Code)
Set an exception that should be used as the msg return value.
Parameters:
  e -



setHandler
public void setHandler(ReadTask handler)(Code)



setMsgID
public void setMsgID(int msgID)(Code)
Set the msgID. This is used by the SocketManager read task to populate a msg with its request ID.
Parameters:
  msgID - the msgID read off the socket



setUseJMSServerMsgIDs
public static void setUseJMSServerMsgIDs(boolean flag)(Code)
Set the msgID parameter range. If false, the msgID is segmented into the range 1 to 2147483647 and if true, the rangs is -1 to -2147483647. The JMS server sets this to true and clients default to false.
Parameters:
  flag -



toString
public static String toString(int msgType)(Code)
Translate a msgType into its string menmonic.
Parameters:
  msgType - A MsgTypes.m_xxx constant the string form of the MsgTypes.m_xxx constant



toString
public String toString()(Code)



trimReply
public void trimReply()(Code)
Trim the message when replying



write
public void write(ObjectOutputStream out) throws IOException(Code)
Write the msgType, msgID, hasError flag and optionally the error
Parameters:
  out -
throws:
  IOException -



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.