Source Code Cross Referenced for ProtocolData.java in  » Net » JGroups-2.4.1-sp3 » org » jgroups » conf » 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 » Net » JGroups 2.4.1 sp3 » org.jgroups.conf 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.jgroups.conf;
002:
003:        /**
004:         * Data holder for protocol
005:         * @author Filip Hanik (<a href="mailto:filip@filip.net">filip@filip.net)
006:         * @version $Id: ProtocolData.java,v 1.7 2006/08/15 05:50:06 belaban Exp $
007:         */
008:
009:        import java.util.HashMap;
010:        import java.util.Iterator;
011:
012:        public class ProtocolData {
013:            /** Map<String,ProtocolParameter> of property keys and values */
014:            private final HashMap mParameters = new HashMap();
015:            private final String mProtocolName;
016:            private final String mDescription;
017:            private final String mClassName;
018:            private boolean mIsOverRide = false;
019:
020:            public ProtocolData(String protocolName, String description,
021:                    String className, ProtocolParameter[] params) {
022:                mProtocolName = protocolName;
023:                mDescription = description;
024:                mClassName = className;
025:                if (params != null) {
026:                    for (int i = 0; i < params.length; i++) {
027:                        mParameters.put(params[i].getName(), params[i]);
028:                    }
029:                }
030:            }
031:
032:            public ProtocolData(String overRideName, ProtocolParameter[] params) {
033:                this (overRideName, null, null, params);
034:                mIsOverRide = true;
035:
036:            }
037:
038:            public String getClassName() {
039:                return mClassName;
040:            }
041:
042:            public String getProtocolName() {
043:                return mProtocolName;
044:            }
045:
046:            public String getDescription() {
047:                return mDescription;
048:            }
049:
050:            public HashMap getParameters() {
051:                return mParameters;
052:            }
053:
054:            public boolean isOverride() {
055:                return mIsOverRide;
056:            }
057:
058:            public ProtocolParameter[] getParametersAsArray() {
059:                ProtocolParameter[] result = new ProtocolParameter[mParameters
060:                        .size()];
061:                Iterator it = mParameters.keySet().iterator();
062:                for (int i = 0; i < result.length; i++) {
063:                    String key = (String) it.next();
064:                    result[i] = (ProtocolParameter) mParameters.get(key);
065:                }
066:                return result;
067:            }
068:
069:            public void override(ProtocolParameter[] params) {
070:                for (int i = 0; i < params.length; i++)
071:                    mParameters.put(params[i].getName(), params[i]);
072:            }
073:
074:            public String getProtocolString(boolean new_format) {
075:                return new_format ? getProtocolStringNewXml()
076:                        : getProtocolString();
077:            }
078:
079:            public String getProtocolString() {
080:                StringBuffer buf = new StringBuffer(mClassName);
081:                if (mParameters.size() > 0) {
082:                    buf.append('(');
083:                    Iterator i = mParameters.keySet().iterator();
084:                    while (i.hasNext()) {
085:                        String key = (String) i.next();
086:                        ProtocolParameter param = (ProtocolParameter) mParameters
087:                                .get(key);
088:                        buf.append(param.getParameterString());
089:                        if (i.hasNext())
090:                            buf.append(';');
091:                    }//while
092:                    buf.append(')');
093:                }
094:                return buf.toString();
095:            }
096:
097:            public String getProtocolStringNewXml() {
098:                StringBuffer buf = new StringBuffer(mClassName + ' ');
099:                if (mParameters.size() > 0) {
100:                    Iterator i = mParameters.keySet().iterator();
101:                    while (i.hasNext()) {
102:                        String key = (String) i.next();
103:                        ProtocolParameter param = (ProtocolParameter) mParameters
104:                                .get(key);
105:                        buf.append(param.getParameterStringXml());
106:                        if (i.hasNext())
107:                            buf.append(' ');
108:                    }
109:                }
110:                return buf.toString();
111:            }
112:
113:            public int hashCode() {
114:                return mProtocolName.hashCode();
115:            }
116:
117:            public boolean equals(Object another) {
118:                if (another instanceof  ProtocolData)
119:                    return getProtocolName().equals(
120:                            ((ProtocolData) another).getProtocolName());
121:                else
122:                    return false;
123:            }
124:
125:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.