Source Code Cross Referenced for Bundle.java in  » Database-ORM » JPOX » org » jpox » plugin » 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 » Database ORM » JPOX » org.jpox.plugin 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**********************************************************************
002:        Copyright (c) 2006 Erik Bengtson and others. All rights reserved.
003:        Licensed under the Apache License, Version 2.0 (the "License");
004:        you may not use this file except in compliance with the License.
005:        You may obtain a copy of the License at
006:
007:            http://www.apache.org/licenses/LICENSE-2.0
008:
009:        Unless required by applicable law or agreed to in writing, software
010:        distributed under the License is distributed on an "AS IS" BASIS,
011:        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012:        See the License for the specific language governing permissions and
013:        limitations under the License.
014:         
015:
016:        Contributors:
017:            ...
018:         **********************************************************************/package org.jpox.plugin;
019:
020:        import java.net.URL;
021:        import java.util.HashMap;
022:        import java.util.List;
023:        import java.util.Map;
024:
025:        /**
026:         * A Plug-in (OSGi Bundle) definition. Represents the XML declaration
027:         * @version $Revision: 1.3 $
028:         */
029:        public class Bundle {
030:            /** unique id - bundle symbolic name * */
031:            final private String symbolicName;
032:
033:            /** vendor name * */
034:            final private String vendorName;
035:
036:            /** name * */
037:            final private String name;
038:
039:            /** plugin version * */
040:            final private String version;
041:
042:            /** location of the manifest.mf file * */
043:            final private URL manifestLocation;
044:
045:            /** Set of BundleDescription objects representing Require-Bundle entries **/
046:            private List requireBundle;
047:
048:            /**
049:             * Constructor
050:             * @param symbolicName the unique id - bundle symbolic name
051:             * @param name the name
052:             * @param vendorName the vendor name
053:             * @param version the version number
054:             * @param manifestLocation the path to the declaration file
055:             */
056:            public Bundle(String symbolicName, String name, String vendorName,
057:                    String version, URL manifestLocation) {
058:                this .symbolicName = symbolicName;
059:                this .name = name;
060:                this .vendorName = vendorName;
061:                this .version = version;
062:                this .manifestLocation = manifestLocation;
063:            }
064:
065:            /**
066:             * Accessor for the plug-in id - bundle symbolic name
067:             * @return id of the plug-in
068:             */
069:            public String getSymbolicName() {
070:                return symbolicName;
071:            }
072:
073:            /**
074:             * Accessor for the provider name of this plug-in
075:             * @return provider name
076:             */
077:            public String getVendorName() {
078:                return vendorName;
079:            }
080:
081:            /**
082:             * Acessor for the version of this plug-in
083:             * @return version
084:             */
085:            public String getVersion() {
086:                return version;
087:            }
088:
089:            /**
090:             * Acessor for the location of the manifest.mf file
091:             * @return the manifest.mf location
092:             */
093:            public URL getManifestLocation() {
094:                return manifestLocation;
095:            }
096:
097:            /**
098:             * Acessor for the plug-in name
099:             * @return plug-in name
100:             */
101:            public String getName() {
102:                return name;
103:            }
104:
105:            /**
106:             * Acessor for the RequireBundle.
107:             * @param requireBundle A List of {@link Bundle.BundleDescription} elements
108:             */
109:            public void setRequireBundle(List requireBundle) {
110:                this .requireBundle = requireBundle;
111:            }
112:
113:            /**
114:             * Acessor for the RequireBundle
115:             * @return A List of {@link Bundle.BundleDescription} elements
116:             */
117:            public List getRequireBundle() {
118:                return requireBundle;
119:            }
120:
121:            /**
122:             * Description of bundles
123:             * bundle-description = symbolic-name (';' parameter )*
124:             * 
125:             * See OSGI 3.0 $ 1.4.2
126:             * 
127:             */
128:            public static class BundleDescription {
129:                private String bundleSymbolicName;
130:
131:                /**
132:                 * List of parameters for the BundleDescription
133:                 */
134:                private Map parameters = new HashMap();
135:
136:                public String getBundleSymbolicName() {
137:                    return bundleSymbolicName;
138:                }
139:
140:                public void setBundleSymbolicName(String bundleSymbolicName) {
141:                    this .bundleSymbolicName = bundleSymbolicName;
142:                }
143:
144:                public String getParameter(String name) {
145:                    return (String) parameters.get(name);
146:                }
147:
148:                public void setParameter(String name, String value) {
149:                    parameters.put(name, value);
150:                }
151:
152:                public void setParameters(Map parameters) {
153:                    this .parameters.putAll(parameters);
154:                }
155:
156:                public String toString() {
157:                    return "BundleDescription [Symbolic Name] "
158:                            + bundleSymbolicName + " [Parameters] "
159:                            + parameters;
160:                }
161:            }
162:
163:            /**
164:             * Bundle Version - according to OSGi spec 3.0 §3.2.4
165:             */
166:            public static class BundleVersion {
167:                public int major;
168:                public int minor;
169:                public int micro;
170:                public String qualifier = "";
171:
172:                public int compareTo(Object object) {
173:                    if (object == this ) {
174:                        return 0;
175:                    }
176:                    BundleVersion other = (BundleVersion) object;
177:                    int result = major - other.major;
178:                    if (result != 0) {
179:                        return result;
180:                    }
181:                    result = minor - other.minor;
182:                    if (result != 0) {
183:                        return result;
184:                    }
185:                    result = micro - other.micro;
186:                    if (result != 0) {
187:                        return result;
188:                    } else {
189:                        return qualifier.compareTo(other.qualifier);
190:                    }
191:                }
192:
193:                public String toString() {
194:                    return "" + major + "." + minor + "." + micro
195:                            + (qualifier.length() > 0 ? "." + qualifier : "");
196:                }
197:            }
198:
199:            /**
200:             * Bundle Range - according to OSGi spec 3.0 §3.2.5
201:             */
202:            public static class BundleVersionRange {
203:                public BundleVersion floor;
204:                public BundleVersion ceiling;
205:                public boolean floor_inclusive = true;
206:                public boolean ceiling_inclusive = false;
207:
208:                public String toString() {
209:                    return "Bundle VersionRange [Floor] " + floor
210:                            + " inclusive:" + floor_inclusive + " [Ceiling] "
211:                            + ceiling + " inclusive:" + ceiling_inclusive;
212:                }
213:            }
214:
215:            public String toString() {
216:                return "Bundle [Symbolic Name]" + symbolicName + " [Version] "
217:                        + version;
218:            }
219:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.