cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r168547 - in /cocoon/trunk/src/java/org/apache/cocoon: core/container/CoreServiceManager.java sitemap/impl/ComponentManager.java
Date Fri, 06 May 2005 07:08:34 GMT
Author: cziegeler
Date: Fri May  6 00:08:31 2005
New Revision: 168547

URL: http://svn.apache.org/viewcvs?rev=168547&view=rev
Log:
Potential fix for setting up role manager if application container is used

Modified:
    cocoon/trunk/src/java/org/apache/cocoon/core/container/CoreServiceManager.java
    cocoon/trunk/src/java/org/apache/cocoon/sitemap/impl/ComponentManager.java

Modified: cocoon/trunk/src/java/org/apache/cocoon/core/container/CoreServiceManager.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/core/container/CoreServiceManager.java?rev=168547&r1=168546&r2=168547&view=diff
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/core/container/CoreServiceManager.java (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/core/container/CoreServiceManager.java Fri May
 6 00:08:31 2005
@@ -53,6 +53,7 @@
 import org.apache.cocoon.core.container.handler.LazyHandler;
 import org.apache.cocoon.core.source.SimpleSourceResolver;
 import org.apache.cocoon.matching.helpers.WildcardHelper;
+import org.apache.cocoon.sitemap.impl.ComponentManager;
 import org.apache.excalibur.source.Source;
 import org.apache.excalibur.source.SourceResolver;
 import org.apache.excalibur.source.TraversableSource;
@@ -124,10 +125,15 @@
         this.classloader = classloader;
 
         RoleManager parentRoleManager = null;
+        // FIXME - We should change this to a cleaner way!
+        ServiceManager coreServicemanager = parent;
+        if ( parent instanceof ComponentManager ) {
+            coreServicemanager = ((ComponentManager)parent).getServiceManager();
+        }
         // get role manager and logger manager
-        if ( parent instanceof CoreServiceManager ) {
-            parentRoleManager = ((CoreServiceManager)parent).roleManager;
-            this.loggerManager = ((CoreServiceManager)parent).loggerManager;
+        if ( coreServicemanager instanceof CoreServiceManager ) {
+            parentRoleManager = ((CoreServiceManager)coreServicemanager).roleManager;
+            this.loggerManager = ((CoreServiceManager)coreServicemanager).loggerManager;
         }
 
         // Always create a role manager, it can be filled several times either through

Modified: cocoon/trunk/src/java/org/apache/cocoon/sitemap/impl/ComponentManager.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/sitemap/impl/ComponentManager.java?rev=168547&r1=168546&r2=168547&view=diff
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/sitemap/impl/ComponentManager.java (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/sitemap/impl/ComponentManager.java Fri May  6
00:08:31 2005
@@ -15,10 +15,12 @@
  */
 package org.apache.cocoon.sitemap.impl;
 
-import org.apache.avalon.framework.CascadingRuntimeException;
+import org.apache.avalon.excalibur.logger.LoggerManager;
 import org.apache.avalon.framework.service.ServiceException;
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.cocoon.ProcessingException;
+import org.apache.cocoon.core.container.CoreServiceManager;
+import org.apache.cocoon.core.container.RoleManager;
 import org.apache.cocoon.sitemap.ComponentLocator;
 
 
@@ -115,4 +117,12 @@
         }
         return component;
     }
+    
+    public ServiceManager getServiceManager() {
+        if ( this.serviceManager instanceof ComponentManager ) {
+            return ((ComponentManager)this.serviceManager).getServiceManager();
+        }
+        return this.serviceManager;
+    }
+
 }



Mime
View raw message