You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by re...@apache.org on 2008/04/12 16:17:48 UTC
svn commit: r647453 - in
/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl: ./
src/main/java/org/apache/cocoon/servletservice/
src/main/java/org/apache/cocoon/servletservice/spring/
src/main/java/org/apache/cocoon/url/ src/main/java...
Author: reinhard
Date: Sat Apr 12 07:17:41 2008
New Revision: 647453
URL: http://svn.apache.org/viewvc?rev=647453&view=rev
Log:
. revert the previous JNet integration
. install URLStreamHandlerFactories by using Spring AOP (intercept all servlet calls):
The URLHandlerFactoryCollector installs all protocols that are provided by SpringBeans
that are of the type "URLStreamHandlerFactory"
. very basic implementations of a blockcontext and a servlet protocol
. set a compile time dependency on the Spring configurator (for now the BlockDeployment stuff is there)
. this commit will break our samples: Since I others also want to look at this code, I don't want to
hold back this stuff anylonger. In order to make our samples work again, I will set the version
of the SSF and the Spring configurator to the recently released ones.
Added:
cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/
cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/BlockContextURLConnection.java (with props)
cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/BlockContextURLStreamHandler.java (with props)
cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/BlockContextURLStreamHandlerFactory.java (with props)
cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/ServletURLConnection.java (with props)
cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/ServletURLStreamHandler.java (with props)
cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/ServletURLStreamHandlerFactory.java (with props)
cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/URLHandlerFactoryCollector.java (with props)
cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-protocol-blockcontext.xml (with props)
cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-protocol-servlet.xml (with props)
cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-url-handler.xml (with props)
Removed:
cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/URLStreamFactoryInstaller.java
Modified:
cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/pom.xml
cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/ServletServiceContext.java
cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/spring/ServletDecorator.java
cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/spring/ServletFactoryBean.java
cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/excalibur/sourceresolve/jnet/DynamicURLStreamHandlerFactory.java
cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-service-block-servlet-map.xml
Modified: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/pom.xml?rev=647453&r1=647452&r2=647453&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/pom.xml (original)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/pom.xml Sat Apr 12 07:17:41 2008
@@ -55,7 +55,7 @@
<dependency>
<groupId>org.apache.cocoon</groupId>
<artifactId>cocoon-spring-configurator</artifactId>
- <scope>runtime</scope>
+ <scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.excalibur.components</groupId>
@@ -107,6 +107,14 @@
<artifactId>logkit</artifactId>
</exclusion>
</exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjrt</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjweaver</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
Modified: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/ServletServiceContext.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/ServletServiceContext.java?rev=647453&r1=647452&r2=647453&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/ServletServiceContext.java (original)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/ServletServiceContext.java Sat Apr 12 07:17:41 2008
@@ -60,10 +60,10 @@
private Servlet servlet;
private String mountPath;
private String contextPath;
+ private URL contextPathURL;
private Map properties;
private Map connections;
private Map connectionServiceNames;
-
private String serviceName;
/*
@@ -97,14 +97,19 @@
}
public URL getResource(String path) throws MalformedURLException {
- // HACK: allow file:/ URLs for reloading of sitemaps during development
- if (this.contextPath.startsWith("file:")) {
- return new URL("file", null, this.contextPath.substring("file:".length()) + path);
+ if (path == null || !path.startsWith("/")) {
+ throw new MalformedURLException("The path must begin with a '/' and is interpreted "
+ + "as relative to the current context root.");
+ }
+
+ // lazy initialization of the base URL
+ synchronized (this) {
+ if (this.contextPathURL == null) {
+ this.contextPathURL = new URL(this.contextPath);
+ }
}
- // prefix the path with the servlet context resolve and resolve in the embedding
- // servlet context
- return super.getResource(this.contextPath + path);
+ return new URL(this.contextPathURL, path.substring(1));
}
public String getRealPath(String path) {
@@ -348,7 +353,15 @@
* @param contextPath
*/
public void setContextPath(String contextPath) {
- this.contextPath = contextPath;
+ if (contextPath == null) {
+ throw new IllegalArgumentException("Context path must not be null.");
+ }
+
+ if (contextPath.endsWith("/")) {
+ this.contextPath = contextPath;
+ } else {
+ this.contextPath = contextPath + "/";
+ }
}
/**
@@ -471,8 +484,8 @@
NamedDispatcher _super = (NamedDispatcher) ServletServiceContext.this.getNamedDispatcher(SUPER);
if (status == HttpServletResponse.SC_NOT_FOUND && _super != null) {
//if servlet returned NOT_FOUND (404) and has super servlet declared let's reset everything and ask the super servlet
-
- //wrapping object resets underlying response as well
+
+ //wrapping object resets underlying response as well
wrappedResponse.resetBufferedResponse();
//here we don't need to pass wrappedResponse object because it's not our concern to buffer response anymore
//this avoids many overlapping buffers
Modified: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/spring/ServletDecorator.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/spring/ServletDecorator.java?rev=647453&r1=647452&r2=647453&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/spring/ServletDecorator.java (original)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/spring/ServletDecorator.java Sat Apr 12 07:17:41 2008
@@ -79,9 +79,6 @@
.rootBeanDefinition(ServletFactoryBean.class);
servletFactoryDefBuilder.setSource(ctx.extractSource(source));
servletFactoryDefBuilder.addPropertyReference("embeddedServlet", embeddedServletBeanName);
- //FIXME: it's a dirty hack here, this dependency is added in order to assure that URLHandlerFactory is installed before
- //ServletFactoryBean is used.
- servletFactoryDefBuilder.addPropertyReference("URLHandlerFactoryInstaller", "org.apache.cocoon.servletservice.URLStreamFactoryInstaller");
servletFactoryDefBuilder.setInitMethodName("init");
servletFactoryDefBuilder.setDestroyMethodName("destroy");
servletFactoryDefBuilder.addPropertyValue("serviceName", holder.getBeanName());
Modified: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/spring/ServletFactoryBean.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/spring/ServletFactoryBean.java?rev=647453&r1=647452&r2=647453&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/spring/ServletFactoryBean.java (original)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/spring/ServletFactoryBean.java Sat Apr 12 07:17:41 2008
@@ -16,9 +16,6 @@
*/
package org.apache.cocoon.servletservice.spring;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
import java.util.Enumeration;
import java.util.Map;
@@ -33,9 +30,6 @@
import org.aopalliance.intercept.MethodInvocation;
import org.apache.cocoon.servletservice.Mountable;
import org.apache.cocoon.servletservice.ServletServiceContext;
-import org.apache.cocoon.servletservice.URLStreamFactoryInstaller;
-import org.apache.excalibur.source.Source;
-import org.apache.excalibur.source.SourceResolver;
import org.springframework.aop.framework.ProxyFactory;
import org.springframework.aop.support.DefaultIntroductionAdvisor;
import org.springframework.aop.support.DelegatingIntroductionInterceptor;
@@ -96,33 +90,10 @@
this.parentContainer = WebApplicationContextUtils.getRequiredWebApplicationContext(this.servletContext);
}
- String contextPath = this.contextPath;
-
- //FIXME: I'm not sure if there is any better place for this code (GK)
- //-----------------------------------------------------
- // hack for getting a file protocol or other protocols that can be used as context
- // path in the getResource method in the servlet context
- if (!(contextPath.startsWith("file:") || contextPath.startsWith("/") || contextPath.indexOf(':') == -1)) {
- Source source = null;
- try {
- URL url = new URL(contextPath);
- source = (Source)url.getContent(new Class[] {Source.class});
- contextPath = source.getURI();
- //FIXME: obtained source is *NOT* released!!!
- } catch (IOException e) {
- throw new MalformedURLException("Could not resolve " + contextPath + " due to " + e);
- }
- }
- //----------------------------------------------------
-
-
- if (contextPath.length() != 0 && contextPath.charAt(0) != '/' && !contextPath.startsWith("file:")) {
- throw new MalformedURLException("The contextPath must be empty or start with '/' " +
- contextPath);
- }
-
- this.servletServiceContext.setContextPath(contextPath);
+ // set the context path
+ this.servletServiceContext.setContextPath(this.contextPath);
+ // create servlet-service specific Spring web application context
GenericWebApplicationContext container = new GenericWebApplicationContext();
container.setParent(this.parentContainer);
container.setServletContext(this.servletServiceContext);
@@ -150,7 +121,7 @@
}
};
- // create and initialize the embeded servlet
+ // create and initialize the embedded servlet
this.embeddedServlet.init(blockServletConfig);
this.servletServiceContext.setServlet(this.embeddedServlet);
}
@@ -224,10 +195,6 @@
public void setServiceName(String name) {
this.serviceName = name;
- }
-
- public void setURLHandlerFactoryInstaller(URLStreamFactoryInstaller installer ) {
- //we don't need this dependency
}
public Object getObject() throws Exception {
Added: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/BlockContextURLConnection.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/BlockContextURLConnection.java?rev=647453&view=auto
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/BlockContextURLConnection.java (added)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/BlockContextURLConnection.java Sat Apr 12 07:17:41 2008
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cocoon.url;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.Map;
+
+public class BlockContextURLConnection extends URLConnection {
+
+ private URL resolvedPath;
+ private final Map blockContexts;
+
+ protected BlockContextURLConnection(URL url, Map blockContexts) {
+ super(url);
+ this.blockContexts = blockContexts;
+ this.url = url;
+ }
+
+ public void connect() throws IOException {
+ this.getRealPath().openConnection().connect();
+ }
+
+ public InputStream getInputStream() throws IOException {
+ return getRealPath().openStream();
+ }
+
+ private URL getRealPath() {
+ if (this.resolvedPath == null) {
+ String location = this.url.toExternalForm();
+
+ // Remove the protocol and the first '/'
+ int pos = location.indexOf(":/");
+ String path = location.substring(pos + 2);
+
+ pos = path.indexOf('/');
+ if (pos != -1) {
+ // extract the block name and get the block context path
+ String blockName = path.substring(0, pos);
+ path = path.substring(pos + 1);
+ String blockContext = (String) this.blockContexts.get(blockName);
+
+ try {
+ this.resolvedPath = new URL(new URL(blockContext), path);
+ } catch (MalformedURLException e) {
+ throw new RuntimeException("Can create URL for '" + blockContext + path + "'.'");
+ }
+ } else {
+ throw new RuntimeException("The block name part of a block context uri must end with a '/' in "
+ + location);
+ }
+ }
+ return this.resolvedPath;
+ }
+}
Propchange: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/BlockContextURLConnection.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/BlockContextURLConnection.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/BlockContextURLConnection.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/BlockContextURLStreamHandler.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/BlockContextURLStreamHandler.java?rev=647453&view=auto
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/BlockContextURLStreamHandler.java (added)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/BlockContextURLStreamHandler.java Sat Apr 12 07:17:41 2008
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cocoon.url;
+
+import java.io.IOException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.URLStreamHandler;
+import java.util.Map;
+
+public class BlockContextURLStreamHandler extends URLStreamHandler {
+
+ private final Map blockContexts;
+
+ public BlockContextURLStreamHandler(Map blockContexts) {
+ this.blockContexts = blockContexts;
+ }
+
+ protected URLConnection openConnection(URL url) throws IOException {
+ return new BlockContextURLConnection(url, this.blockContexts);
+ }
+
+}
Propchange: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/BlockContextURLStreamHandler.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/BlockContextURLStreamHandler.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/BlockContextURLStreamHandler.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/BlockContextURLStreamHandlerFactory.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/BlockContextURLStreamHandlerFactory.java?rev=647453&view=auto
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/BlockContextURLStreamHandlerFactory.java (added)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/BlockContextURLStreamHandlerFactory.java Sat Apr 12 07:17:41 2008
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cocoon.url;
+
+import java.net.URLStreamHandler;
+import java.net.URLStreamHandlerFactory;
+import java.util.Map;
+
+import javax.servlet.ServletContext;
+
+import org.apache.cocoon.blockdeployment.BlockDeploymentServletContextListener;
+import org.springframework.beans.BeansException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.web.context.WebApplicationContext;
+
+public class BlockContextURLStreamHandlerFactory implements URLStreamHandlerFactory, ApplicationContextAware {
+
+ private Map blockContexts;
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.net.URLStreamHandlerFactory#createURLStreamHandler(java.lang.String)
+ */
+ public URLStreamHandler createURLStreamHandler(String protocol) {
+ if ("blockcontext".equalsIgnoreCase(protocol)) {
+ return new BlockContextURLStreamHandler(this.blockContexts);
+ }
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
+ */
+ public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
+ WebApplicationContext webApplicationContext = (WebApplicationContext) applicationContext;
+ ServletContext servletContext = webApplicationContext.getServletContext();
+ this.blockContexts = (Map) servletContext.getAttribute(BlockDeploymentServletContextListener.BLOCK_CONTEXT_MAP);
+ }
+}
Propchange: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/BlockContextURLStreamHandlerFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/BlockContextURLStreamHandlerFactory.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/BlockContextURLStreamHandlerFactory.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/ServletURLConnection.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/ServletURLConnection.java?rev=647453&view=auto
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/ServletURLConnection.java (added)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/ServletURLConnection.java Sat Apr 12 07:17:41 2008
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cocoon.url;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.net.URLConnection;
+
+import javax.servlet.ServletException;
+
+import org.apache.cocoon.servletservice.AbsoluteServletConnection;
+import org.apache.cocoon.servletservice.Absolutizable;
+import org.apache.cocoon.servletservice.CallStackHelper;
+import org.apache.cocoon.servletservice.ServletConnection;
+
+public class ServletURLConnection extends URLConnection{
+
+ private ServletConnection servletConnection;
+ private URL url;
+
+ protected ServletURLConnection(URL url) throws URISyntaxException {
+ super(url);
+
+ this.url = url;
+
+ URI locationUri = new URI(url.getPath());
+ // new URI(locationUri.getRawSchemeSpecificPart());
+
+ final String servletReference = locationUri.getScheme();
+ final Absolutizable absolutizable = (Absolutizable) CallStackHelper.getCurrentServletContext();
+ final String servletName;
+
+ // find out the type of the reference and create a service name
+ if (servletReference == null) {
+ // self-reference
+ servletName = absolutizable.getServiceName();
+ } else if (servletReference.endsWith(AbsoluteServletConnection.ABSOLUTE_SERVLET_SOURCE_POSTFIX)) {
+ // absolute reference
+ servletName = servletReference.substring(0, servletReference.length() - 1);
+ } else {
+ // relative reference
+ servletName = absolutizable.getServiceName(servletReference);
+ }
+
+ this.servletConnection = new AbsoluteServletConnection(servletName, locationUri.getRawPath(), locationUri
+ .getRawQuery());
+ }
+
+ public void connect() throws IOException {
+ try {
+ this.servletConnection.connect();
+ } catch (ServletException e) {
+ IOException ioException = new IOException("Can't connect to servlet URL " + this.url + ".");
+ ioException.initCause(e);
+ throw ioException;
+ }
+ }
+
+ public InputStream getInputStream() throws IOException {
+ try {
+ return this.servletConnection.getInputStream();
+ } catch (ServletException e) {
+ IOException ioException = new IOException("Can't read from servlet URL " + this.url + ".");
+ ioException.initCause(e);
+ throw ioException;
+ }
+ }
+
+}
Propchange: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/ServletURLConnection.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/ServletURLConnection.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/ServletURLConnection.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/ServletURLStreamHandler.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/ServletURLStreamHandler.java?rev=647453&view=auto
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/ServletURLStreamHandler.java (added)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/ServletURLStreamHandler.java Sat Apr 12 07:17:41 2008
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cocoon.url;
+
+import java.io.IOException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.URLStreamHandler;
+
+public class ServletURLStreamHandler extends URLStreamHandler {
+
+ protected URLConnection openConnection(URL url) throws IOException {
+ try {
+ return new ServletURLConnection(url);
+ } catch (Throwable e) {
+ IOException ioException = new IOException("Can't create ServletURLConnection " + url + ".");
+ ioException.initCause(e);
+ throw ioException;
+ }
+ }
+}
Propchange: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/ServletURLStreamHandler.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/ServletURLStreamHandler.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/ServletURLStreamHandler.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/ServletURLStreamHandlerFactory.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/ServletURLStreamHandlerFactory.java?rev=647453&view=auto
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/ServletURLStreamHandlerFactory.java (added)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/ServletURLStreamHandlerFactory.java Sat Apr 12 07:17:41 2008
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cocoon.url;
+
+import java.net.URLStreamHandler;
+import java.net.URLStreamHandlerFactory;
+
+public class ServletURLStreamHandlerFactory implements URLStreamHandlerFactory {
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see java.net.URLStreamHandlerFactory#createURLStreamHandler(java.lang.String)
+ */
+ public URLStreamHandler createURLStreamHandler(String protocol) {
+ if ("servlet".equalsIgnoreCase(protocol)) {
+ return new ServletURLStreamHandler();
+ }
+
+ return null;
+ }
+}
Propchange: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/ServletURLStreamHandlerFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/ServletURLStreamHandlerFactory.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/ServletURLStreamHandlerFactory.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/URLHandlerFactoryCollector.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/URLHandlerFactoryCollector.java?rev=647453&view=auto
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/URLHandlerFactoryCollector.java (added)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/URLHandlerFactoryCollector.java Sat Apr 12 07:17:41 2008
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cocoon.url;
+
+import java.net.URLStreamHandlerFactory;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.apache.excalibur.sourceresolve.jnet.DynamicURLStreamHandlerFactory;
+import org.apache.excalibur.sourceresolve.jnet.Installer;
+import org.aspectj.lang.ProceedingJoinPoint;
+
+public class URLHandlerFactoryCollector {
+
+ private Map urlHandlerFactories = Collections.EMPTY_MAP;
+
+ private boolean urlStreamHandlerInstalled;
+
+ public Object installURLHandlers(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
+ try {
+ if (!this.urlStreamHandlerInstalled) {
+ Installer.setURLStreamHandlerFactory(new DynamicURLStreamHandlerFactory());
+ this.urlStreamHandlerInstalled = true;
+ }
+
+ for (Iterator i = this.urlHandlerFactories.values().iterator(); i.hasNext();) {
+ URLStreamHandlerFactory streamHandlerFactory = (URLStreamHandlerFactory) i.next();
+ DynamicURLStreamHandlerFactory.push(streamHandlerFactory);
+ }
+
+ return proceedingJoinPoint.proceed();
+ } finally {
+ for (Iterator i = this.urlHandlerFactories.values().iterator(); i.hasNext();) {
+ DynamicURLStreamHandlerFactory.pop();
+ }
+ }
+ }
+
+ public void setUrlHandlerFactories(Map urlHandlerFactories) {
+ this.urlHandlerFactories = urlHandlerFactories;
+ }
+}
Propchange: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/URLHandlerFactoryCollector.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/URLHandlerFactoryCollector.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/url/URLHandlerFactoryCollector.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/excalibur/sourceresolve/jnet/DynamicURLStreamHandlerFactory.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/excalibur/sourceresolve/jnet/DynamicURLStreamHandlerFactory.java?rev=647453&r1=647452&r2=647453&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/excalibur/sourceresolve/jnet/DynamicURLStreamHandlerFactory.java (original)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/excalibur/sourceresolve/jnet/DynamicURLStreamHandlerFactory.java Sat Apr 12 07:17:41 2008
@@ -45,6 +45,9 @@
*/
protected URLStreamHandler create(String protocol) {
ParentAwareURLStreamHandlerFactory factory = (ParentAwareURLStreamHandlerFactory)FACTORY.get();
+ if (factory == null) {
+ return null;
+ }
return factory.createURLStreamHandler(protocol);
}
}
Added: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-protocol-blockcontext.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-protocol-blockcontext.xml?rev=647453&view=auto
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-protocol-blockcontext.xml (added)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-protocol-blockcontext.xml Sat Apr 12 07:17:41 2008
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<!-- $Id$ -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+
+ <bean id="org.apache.cocoon.url.BlockContextURLStreamHandlerFactory" class="org.apache.cocoon.url.BlockContextURLStreamHandlerFactory" />
+
+</beans>
Propchange: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-protocol-blockcontext.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-protocol-blockcontext.xml
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-protocol-blockcontext.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-protocol-servlet.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-protocol-servlet.xml?rev=647453&view=auto
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-protocol-servlet.xml (added)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-protocol-servlet.xml Sat Apr 12 07:17:41 2008
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<!-- $Id$ -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+
+ <bean id="org.apache.cocoon.url.ServletURLStreamHandlerFactory" class="org.apache.cocoon.url.ServletURLStreamHandlerFactory" />
+
+</beans>
Propchange: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-protocol-servlet.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-protocol-servlet.xml
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-protocol-servlet.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Modified: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-service-block-servlet-map.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-service-block-servlet-map.xml?rev=647453&r1=647452&r2=647453&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-service-block-servlet-map.xml (original)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-servlet-service-block-servlet-map.xml Sat Apr 12 07:17:41 2008
@@ -29,15 +29,5 @@
type="javax.servlet.Servlet"
has-properties="mountPath"
key-property="mountPath"/>
-
- <bean id="org.apache.cocoon.servletservice.URLStreamFactoryInstaller" class="org.apache.cocoon.servletservice.URLStreamFactoryInstaller"
- scope="singleton" init-method="init">
- <property name="globalSourceFactories">
- <!-- only blockcontext and file protocols are supported by SSF -->
- <map>
- <entry key="file" value-ref="org.apache.excalibur.source.SourceFactory/file"/>
- <entry key="blockcontext" value-ref="org.apache.excalibur.source.SourceFactory/blockcontext"/>
- </map>
- </property>
- </bean>
+
</beans>
Added: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-url-handler.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-url-handler.xml?rev=647453&view=auto
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-url-handler.xml (added)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-url-handler.xml Sat Apr 12 07:17:41 2008
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<!-- $Id$ -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:aop="http://www.springframework.org/schema/aop"
+ xmlns:configurator="http://cocoon.apache.org/schema/configurator"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+ http://cocoon.apache.org/schema/configurator http://cocoon.apache.org/schema/configurator/cocoon-configurator-1.0.1.xsd
+ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
+
+ <bean id="org.apache.cocoon.url.URLHandlerFactoryCollector" class="org.apache.cocoon.url.URLHandlerFactoryCollector">
+ <property name="urlHandlerFactories">
+ <configurator:bean-map type="java.net.URLStreamHandlerFactory" strip-prefix="true" />
+ </property>
+ </bean>
+
+ <aop:config>
+ <aop:aspect id="installURL" ref="org.apache.cocoon.url.URLHandlerFactoryCollector">
+ <aop:pointcut id="servletServiceInvocation"
+ expression="execution(* javax.servlet.Servlet.service(..)) and bean(*/embedded)" />
+ <aop:pointcut id="servletInitialization"
+ expression="execution(* javax.servlet.Servlet.init(..)) and bean(*/embedded)" />
+
+ <aop:around pointcut-ref="servletServiceInvocation" method="installURLHandlers" />
+ <aop:around pointcut-ref="servletInitialization" method="installURLHandlers" />
+ </aop:aspect>
+ </aop:config>
+
+</beans>
Propchange: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-url-handler.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-url-handler.xml
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/resources/META-INF/cocoon/spring/cocoon-url-handler.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml