cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gkossakow...@apache.org
Subject svn commit: r686258 - in /cocoon/trunk/subprojects/cocoon-jnet/src: changes/changes.xml main/java/org/apache/cocoon/jnet/URLHandlerFactoryCollector.java
Date Fri, 15 Aug 2008 15:51:00 GMT
Author: gkossakowski
Date: Fri Aug 15 08:50:59 2008
New Revision: 686258

URL: http://svn.apache.org/viewvc?rev=686258&view=rev
Log:
Splitted installURLHandlers into different public methods so URLHandlerFactoryCollector
can be used directly from Java code and not only as AOP advice.

Modified:
    cocoon/trunk/subprojects/cocoon-jnet/src/changes/changes.xml
    cocoon/trunk/subprojects/cocoon-jnet/src/main/java/org/apache/cocoon/jnet/URLHandlerFactoryCollector.java

Modified: cocoon/trunk/subprojects/cocoon-jnet/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/subprojects/cocoon-jnet/src/changes/changes.xml?rev=686258&r1=686257&r2=686258&view=diff
==============================================================================
--- cocoon/trunk/subprojects/cocoon-jnet/src/changes/changes.xml (original)
+++ cocoon/trunk/subprojects/cocoon-jnet/src/changes/changes.xml Fri Aug 15 08:50:59 2008
@@ -27,6 +27,12 @@
     <title>Changes Cocoon JNet</title>
   </properties>
   <body>
+    <release version="1.1.0-SNAPSHOT" date="2008-??-??" description="unreleased">
+      <action dev="gkossakowski" type="add">
+        Splitted installURLHandlers into different public methods so URLHandlerFactoryCollector

+        can be used directly from Java code and not only as AOP advice.
+      </action>
+    </release>
     <release version="1.0.0" date="2008-08-09" description="released">
       <action dev="reinhard" type="add">
         Initial creation.

Modified: cocoon/trunk/subprojects/cocoon-jnet/src/main/java/org/apache/cocoon/jnet/URLHandlerFactoryCollector.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/subprojects/cocoon-jnet/src/main/java/org/apache/cocoon/jnet/URLHandlerFactoryCollector.java?rev=686258&r1=686257&r2=686258&view=diff
==============================================================================
--- cocoon/trunk/subprojects/cocoon-jnet/src/main/java/org/apache/cocoon/jnet/URLHandlerFactoryCollector.java
(original)
+++ cocoon/trunk/subprojects/cocoon-jnet/src/main/java/org/apache/cocoon/jnet/URLHandlerFactoryCollector.java
Fri Aug 15 08:50:59 2008
@@ -33,21 +33,28 @@
 
     public Object installURLHandlers(ProceedingJoinPoint proceedingJoinPoint) throws Throwable
{
         try {
-            if (!this.urlStreamHandlerInstalled) {
-                URLStreamHandlerFactoryInstaller.setURLStreamHandlerFactory(new DynamicURLStreamHandlerFactory());
-                this.urlStreamHandlerInstalled = true;
-            }
-
-            for (Iterator i = this.urlHandlerFactories.values().iterator(); i.hasNext();)
{
-                URLStreamHandlerFactory streamHandlerFactory = (URLStreamHandlerFactory)
i.next();
-                DynamicURLStreamHandlerFactory.push(streamHandlerFactory);
-            }
-
+            pushUrlHandlerFactories();
             return proceedingJoinPoint.proceed();
         } finally {
-            for (Iterator i = this.urlHandlerFactories.values().iterator(); i.hasNext();
i.next()) {
-                DynamicURLStreamHandlerFactory.pop();
-            }
+            popUrlHandlerFactories();
+        }
+    }
+    
+    public void pushUrlHandlerFactories() throws Exception {
+        if (!this.urlStreamHandlerInstalled) {
+            URLStreamHandlerFactoryInstaller.setURLStreamHandlerFactory(new DynamicURLStreamHandlerFactory());
+            this.urlStreamHandlerInstalled = true;
+        }
+
+        for (Iterator i = this.urlHandlerFactories.values().iterator(); i.hasNext();) {
+            URLStreamHandlerFactory streamHandlerFactory = (URLStreamHandlerFactory) i.next();
+            DynamicURLStreamHandlerFactory.push(streamHandlerFactory);
+        }
+    }
+    
+    public void popUrlHandlerFactories() {
+        for (Iterator i = this.urlHandlerFactories.values().iterator(); i.hasNext(); i.next())
{
+            DynamicURLStreamHandlerFactory.pop();
         }
     }
 



Mime
View raw message