A document has been updated: http://cocoon.zones.apache.org/daisy/documentation/1468.html
Document ID: 1468 Branch: main Language: default Name: Overview (unchanged) Document Type: Cocoon Document (unchanged) Updated on: 8/5/08 12:30:48 PM Updated by: Reinhard Pötz A new version has been created, state: publish Parts ===== Content ------- This part has been updated. Mime type: text/xml (unchanged) File name: (unchanged) Size: 1768 bytes (previous version: 37 bytes) Content diff: --- <html><body><p>TODO</p></body></html> +++ <html> +++ <body> +++ +++ <p>Cocoon JNet allows the dynamic registration of URLStreamHandler factories +++ with your JVM. That's a feature that isn't supported by Java itself.</p> +++ +++ <h1>Plain Java usage</h1> +++ +++ <p>The class <tt>org.apache.cocoon.jnet.DynamicURLStreamHandlerFactory</tt> can +++ be used to install more than one +++ <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/net/class-use/URLStreamHandlerFactory.html">URLStreamHandlerFactory</a> +++ and is registered at the JVM by using<tt> +++ org.apache.cocoon.jnet.URLStreamHandlerFactoryInstaller</tt>.</p> +++ +++ <h1>Spring integration</h1> +++ +++ <p>By using the <a href="daisy:1304">Cocoon Spring-Configurator</a> all beans of +++ type <tt>java.net.URLStreamHandlerFactory</tt> can be collected:</p> +++ +++ <pre><bean id="org.apache.cocoon.jnet.URLHandlerFactoryCollector" +++ class="org.apache.cocoon.jnet.URLHandlerFactoryCollector"> +++ <property name="urlHandlerFactories"> +++ <configurator:bean-map type="java.net.URLStreamHandlerFactory" +++ strip-prefix="true" /> +++ </property> +++ </bean> +++ </pre> +++ +++ <p>The URLHandlerFactoryCollector is implemented as an around advice. The code +++ that wants to use the registred protocols only has to be wrapped by this advice. +++ The Cocoon Servlet-Service framework uses it to intercept all calls of the +++ service method of any of its servlets:</p> +++ +++ <pre><aop:config> +++ <aop:aspect id="installURL" ref="org.apache.cocoon.jnet.URLHandlerFactoryCollector"> +++ <aop:pointcut id="servletServiceInvocation" +++ expression="execution(* javax.servlet.Servlet.service(..)) and bean(*/embedded)" /> +++ <aop:around pointcut-ref="servletServiceInvocation" method="installURLHandlers" /> +++ </aop:aspect> +++ </aop:config> +++ </pre> +++ +++ </body> +++ </html>