Source Code Cross Referenced for URLFactorySourceResolver.java in  » Content-Management-System » apache-lenya-2.0 » org » apache » cocoon » environment » 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 » apache lenya 2.0 » org.apache.cocoon.environment 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one or more
003:         * contributor license agreements.  See the NOTICE file distributed with
004:         * this work for additional information regarding copyright ownership.
005:         * The ASF licenses this file to You under the Apache License, Version 2.0
006:         * (the "License"); you may not use this file except in compliance with
007:         * the License.  You may obtain a copy of the License at
008:         * 
009:         *      http://www.apache.org/licenses/LICENSE-2.0
010:         * 
011:         * Unless required by applicable law or agreed to in writing, software
012:         * distributed under the License is distributed on an "AS IS" BASIS,
013:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         * See the License for the specific language governing permissions and
015:         * limitations under the License.
016:         */
017:        package org.apache.cocoon.environment;
018:
019:        import org.apache.excalibur.source.SourceException;
020:        import org.apache.avalon.framework.component.ComponentException;
021:        import org.apache.avalon.framework.component.ComponentManager;
022:        import org.apache.cocoon.ProcessingException;
023:        import org.apache.cocoon.components.source.URLSource;
024:        import org.apache.cocoon.components.url.URLFactory;
025:        import org.xml.sax.ContentHandler;
026:        import org.xml.sax.SAXException;
027:
028:        import java.io.IOException;
029:        import java.net.MalformedURLException;
030:        import java.net.URL;
031:        import java.util.Map;
032:
033:        /**
034:         * A <code>SourceResolver</code> based on a <code>URLFactory</code>.
035:         * @deprecated by the new source resolving
036:         *
037:         * @author <a href="mailto:sylvain@apache.org">Sylvain Wallez</a>
038:         * @version CVS $Id: URLFactorySourceResolver.java 433543 2006-08-22 06:22:54Z crossley $
039:         */
040:
041:        public class URLFactorySourceResolver implements  SourceResolver {
042:
043:            /** The component manager */
044:            protected ComponentManager manager;
045:
046:            /** The URL factory */
047:            protected URLFactory urlFactory;
048:
049:            /**
050:             * Creates an <code>URLFactorySourceResolver</code> with a component manager.
051:             * The <code>URLFactory</code> is looked up in the component manager.
052:             */
053:            public URLFactorySourceResolver(ComponentManager manager)
054:                    throws ComponentException {
055:                this .manager = manager;
056:                this .urlFactory = (URLFactory) manager.lookup(URLFactory.ROLE);
057:            }
058:
059:            /**
060:             * Creates an <code>URLFactorySourceResolver</code> with a component manager and
061:             * a <code>URLFactory</code> that will be used to resolve URLs.
062:             */
063:            public URLFactorySourceResolver(URLFactory factory,
064:                    ComponentManager manager) {
065:                this .urlFactory = factory;
066:                this .manager = manager;
067:            }
068:
069:            /**
070:             * Resolve the source.
071:             *
072:             * @param systemID This is either a system identifier
073:             *        (<code>java.net.URL</code>) or a local file.
074:             */
075:            public Source resolve(String systemID) throws ProcessingException,
076:                    SAXException, IOException {
077:
078:                URL url = this .urlFactory.getURL(systemID);
079:                return new URLSource(url, this .manager);
080:            }
081:
082:            /**
083:             * Get a <code>Source</code> object.
084:             */
085:            public org.apache.excalibur.source.Source resolveURI(
086:                    final String location) throws MalformedURLException,
087:                    IOException, SourceException {
088:                return this .resolveURI(location, null, null);
089:            }
090:
091:            /**
092:             * Get a <code>Source</code> object.
093:             */
094:            public org.apache.excalibur.source.Source resolveURI(
095:                    final String location, String baseURI, final Map parameters)
096:                    throws MalformedURLException, IOException, SourceException {
097:                throw new RuntimeException(
098:                        "URLFactorySourceResolver.resolveURI() is not implemented yet.");
099:            }
100:
101:            /**
102:             * Releases a resolved resource
103:             */
104:            public void release(final org.apache.excalibur.source.Source source) {
105:                throw new RuntimeException(
106:                        "URLFactorySourceResolver.release() is not implemented yet.");
107:            }
108:
109:            /**
110:             * Generates SAX events from the given source
111:             * <b>NOTE</b> : if the implementation can produce lexical events, care should be taken
112:             * that <code>handler</code> can actually
113:             * directly implement the LexicalHandler interface!
114:             * @param  source    the data
115:             * @throws ProcessingException if no suitable converter is found
116:             */
117:            public void toSAX(org.apache.excalibur.source.Source source,
118:                    ContentHandler handler) throws SAXException, IOException,
119:                    ProcessingException {
120:                throw new RuntimeException(
121:                        "ProcessingException.toSAX() is not implemented yet.");
122:            }
123:
124:            /**
125:             * Generates SAX events from the given source
126:             * <b>NOTE</b> : if the implementation can produce lexical events, care should be taken
127:             * that <code>handler</code> can actually
128:             * directly implement the LexicalHandler interface!
129:             * @param  source    the data
130:             * @throws ProcessingException if no suitable converter is found
131:             */
132:            public void toSAX(org.apache.excalibur.source.Source source,
133:                    String mimeTypeHint, ContentHandler handler)
134:                    throws SAXException, IOException, ProcessingException {
135:                throw new RuntimeException(
136:                        "ProcessingException.toSAX() is not implemented yet.");
137:            }
138:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.