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


001:        /**********************************************************************
002:        Copyright (c) 2004 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:        Contributors:
016:        2004 Marcus Mennemeier - contributed with the class loading fix    
017:            ...
018:         **********************************************************************/package org.jpox;
019:
020:        import java.io.IOException;
021:        import java.net.URL;
022:        import java.util.Enumeration;
023:
024:        /**
025:         * Class to allow resolution and loading of classes in a persistence framework.
026:         * Implementations are to define the rules for resolving the classes. For example
027:         * JDO (used outside a J2EE container) would likely differ from EJB3 (used within
028:         * a J2EE container).
029:         * 
030:         * The search class path order is:
031:         * <ul>
032:         * <li>the primary classloader argument</li>
033:         * <li>the primary classloader (set using setPrimary and kept in ThreadLocal variable).</li>
034:         * <li>the current thread context classloader.</li>
035:         * <li>the pm classloader.</li>
036:         * <li>the registered classloader.</li> 
037:         * <li>the user registered classloader.</li> 
038:         * </ul>
039:         * @version $Revision: 1.10 $
040:         */
041:        public interface ClassLoaderResolver {
042:            /**
043:             * Class loading method, allowing specification of a primary loader. This method does not initialize the class
044:             * @param name Name of the Class to be loaded
045:             * @param primary the primary ClassLoader to use (or null)
046:             * @return The Class given the name, using the specified ClassLoader
047:             * @throws ClassNotResolvedException if the class can't be found in the classpath
048:             */
049:            public Class classForName(String name, ClassLoader primary);
050:
051:            /**
052:             * Class loading method, allowing specification of a primary loader
053:             * and whether the class should be initialised or not.
054:             * @param name Name of the Class to be loaded
055:             * @param primary the primary ClassLoader to use (or null)
056:             * @param initialize whether to initialize the class or not.
057:             * @return The Class given the name, using the specified ClassLoader
058:             * @throws ClassNotResolvedException if the class can't be found in the classpath
059:             */
060:            public Class classForName(String name, ClassLoader primary,
061:                    boolean initialize);
062:
063:            /**
064:             * Class loading method. This method does not initialize the class
065:             * @param name Name of the Class to be loaded
066:             * @return The Class given the name, using the specified ClassLoader
067:             */
068:            public Class classForName(String name);
069:
070:            /**
071:             * Class loading method, allowing for initialisation of the class.
072:             * @param name Name of the Class to be loaded
073:             * @param initialize whether to initialize the class or not.
074:             * @return The Class given the name, using the specified ClassLoader
075:             */
076:            public Class classForName(String name, boolean initialize);
077:
078:            /**
079:             * Method to test whether the type represented by the specified class_2 
080:             * parameter can be converted to the type represented by class_name_1 parameter.
081:             * @param class_name_1 Class name
082:             * @param class_2 Class to compare against
083:             * @return Whether they are assignable
084:             */
085:            public boolean isAssignableFrom(String class_name_1, Class class_2);
086:
087:            /**
088:             * Method to test whether the type represented by the specified class_name_2 
089:             * parameter can be converted to the type represented by class_1 parameter.
090:             * @param class_1 First class
091:             * @param class_name_2 Class name to compare against
092:             * @return Whether they are assignable
093:             */
094:            public boolean isAssignableFrom(Class class_1, String class_name_2);
095:
096:            /**
097:             * Method to test whether the type represented by the specified class_name_2 
098:             * parameter can be converted to the type represented by class_name_1 parameter.
099:             * @param class_name_1 Class name
100:             * @param class_name_2 Class name to compare against
101:             * @return Whether they are assignable
102:             */
103:            public boolean isAssignableFrom(String class_name_1,
104:                    String class_name_2);
105:
106:            /**
107:             * ClassLoader registered to load classes created at runtime. One ClassLoader can
108:             * be registered, and if one ClassLoader is already registered, the registered ClassLoader
109:             * is replaced by <code>loader</code>.
110:             * @param loader The ClassLoader in which classes are defined
111:             */
112:            public void registerClassLoader(ClassLoader loader);
113:
114:            /**
115:             * ClassLoader registered by users to load classes. One ClassLoader can
116:             * be registered, and if one ClassLoader is already registered, the registered ClassLoader
117:             * is replaced by <code>loader</code>.
118:             * @param loader The ClassLoader in which classes are loaded
119:             */
120:            public void registerUserClassLoader(ClassLoader loader);
121:
122:            /**
123:             * Finds all the resources with the given name.
124:             * @param resourceName the resource name. If <code>resourceName</code> starts with "/", remove it before searching.
125:             * @param primary the primary ClassLoader to use (or null)
126:             * @return An enumeration of URL objects for the resource. If no resources could be found, the enumeration will be empty. 
127:             * Resources that the class loader doesn't have access to will not be in the enumeration.
128:             * @throws IOException If I/O errors occur
129:             * @see ClassLoader#getResources(java.lang.String)
130:             */
131:            public Enumeration getResources(String resourceName,
132:                    ClassLoader primary) throws IOException;
133:
134:            /**
135:             * Finds the resource with the given name.
136:             * @param resourceName the path to resource name relative to the classloader root path. If <code>resourceName</code> starts with "/", remove it.   
137:             * @param primary the primary ClassLoader to use (or null)
138:             * @return A URL object for reading the resource, or null if the resource could not be found or the invoker doesn't have adequate privileges to get the resource. 
139:             * @throws IOException If I/O errors occur
140:             * @see ClassLoader#getResource(java.lang.String)
141:             */
142:            public URL getResource(String resourceName, ClassLoader primary);
143:
144:            /**
145:             * Sets the primary classloader for the current thread.
146:             * The primary should be kept in a ThreadLocal variable.
147:             * @param primary the primary classloader
148:             */
149:            void setPrimary(ClassLoader primary);
150:
151:            /**
152:             * Unsets the primary classloader for the current thread
153:             */
154:            void unsetPrimary();
155:
156:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.