Source Code Cross Referenced for SlideAccess.java in  » Content-Management-System » hippo » org » apache » slide » common » 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 » Content Management System » hippo » org.apache.slide.common 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2004 Hippo Webworks.
003:         * 
004:         * Licensed under the Apache License, Version 2.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         * 
008:         *      http://www.apache.org/licenses/LICENSE-2.0
009:         * 
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         */
016:        package org.apache.slide.common;
017:
018:        import java.util.HashMap;
019:        import java.util.Hashtable;
020:        import java.util.Iterator;
021:        import java.util.Map;
022:        import java.util.Set;
023:
024:        import org.apache.slide.util.conf.Configuration;
025:        import org.apache.slide.util.logger.Logger;
026:
027:        /**
028:         * Utility class for accessing Slide package protected members.
029:         * Replaces EmbeddedDomain.
030:         * 
031:         * @author <a href="mailto:unico@hippo.nl">Unico Hommes</a>
032:         */
033:        public class SlideAccess {
034:
035:            private final Map m_namespaces = new HashMap();
036:
037:            public SlideAccess() {
038:            }
039:
040:            /**
041:             * Get the number of namespaces.
042:             * 
043:             * @return the number of namespaces.
044:             */
045:            public int getNumberOfNamespaces() {
046:                return m_namespaces.size();
047:            }
048:
049:            /**
050:             * Get the NamespaceAccessToken by name.
051:             * 
052:             * @param name  the namespace name.
053:             * @return  the access token for the namespace.
054:             */
055:            public NamespaceAccessToken getNamespaceToken(String name) {
056:                Namespace namespace = (Namespace) m_namespaces.get(name);
057:                if (namespace != null) {
058:                    return new NamespaceAccessTokenImpl(namespace);
059:                }
060:                return null;
061:            }
062:
063:            /**
064:             * Get the Namespace by name.
065:             * 
066:             * @param name  the namespace name.
067:             * @return  the namespace.
068:             */
069:            public Namespace getNamespace(String name) {
070:                Namespace namespace = (Namespace) m_namespaces.get(name);
071:                return namespace;
072:            }
073:
074:            /**
075:             * Get the Namespaces.
076:             * 
077:             * @return the namespaces.
078:             */
079:            public Namespace[] getNamespaces() {
080:                Namespace[] result = new Namespace[m_namespaces.size()];
081:                int index = 0;
082:                for (Iterator namespacesIterator = m_namespaces.values()
083:                        .iterator(); namespacesIterator.hasNext();) {
084:                    Namespace namespace = (Namespace) namespacesIterator.next();
085:                    result[index++] = namespace;
086:                }
087:                return result;
088:            }
089:
090:            /**
091:             * Get the names of the registered namespaces.
092:             * 
093:             * @return  array of registered namespaces
094:             */
095:            public String[] getNamespaceNames() {
096:                final Set names = m_namespaces.keySet();
097:                return (String[]) names.toArray(new String[names.size()]);
098:            }
099:
100:            /**
101:             * Setup and register a new Namespace.
102:             * 
103:             * @param name  the name of the Namespace
104:             * @param logger  a logger for the Namespace
105:             * @param definition  the namespace definition  
106:             * @param configuration  the namespace configuration
107:             * @param baseData  the namespace bootstrap data
108:             * @throws Exception  if something goes wrong setting up the Namespace
109:             */
110:            public void addNamespace(String name, Logger logger,
111:                    Configuration definition, Configuration configuration,
112:                    Configuration baseData, Configuration extractors)
113:                    throws Exception {
114:
115:                final Namespace namespace = new Namespace();
116:                namespace.setName(name);
117:                namespace.setLogger(logger);
118:
119:                namespace.loadParameters(configuration);
120:                namespace.loadDefinition(definition);
121:                namespace.loadBaseData(baseData);
122:                namespace.loadConfiguration(configuration);
123:                namespace.loadExtractors(extractors);
124:
125:                m_namespaces.put(name, namespace);
126:
127:            }
128:
129:            /**
130:             * Unregister and disconnect a Namespace.
131:             * 
132:             * @param name  the name of the namespace to remove
133:             * @throws Exception  if something went wrong during disconnecting the namespaces
134:             */
135:            public void removeNamespace(String name) throws Exception {
136:                final Namespace namespace = (Namespace) m_namespaces
137:                        .remove(name);
138:                if (namespace != null) {
139:                    namespace.disconnectServices();
140:                }
141:            }
142:
143:            /**
144:             * Set the Domain -global parameters
145:             * 
146:             * @param parameters
147:             */
148:            public void setParameters(Hashtable parameters) {
149:                Domain.setParameters(parameters);
150:            }
151:
152:            /**
153:             * Set the Domain -global logger
154:             * @param logger
155:             */
156:            public void setLogger(Logger logger) {
157:                Domain.setLogger(logger);
158:            }
159:
160:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.