Source Code Cross Referenced for DiscGreeting.java in  » J2EE » JOnAS-4.8.6 » org » objectweb » jonas » discovery » 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 » J2EE » JOnAS 4.8.6 » org.objectweb.jonas.discovery 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * JOnAS: Java(TM) Open Application Server
003:         * Copyright (C) 2005 Bull S.A.
004:         * Contact: jonas-team@objectweb.org
005:         *
006:         * This library is free software; you can redistribute it and/or modify it
007:         * under the terms of the GNU Lesser General Public License as published by the
008:         * Free Software Foundation; either version 2.1 of the License, or any later
009:         * version.
010:         *
011:         * This library is distributed in the hope that it will be useful, but WITHOUT
012:         * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013:         * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
014:         * for more details.
015:         *
016:         * You should have received a copy of the GNU Lesser General Public License
017:         * along with this library; if not, write to the Free Software Foundation,
018:         * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
019:         * --------------------------------------------------------------------------
020:         * $Id: DiscGreeting.java 9358 2006-08-04 11:46:51Z durieuxp $
021:         * --------------------------------------------------------------------------
022:         */package org.objectweb.jonas.discovery;
023:
024:        /**
025:         * This class represents a special greeting message which has two uses:
026:         * 1) To act as a broadcast to the domain that a new server with a given
027:         * server name has started. It also includes a port that the server will
028:         * listen to objections at, the domain name and state set to STARTUP.
029:         * 2) To inform the newly started server that server name is already in use
030:         * by another server.
031:         *
032:         * @author Vivek Lakshmanan
033:         * @version 1.0
034:         */
035:        public class DiscGreeting extends DiscMessage {
036:            /**
037:             *
038:             */
039:            private static final long serialVersionUID = 1L;
040:            /**
041:             *
042:             */
043:            private String state = null;
044:            /**
045:             *
046:             */
047:            private String serverName = null;
048:            /**
049:             *
050:             */
051:            private String domainName = null;
052:            /**
053:             *
054:             */
055:            private String serverId = null;
056:
057:            /**
058:             * @param sourceAddress
059:             * @param sourcePort
060:             */
061:            public DiscGreeting(String sourceAddress, int sourcePort) {
062:                super (sourceAddress, sourcePort);
063:            }
064:
065:            /**
066:             * Constructor for a Discovery Greeting.
067:             * @param sourceAddress
068:             *          the host address to use to receive a response.
069:             * @param sourcePort
070:             *          is the port used in the case of a point to point response.
071:             * @param serverName
072:             *          is Jonas server name.
073:             * @param domainName
074:             *          is Jonas domain name.
075:             * @param startingUp
076:             *          is this server starting up or is it reporting back with a
077:             *          notification stating that it owns this server name?
078:             * @param serverId TODO
079:             */
080:            public DiscGreeting(String sourceAddress, int sourcePort,
081:                    String serverName, String domainName, boolean startingUp,
082:                    String serverId) {
083:                super (sourceAddress, sourcePort);
084:                this .serverName = serverName;
085:                this .domainName = domainName;
086:                this .serverId = serverId;
087:
088:                if (startingUp) {
089:                    this .state = DiscoveryState.STARTUP;
090:                } else {
091:                    this .state = DiscoveryState.DUPLICATE_NAME;
092:                }
093:
094:            }
095:
096:            /**
097:             * returns server name.
098:             *
099:             * @return serverName
100:             */
101:            public String getServerName() {
102:                return serverName;
103:            }
104:
105:            /**
106:             * returns domain name.
107:             *
108:             * @return domain name.
109:             */
110:            public String getDomainName() {
111:                return domainName;
112:            }
113:
114:            /**
115:             * sets the domain name.
116:             *
117:             * @param domainName the management domain name
118:             */
119:            public void setDomainName(String domainName) {
120:                this .domainName = domainName;
121:            }
122:
123:            /**
124:             * sets the serverName
125:             *
126:             * @param serverName the name of the server sending the discovery greeting
127:             */
128:            public void setServerName(String serverName) {
129:                this .serverName = serverName;
130:            }
131:
132:            /**
133:             * @return server state.
134:             */
135:            public String getState() {
136:                return state;
137:            }
138:
139:            /**
140:             * sets the server state : STARTINGUP or DUPLICATE_NAME.
141:             *
142:             * @param state state of the server sending the discovery greeting, one of DiscGreeting.STARTUP or DiscGreeting.DUPLICATE_NAME
143:             */
144:            public void setState(String state) {
145:                this .state = state;
146:            }
147:
148:            /**
149:             * The string version of the message
150:             * @return the message
151:             */
152:            public String toString() {
153:                String str = super .toString() + " State=" + state
154:                        + " DomainName=" + domainName + " ServerName= "
155:                        + serverName + " serverId= " + serverId;
156:                return str;
157:
158:            }
159:
160:            /**
161:             *
162:             * @return serverId
163:             */
164:            public String getServerId() {
165:                return serverId;
166:            }
167:
168:            /**
169:             * Set the serverId
170:             * @param serverId value of the serverId to set
171:             */
172:            public void setServerId(String serverId) {
173:                this.serverId = serverId;
174:            }
175:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.