Source Code Cross Referenced for Namespace.java in  » Net » Terracotta » com » tc » object » loaders » 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 » Terracotta » com.tc.object.loaders 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright
003:         * notice. All rights reserved.
004:         */
005:        package com.tc.object.loaders;
006:
007:        /**
008:         * Manage classloader namespaces
009:         */
010:        public class Namespace {
011:
012:            // The separator is . coz classes are generated in the server with these as a part of the package name
013:            private static final String SEP = ".";
014:
015:            // this should never be found in className or loaderDescription
016:            private static final String CLASS_NAME_LOADER_SEPARATOR = ":://::";
017:
018:            private static final String LOGICAL_CLASS_EXTENDS_SEPARATOR = "::";
019:
020:            // top level loader namespaces
021:            public static final String STANDARD_NAMESPACE = "Standard" + SEP;
022:            public static final String TOMCAT_NAMESPACE = "Tomcat" + SEP;
023:            public static final String GERONIMO_NAMESPACE = "Geronimo" + SEP;
024:            public static final String WEBLOGIC_NAMESPACE = "Weblogic" + SEP;
025:            public static final String JBOSS_NAMESPACE = "JBoss" + SEP;
026:            public static final String MODULES_NAMESPACE = "Modules" + SEP;
027:            public static final String JETTY_NAMESPACE = "Jetty" + SEP;
028:            public static final String WEBSPHERE_NAMESPACE = "Websphere" + SEP;
029:
030:            private static final String SYSTEM_LOADER_NAME = STANDARD_NAMESPACE
031:                    + "system";
032:            private static final String EXT_LOADER_NAME = STANDARD_NAMESPACE
033:                    + "ext";
034:            private static final String BOOT_LOADER_NAME = STANDARD_NAMESPACE
035:                    + "bootstrap";
036:
037:            /**
038:             * @return Normal system class loader name 
039:             */
040:            public static String getStandardSystemLoaderName() {
041:                return SYSTEM_LOADER_NAME;
042:            }
043:
044:            /**
045:             * @return Extensions class loader name
046:             */
047:            public static String getStandardExtensionsLoaderName() {
048:                return EXT_LOADER_NAME;
049:            }
050:
051:            /**
052:             * @return Boot class loader name
053:             */
054:            public static String getStandardBootstrapLoaderName() {
055:                return BOOT_LOADER_NAME;
056:            }
057:
058:            /**
059:             * @return Separator between loader and class name
060:             */
061:            public static String getClassNameAndLoaderSeparator() {
062:                return CLASS_NAME_LOADER_SEPARATOR;
063:            }
064:
065:            /**
066:             * @return Separator in logical class extension
067:             */
068:            public static String getLogicalClassExtendsSeparator() {
069:                return LOGICAL_CLASS_EXTENDS_SEPARATOR;
070:            }
071:
072:            /**
073:             * Create logical extending class name by combining class names
074:             * @param className Class name
075:             * @param superClassName Logical super class name
076:             */
077:            public static String createLogicalExtendingClassName(
078:                    String className, String super ClassName) {
079:                return className + LOGICAL_CLASS_EXTENDS_SEPARATOR
080:                        + super ClassName;
081:            }
082:
083:            /**
084:             * Parse class name out of logical extending class name
085:             * @param className Logical extending name, as returned by {@link #createLogicalExtendingClassName(String, String)}
086:             * @return Extending class name
087:             */
088:            public static String parseClassNameIfNecessary(String className) {
089:                int separatorIndex = className
090:                        .indexOf(LOGICAL_CLASS_EXTENDS_SEPARATOR);
091:                if (separatorIndex == -1) {
092:                    return className;
093:                }
094:                return className.substring(0, separatorIndex);
095:            }
096:
097:            /**
098:             * Parse super class name out of logical extending class name
099:             * @param className Logical extending name, as returned by {@link #createLogicalExtendingClassName(String, String)}
100:             * @return Logical super class name
101:             */
102:            public static String parseLogicalNameIfNeceesary(String className) {
103:                int separatorIndex = className
104:                        .indexOf(LOGICAL_CLASS_EXTENDS_SEPARATOR);
105:                if (separatorIndex == -1) {
106:                    return null;
107:                }
108:                return className.substring(separatorIndex
109:                        + LOGICAL_CLASS_EXTENDS_SEPARATOR.length());
110:            }
111:
112:            /**
113:             * Create a loader name based on a toplevel loader name and a subname
114:             * @param topLevel Top level name
115:             * @param subName Sub level name
116:             * @return Classloader name
117:             */
118:            public static String createLoaderName(String topLevel,
119:                    String subName) {
120:                if (topLevel == null) {
121:                    throw new IllegalArgumentException("topLevel space is null");
122:                }
123:                if (subName == null) {
124:                    throw new IllegalArgumentException("subName is null");
125:                }
126:
127:                if (topLevel.equals(TOMCAT_NAMESPACE)
128:                        || topLevel.equals(WEBLOGIC_NAMESPACE)
129:                        || topLevel.equals(GERONIMO_NAMESPACE)
130:                        || topLevel.equals(JBOSS_NAMESPACE)
131:                        || topLevel.equals(MODULES_NAMESPACE)
132:                        || topLevel.equals(JETTY_NAMESPACE)
133:                        || topLevel.equals(WEBSPHERE_NAMESPACE)) {
134:                    // this check will probably need to evolve over time, it's obviously not fancy enough yet
135:                    return new StringBuffer(topLevel).append(subName)
136:                            .toString();
137:                }
138:
139:                throw new IllegalArgumentException(
140:                        "Invalid top level namespace: " + topLevel);
141:            }
142:
143:            private Namespace() {
144:                //
145:            }
146:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.