Source Code Cross Referenced for SessionMessageImpl.java in  » Sevlet-Container » tomcat-cluster » org » apache » catalina » cluster » session » 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 » Sevlet Container » tomcat cluster » org.apache.catalina.cluster.session 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.apache.catalina.cluster.session;
002:
003:        import org.apache.catalina.cluster.SessionMessage;
004:        import org.apache.catalina.cluster.Member;
005:
006:        /**
007:         * <p>Title: </p>
008:         * <p>Description: </p>
009:         * <p>Copyright: Copyright (c) 2004</p>
010:         * <p>Company: </p>
011:         * @author not attributable
012:         * @version 1.0
013:         */
014:
015:        public class SessionMessageImpl implements  SessionMessage,
016:                java.io.Serializable {
017:            public SessionMessageImpl() {
018:            }
019:
020:            /*
021:
022:             * Private serializable variables to keep the messages state
023:             */
024:            private int mEvtType = -1;
025:            private byte[] mSession;
026:            private String mSessionID;
027:            private Member mSrc;
028:            private String mContextName;
029:            private long serializationTimestamp;
030:            private String uniqueId;
031:
032:            /**
033:             * Creates a session message. Depending on what event type you want this
034:             * message to represent, you populate the different parameters in the constructor<BR>
035:             * The following rules apply dependent on what event type argument you use:<BR>
036:             * <B>EVT_SESSION_CREATED</B><BR>
037:             *    The parameters: session, sessionID must be set.<BR>
038:             * <B>EVT_SESSION_EXPIRED</B><BR>
039:             *    The parameters: sessionID must be set.<BR>
040:             * <B>EVT_SESSION_ACCESSED</B><BR>
041:             *    The parameters: sessionID must be set.<BR>
042:             * <B>EVT_SESSION_EXPIRED_XXXX</B><BR>
043:             *    The parameters: sessionID must be set.<BR>
044:             * <B>EVT_ATTRIBUTE_ADDED</B><BR>
045:             *    The parameters: sessionID, attrName, attrValue must be set.<BR>
046:             * <B>EVT_ATTRIBUTE_REMOVED</B><BR>
047:             *    The parameters: sessionID, attrName must be set.<BR>
048:             * <B>EVT_SET_USER_PRINCIPAL</B><BR>
049:             *    The parameters: sessionID, principal<BR>
050:             * <B>EVT_REMOVE_SESSION_NOTE</B><BR>
051:             *    The parameters: sessionID, attrName<
052:             * <B>EVT_SET_SESSION_NOTE</B><BR>
053:             *    The parameters: sessionID, attrName, attrValue
054:             * @param eventtype - one of the 8 event type defined in this class
055:             * @param session - the serialized byte array of the session itself
056:             * @param sessionID - the id that identifies this session
057:             * @param attrName - the name of the attribute added/removed
058:             * @param attrValue - the value of the attribute added
059:
060:             */
061:            private SessionMessageImpl(String contextName, int eventtype,
062:                    byte[] session, String sessionID) {
063:                mEvtType = eventtype;
064:                mSession = session;
065:                mSessionID = sessionID;
066:                mContextName = contextName;
067:                uniqueId = sessionID;
068:            }
069:
070:            public SessionMessageImpl(String contextName, int eventtype,
071:                    byte[] session, String sessionID, String uniqueID) {
072:                this (contextName, eventtype, session, sessionID);
073:                uniqueId = uniqueID;
074:            }
075:
076:            /**
077:             * returns the event type
078:             * @return one of the event types EVT_XXXX
079:             */
080:            public int getEventType() {
081:                return mEvtType;
082:            }
083:
084:            /**
085:             * @return the serialized data for the session
086:             */
087:            public byte[] getSession() {
088:                return mSession;
089:            }
090:
091:            /**
092:             * @return the session ID for the session
093:             */
094:            public String getSessionID() {
095:                return mSessionID;
096:            }
097:
098:            /**
099:             * @return the name of the attribute
100:             */
101:            //    public String getAttributeName() { return mAttributeName; }
102:            /**
103:             * the value of the attribute
104:             */
105:            //    public Object getAttributeValue() {return mAttributeValue; }
106:            //    public SerializablePrincipal getPrincipal() { return mPrincipal;}
107:            public void setTimestamp(long time) {
108:                serializationTimestamp = time;
109:            }
110:
111:            public long getTimestamp() {
112:                return serializationTimestamp;
113:            }
114:
115:            /**
116:             * @return the event type in a string representating, useful for debugging
117:             */
118:            public String getEventTypeString() {
119:                switch (mEvtType) {
120:                case EVT_SESSION_CREATED:
121:                    return "SESSION-MODIFIED";
122:                case EVT_SESSION_EXPIRED:
123:                    return "SESSION-EXPIRED";
124:                case EVT_SESSION_ACCESSED:
125:                    return "SESSION-ACCESSED";
126:                case EVT_GET_ALL_SESSIONS:
127:                    return "SESSION-GET-ALL";
128:                case EVT_SESSION_DELTA:
129:                    return "SESSION-DELTA";
130:                case EVT_ALL_SESSION_DATA:
131:                    return "ALL-SESSION-DATA";
132:                default:
133:                    return "UNKNOWN-EVENT-TYPE";
134:                }
135:            }
136:
137:            /**
138:             * Get the address that this message originated from.  This would be set
139:             * if the message was being relayed from a host other than the one
140:             * that originally sent it.
141:             */
142:            public Member getAddress() {
143:                return this .mSrc;
144:            }
145:
146:            /**
147:             * Use this method to set the address that this message originated from.
148:             * This can be used when re-sending the EVT_GET_ALL_SESSIONS message to
149:             * another machine in the group.
150:             */
151:            public void setAddress(Member src) {
152:                this .mSrc = src;
153:            }
154:
155:            public String getContextName() {
156:                return mContextName;
157:            }
158:
159:            public String getUniqueId() {
160:                return uniqueId;
161:            }
162:
163:            public void setUniqueId(String uniqueId) {
164:                this.uniqueId = uniqueId;
165:            }
166:
167:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.