Source Code Cross Referenced for MethodDesc.java in  » J2EE » JOnAS-4.8.6 » org » objectweb » jonas_web » deployment » api » 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_web.deployment.api 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * JOnAS: Java(TM) Open Application Server
003:         * Copyright (C) 2004 Bull S.A.
004:         * Contact: jonas-team@objectweb.org
005:         *
006:         * This library is free software; you can redistribute it and/or
007:         * modify it under the terms of the GNU Lesser General Public
008:         * License as published by the Free Software Foundation; either
009:         * version 2.1 of the License, or any later version.
010:         *
011:         * This library is distributed in the hope that it will be useful,
012:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
013:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014:         * Lesser General Public License for more details.
015:         *
016:         * You should have received a copy of the GNU Lesser General Public
017:         * License along with this library; if not, write to the Free Software
018:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
019:         * USA
020:         *
021:         * Initial developer: Florent BENOIT
022:         * --------------------------------------------------------------------------
023:         * $Id: MethodDesc.java 4854 2004-06-01 11:24:01Z benoitf $
024:         * --------------------------------------------------------------------------
025:         */package org.objectweb.jonas_web.deployment.api;
026:
027:        import java.util.ArrayList;
028:        import java.util.Iterator;
029:        import java.util.List;
030:
031:        /**
032:         * Defines a Method object. It manages exclued, unchecked methods with
033:         * the right transportGuarantee. It also manages the roles which were
034:         * defined for this method
035:         * @author Florent Benoit
036:         */
037:        public class MethodDesc {
038:
039:            /**
040:             * Name of the http-method
041:             */
042:            private String name = null;
043:
044:            /**
045:             * Method excluded ?
046:             */
047:            private boolean excluded = false;
048:
049:            /**
050:             * Method unchecked (by default = yes) ?
051:             */
052:            private boolean unchecked = true;
053:
054:            /**
055:             * Transport Guarantee value(s)
056:             */
057:            private TransportGuaranteeDesc transportGuarantee;
058:
059:            /**
060:             * List of roles and transportGuarantee
061:             * key = role name
062:             * value = transport guarantee value
063:             */
064:            private List roles = null;
065:
066:            /**
067:             * Constructor
068:             * Build a Method with the right type
069:             * @param name the name of the method
070:             */
071:            public MethodDesc(String name) {
072:                this .name = name.toUpperCase();
073:                this .roles = new ArrayList();
074:                this .transportGuarantee = new TransportGuaranteeDesc();
075:            }
076:
077:            /**
078:             * Is this method excluded ?
079:             * @return true is this method is excluded, false otherwise
080:             */
081:            public boolean isExcluded() {
082:                return excluded;
083:            }
084:
085:            /**
086:             * Is this method unchecked ?
087:             * @return true is this method is unchecked, false otherwise
088:             */
089:            public boolean isUnchecked() {
090:                return unchecked;
091:            }
092:
093:            /**
094:             * Set this method excluded
095:             */
096:            public void setExcluded() {
097:                excluded = true;
098:                unchecked = false;
099:            }
100:
101:            /**
102:             * Set this method unchecked
103:             */
104:            public void setUnchecked() {
105:                excluded = false;
106:                unchecked = true;
107:            }
108:
109:            /**
110:             * Defines the transport guarantee
111:             * @param transportGuaranteeValue the value
112:             */
113:            public void addTransportGuarantee(String transportGuaranteeValue) {
114:                transportGuarantee.addTransportValue(transportGuaranteeValue);
115:            }
116:
117:            /**
118:             * Add role with its transportGuarantee to this method
119:             * @param role role to add
120:             * @param transportGuaranteeRoleValue transport guarantee for this role
121:             */
122:            public void addRole(String role, String transportGuaranteeRoleValue) {
123:                if (!roles.contains(role)) {
124:                    roles.add(role);
125:                }
126:                addTransportGuarantee(transportGuaranteeRoleValue);
127:            }
128:
129:            /**
130:             * Test if there are roles for this method
131:             * @return true if there are roles defined for this method
132:             */
133:            public boolean hasRole() {
134:                return (roles.size() > 0);
135:            }
136:
137:            /**
138:             * Gets the name of the Method
139:             * @return name of the Method
140:             */
141:            public String getName() {
142:                return name;
143:            }
144:
145:            /**
146:             * Gets iterator on roles
147:             * @return iterator on roles
148:             */
149:            public Iterator getRolesIterator() {
150:                return roles.iterator();
151:            }
152:
153:            /**
154:             * Gets the transport guarantee
155:             * @return transport guarantee
156:             */
157:            public TransportGuaranteeDesc getTransportGuarantee() {
158:                return transportGuarantee;
159:            }
160:
161:            /**
162:             * Defined the Equals method
163:             * true if it is the same name
164:             * @param other the object to test if it is equals or not
165:             * @return true if it is the same object
166:             */
167:            public boolean equals(Object other) {
168:                if (other instanceof  String) {
169:                    return name.equals(other);
170:                } else if (other instanceof  MethodDesc) {
171:                    return name.equals(((MethodDesc) other).getName());
172:                } else {
173:                    return false;
174:                }
175:            }
176:
177:            /**
178:             * Gets the hashcode for this object
179:             * @return hashcode of this object
180:             */
181:            public int hashCode() {
182:                return name.hashCode();
183:            }
184:
185:            /**
186:             * String representation
187:             * @return string representation of the pattern
188:             */
189:            public String toString() {
190:                StringBuffer sb = new StringBuffer();
191:                sb.append("Method[name=");
192:                sb.append(name);
193:                // excluded
194:                if (excluded) {
195:                    sb.append(";excluded");
196:                }
197:                // unchecked
198:                if (unchecked) {
199:                    sb.append(";unchecked");
200:                }
201:                // transportGuarantee
202:                sb.append(transportGuarantee);
203:
204:                // roles
205:                sb.append(";roles=");
206:                for (Iterator it = getRolesIterator(); it.hasNext();) {
207:                    String role = (String) it.next();
208:                    sb.append(role);
209:                }
210:                sb.append("]");
211:                return sb.toString();
212:
213:            }
214:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.