cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r540711 [1/2] - in /cocoon/branches/BRANCH_2_1_X/src: blocks/axis/java/org/apache/cocoon/components/axis/ blocks/linotype/java/org/apache/cocoon/components/ deprecated/java/org/apache/cocoon/components/xslt/ java/org/apache/cocoon/ java/org...
Date Tue, 22 May 2007 19:36:08 GMT
Author: cziegeler
Date: Tue May 22 12:36:07 2007
New Revision: 540711

URL: http://svn.apache.org/viewvc?view=rev&rev=540711
Log:
Prepare for upcomming source resolver versions.

Modified:
    cocoon/branches/BRANCH_2_1_X/src/blocks/axis/java/org/apache/cocoon/components/axis/SoapServerImpl.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/linotype/java/org/apache/cocoon/components/SourceRepository.java
    cocoon/branches/BRANCH_2_1_X/src/deprecated/java/org/apache/cocoon/components/xslt/XSLTProcessorImpl.java
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/Cocoon.java
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/bean/CocoonBean.java
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/CocoonComponentManager.java
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/modules/input/LocateResource.java
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/modules/input/XMLFileModule.java
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/AbstractEnvironment.java

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/axis/java/org/apache/cocoon/components/axis/SoapServerImpl.java
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/axis/java/org/apache/cocoon/components/axis/SoapServerImpl.java?view=diff&rev=540711&r1=540710&r2=540711
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/axis/java/org/apache/cocoon/components/axis/SoapServerImpl.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/axis/java/org/apache/cocoon/components/axis/SoapServerImpl.java Tue May 22 12:36:07 2007
@@ -5,9 +5,9 @@
  * 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.
@@ -88,7 +88,7 @@
  *
  * @author <a href="mailto:">Steve Loughran</a>
  * @author <a href="mailto:dug@us.ibm.com">Doug Davis</a>
- * 
+ *
  * @version CVS $Id$
  */
 public class SoapServerImpl extends AbstractLogEnabled
@@ -186,15 +186,15 @@
     public void configure(final Configuration config)
     throws ConfigurationException {
         try {
-            setServerConfig(config);
-            setAttachmentDir(config);
-            setJWSDir(config);
-            setSecurityProvider(config);
-            setTransportName(config);
-            setManagedServices(config);
+            this.setServerConfig(config);
+            this.setAttachmentDir(config);
+            this.setJWSDir(config);
+            this.setSecurityProvider(config);
+            this.setTransportName(config);
+            this.setManagedServices(config);
 
-            if (getLogger().isDebugEnabled()) {
-                getLogger().debug("SoapServerImpl.configure() complete");
+            if (this.getLogger().isDebugEnabled()) {
+                this.getLogger().debug("SoapServerImpl.configure() complete");
             }
         } catch (final Exception e) {
             throw new ConfigurationException("Error during configuration", e);
@@ -214,12 +214,12 @@
 
         try {
             resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
-            m_serverWSDD =
+            this.m_serverWSDD =
                 resolver.resolveURI(
                     wsdd.getAttribute("src", DEFAULT_SERVER_CONFIG)
                 );
         } finally {
-            this.manager.release(resolver);
+            this.manager.release((Component)resolver);
         }
     }
 
@@ -234,18 +234,18 @@
     private void setAttachmentDir(final Configuration config)
     throws ConfigurationException, ContextException {
         final Configuration dir = config.getChild("attachment-dir");
-        m_attachmentDir = dir.getAttribute("src", null);
+        this.m_attachmentDir = dir.getAttribute("src", null);
 
-        if (m_attachmentDir == null) {
+        if (this.m_attachmentDir == null) {
             File workDir =
                 (File) this.context.get(org.apache.cocoon.Constants.CONTEXT_WORK_DIR);
             File attachmentDir =
                 IOUtils.createFile(workDir, "attachments" + File.separator);
-            m_attachmentDir = IOUtils.getFullFilename(attachmentDir);
+            this.m_attachmentDir = IOUtils.getFullFilename(attachmentDir);
         }
 
-        if (getLogger().isDebugEnabled()) {
-            getLogger().debug("attachment directory = " + m_attachmentDir);
+        if (this.getLogger().isDebugEnabled()) {
+            this.getLogger().debug("attachment directory = " + this.m_attachmentDir);
         }
     }
 
@@ -260,18 +260,18 @@
     private void setJWSDir(final Configuration config)
     throws ConfigurationException, ContextException {
         final Configuration dir = config.getChild("jws-dir");
-        m_jwsClassDir = dir.getAttribute("src", null);
+        this.m_jwsClassDir = dir.getAttribute("src", null);
 
-        if (m_jwsClassDir == null) {
+        if (this.m_jwsClassDir == null) {
             File workDir =
                 (File) this.context.get(org.apache.cocoon.Constants.CONTEXT_WORK_DIR);
             File jwsClassDir =
                 IOUtils.createFile(workDir, "axis-jws" + File.separator);
-            m_jwsClassDir = IOUtils.getFullFilename(jwsClassDir);
+            this.m_jwsClassDir = IOUtils.getFullFilename(jwsClassDir);
         }
 
-        if (getLogger().isDebugEnabled()) {
-            getLogger().debug("jws class directory = " + m_jwsClassDir);
+        if (this.getLogger().isDebugEnabled()) {
+            this.getLogger().debug("jws class directory = " + this.m_jwsClassDir);
         }
     }
 
@@ -291,12 +291,12 @@
             final boolean providerIsEnabled = BooleanUtils.toBoolean(attr);
 
             if (providerIsEnabled) {
-                m_securityProvider = new ServletSecurityProvider();
+                this.m_securityProvider = new ServletSecurityProvider();
             }
         }
 
-        if (getLogger().isDebugEnabled()) {
-            getLogger().debug("security provider = " + m_securityProvider);
+        if (this.getLogger().isDebugEnabled()) {
+            this.getLogger().debug("security provider = " + this.m_securityProvider);
         }
     }
 
@@ -309,13 +309,13 @@
     private void setTransportName(final Configuration config)
     throws ConfigurationException {
         final Configuration name = config.getChild("transport");
-        m_transportName =
+        this.m_transportName =
             name.getAttribute("name", HTTPTransport.DEFAULT_TRANSPORT_NAME);
     }
 
     /**
      * Helper method to obtain a list of managed services from the given
-     * configuration (ie. locations of deployement descriptors to be 
+     * configuration (ie. locations of deployement descriptors to be
      * deployed).
      *
      * @param config a <code>Configuration</code> value
@@ -349,13 +349,13 @@
                     descriptors.add(new WSDDDocument(d));
                 }
             } finally {
-                this.manager.release(resolver);
+                this.manager.release((Component)resolver);
                 this.manager.release((Component)parser);
             }
         }
 
         // convert the list of descriptors to an array, for easier iteration
-        m_descriptors =
+        this.m_descriptors =
             (WSDDDocument[]) descriptors.toArray(new WSDDDocument[]{});
     }
 
@@ -364,10 +364,10 @@
      */
     public void initialize()
     throws Exception {
-        m_axisServer = createEngine();
+        this.m_axisServer = this.createEngine();
 
-        if (getLogger().isDebugEnabled()) {
-            getLogger().debug("SoapServerImpl.initialize() complete");
+        if (this.getLogger().isDebugEnabled()) {
+            this.getLogger().debug("SoapServerImpl.initialize() complete");
         }
     }
 
@@ -380,20 +380,20 @@
     public void start()
     throws Exception {
         // deploy all configured services
-        for (int i = 0; i < m_descriptors.length; ++i) {
-            WSDDDeployment deployment = m_engineConfig.getDeployment();
-            m_descriptors[i].deploy(deployment);
+        for (int i = 0; i < this.m_descriptors.length; ++i) {
+            WSDDDeployment deployment = this.m_engineConfig.getDeployment();
+            this.m_descriptors[i].deploy(deployment);
 
-            if (getLogger().isDebugEnabled()) {
-                getLogger().debug(
+            if (this.getLogger().isDebugEnabled()) {
+                this.getLogger().debug(
                     "Deployed Descriptor:\n" +
-                    XMLUtils.DocumentToString(m_descriptors[i].getDOMDocument())
+                    XMLUtils.DocumentToString(this.m_descriptors[i].getDOMDocument())
                 );
             }
         }
 
-        if (getLogger().isDebugEnabled()) {
-            getLogger().debug("SoapServerImpl.start() complete");
+        if (this.getLogger().isDebugEnabled()) {
+            this.getLogger().debug("SoapServerImpl.start() complete");
         }
     }
 
@@ -406,20 +406,20 @@
      */
     public void stop()
     throws Exception {
-        WSDDDeployment deployment = m_engineConfig.getDeployment();
+        WSDDDeployment deployment = this.m_engineConfig.getDeployment();
         WSDDService[] services = deployment.getServices();
 
         // undeploy all deployed services
         for (int i = 0; i < services.length; ++i) {
             deployment.undeployService(services[i].getQName());
 
-            if (getLogger().isDebugEnabled()) {
-                getLogger().debug("Undeployed: " + services[i].toString());
+            if (this.getLogger().isDebugEnabled()) {
+                this.getLogger().debug("Undeployed: " + services[i].toString());
             }
         }
 
-        if (getLogger().isDebugEnabled()) {
-            getLogger().debug("SoapServerImpl.stop() complete");
+        if (this.getLogger().isDebugEnabled()) {
+            this.getLogger().debug("SoapServerImpl.stop() complete");
         }
     }
 
@@ -428,7 +428,7 @@
      */
     public void invoke(MessageContext message)
     throws Exception {
-        m_axisServer.invoke(message);
+        this.m_axisServer.invoke(message);
     }
 
     /**
@@ -443,19 +443,19 @@
         HttpServletResponse res,
         ServletContext con) {
 
-        MessageContext msgContext = new MessageContext(m_axisServer);
+        MessageContext msgContext = new MessageContext(this.m_axisServer);
         String webInfPath = con.getRealPath("/WEB-INF");
         String homeDir = con.getRealPath("/");
 
         // Set the Transport
-        msgContext.setTransportName(m_transportName);
+        msgContext.setTransportName(this.m_transportName);
 
         // Add Avalon specifics to MessageContext
-        msgContext.setProperty(LOGGER, getLogger());
+        msgContext.setProperty(LOGGER, this.getLogger());
         msgContext.setProperty(AvalonProvider.COMPONENT_MANAGER, this.manager);
 
         // Save some HTTP specific info in the bag in case someone needs it
-        msgContext.setProperty(Constants.MC_JWS_CLASSDIR, m_jwsClassDir);
+        msgContext.setProperty(Constants.MC_JWS_CLASSDIR, this.m_jwsClassDir);
         msgContext.setProperty(Constants.MC_HOME_DIR, homeDir);
         msgContext.setProperty(Constants.MC_RELATIVE_PATH, req.getServletPath());
         msgContext.setProperty(HTTPConstants.MC_HTTP_SERVLET, this );
@@ -482,27 +482,27 @@
 
         msgContext.setProperty(Constants.MC_CONFIGPATH, webInfPath);
 
-        if (m_securityProvider != null) {
-            msgContext.setProperty("securityProvider", m_securityProvider);
+        if (this.m_securityProvider != null) {
+            msgContext.setProperty("securityProvider", this.m_securityProvider);
         }
 
         // write out the contents of the message context for debugging purposes
-        if (getLogger().isDebugEnabled()) {
-            debugMessageContext(msgContext);
+        if (this.getLogger().isDebugEnabled()) {
+            this.debugMessageContext(msgContext);
         }
 
         return msgContext;
     }
 
     /**
-     * Helper method to log the contents of a given message context 
+     * Helper method to log the contents of a given message context
      *
      * @param context a <code>MessageContext</code> instance
      */
     private void debugMessageContext(final MessageContext context) {
         for (final Iterator i = context.getPropertyNames(); i.hasNext(); ) {
             final String key = (String) i.next();
-            getLogger().debug(
+            this.getLogger().debug(
                 "MessageContext: Key:" + key + ": Value: " + context.getProperty(key)
             );
         }
@@ -515,10 +515,10 @@
      */
     public AxisServer createEngine()
     throws Exception {
-        AxisServer engine = AxisServer.getServer(getEngineEnvironment());
+        AxisServer engine = AxisServer.getServer(this.getEngineEnvironment());
 
-        if (getLogger().isDebugEnabled()) {
-            getLogger().debug("Axis engine created");
+        if (this.getLogger().isDebugEnabled()) {
+            this.getLogger().debug("Axis engine created");
         }
 
         return engine;
@@ -530,10 +530,10 @@
 
         // use FileProvider directly with a Avalon Source object instead of going
         // through the EngineConfigurationFactoryServlet class
-        m_engineConfig = new FileProvider(m_serverWSDD.getInputStream());
+        this.m_engineConfig = new FileProvider(this.m_serverWSDD.getInputStream());
 
-        env.put(EngineConfiguration.PROPERTY_NAME, m_engineConfig);
-        env.put(AxisEngine.ENV_ATTACHMENT_DIR, m_attachmentDir);
+        env.put(EngineConfiguration.PROPERTY_NAME, this.m_engineConfig);
+        env.put(AxisEngine.ENV_ATTACHMENT_DIR, this.m_attachmentDir);
         // REVISIT(MC): JNDI Factory support ?
         //env.put(AxisEngine.ENV_SERVLET_CONTEXT, context);
 

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/linotype/java/org/apache/cocoon/components/SourceRepository.java
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/linotype/java/org/apache/cocoon/components/SourceRepository.java?view=diff&rev=540711&r1=540710&r2=540711
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/linotype/java/org/apache/cocoon/components/SourceRepository.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/linotype/java/org/apache/cocoon/components/SourceRepository.java Tue May 22 12:36:07 2007
@@ -5,9 +5,9 @@
  * 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.
@@ -25,6 +25,7 @@
 import java.util.Enumeration;
 import java.util.Iterator;
 
+import org.apache.avalon.framework.component.Component;
 import org.apache.avalon.framework.component.ComponentException;
 import org.apache.avalon.framework.component.ComponentManager;
 import org.apache.cocoon.environment.Request;
@@ -42,17 +43,17 @@
  * @version CVS $Id$
  */
 public class SourceRepository {
-    
+
     public static final String FILE_NAME = "document";
-    
+
     private static SourceRepository instance;
-    
+
     private static ComponentManager manager;
-    
+
     private SourceRepository() {
     	manager = CocoonComponentManager.getSitemapComponentManager();
     }
-    
+
     public static SourceRepository getInstance() {
         if (instance == null) {
             instance = new SourceRepository();
@@ -60,7 +61,7 @@
         return instance;
     }
 
-    private static Source resolve(String uri) 
+    private static Source resolve(String uri)
     throws MalformedURLException, IOException {
         SourceResolver resolver = null;
         TraversableSource source;
@@ -70,7 +71,7 @@
         } catch (ComponentException ce) {
             throw new IOException("ComponentException");
         } finally {
-            manager.release(resolver);
+            manager.release((Component)resolver);
         }
         return source;
     }
@@ -91,7 +92,7 @@
     public static void save(Request request, String dirName) throws Exception {
         TraversableSource collection = getCollection(dirName);
         ModifiableTraversableSource result;
-        
+
         Enumeration params = request.getParameterNames();
         while (params.hasMoreElements()) {
             String name = (String) params.nextElement();
@@ -102,13 +103,13 @@
                 String code = name.substring(5);
                 if (!(collection instanceof ModifiableSource)) {
                 	throw new RuntimeException("Cannot modify the given source");
-                }	
+                }
                 result = (ModifiableTraversableSource)resolve(collection.getURI() + "/" + code);
-                
+
                 save(part, result);
             } else if (name.startsWith("delete:")) {
                 String value = request.getParameter(name);
-                if (value.length() > 0) {               
+                if (value.length() > 0) {
                     String code = name.substring(7);
 					result = (ModifiableTraversableSource)resolve(collection + "/" + code);
                     remove(result);
@@ -116,12 +117,12 @@
             }
         }
     }
-    
+
     public static void save(Request request, String param, String dest) throws Exception {
         Part part = (Part) request.get(param);
         save(part, (ModifiableTraversableSource)resolve(dest));
     }
-    
+
     public static void save(Part part, ModifiableTraversableSource destination) throws Exception {
         InputStream in = null;
         OutputStream out = null;
@@ -138,7 +139,7 @@
             }
         }
     }
-    
+
     public static OutputStream getOutputStream(String collection) throws IOException {
         String mainResource = collection + "/" + FILE_NAME + ".xml";
         String versionedResource = collection + "/" + FILE_NAME + "." + getVersionID(collection) + ".xml";
@@ -151,9 +152,9 @@
         String versionedResource = collection + "/" + FILE_NAME + "." + version + ".xml";
         copy(versionedResource,mainResource);
     }
-    
+
     /**
-     * Returns the highest version id of the files included in the given 
+     * Returns the highest version id of the files included in the given
      * directory.
      */
     public static int getVersionID(String colName) {
@@ -172,10 +173,10 @@
 					int localid = getVersion(content.getName());
 					if (localid > id) id = localid;
 				} catch (Exception e) {}
-            	            	
-            }            
+
+            }
         }
-        
+
         return ++id;
     }
 
@@ -188,7 +189,7 @@
 			contents = collection.getChildren();
 		} catch (SourceException se) {
 			throw new RuntimeException("Unable to list contents for collection " + colName);
-		}	
+		}
 
         for (Iterator iter = contents.iterator(); iter.hasNext();) {
             TraversableSource content = (TraversableSource) iter.next();
@@ -200,17 +201,17 @@
 					 }
 				 } catch (Exception e) {}
 			 }
-            
+
         }
 
         return versions.toArray();
     }
-        
+
     /**
      * Return the version encoded into the name as a numeric subextension of
      * an .xml extension.
-     * 
-     * Example: 
+     *
+     * Example:
      *  anything.123.xml -> 123
      *  document.3.xml -> 3
      *  document.0.xml -> 0
@@ -229,7 +230,7 @@
         }
         return -1;
     }
-    
+
     public static int getID(String colName) {
         TraversableSource collection = getCollection(colName);
 
@@ -240,7 +241,7 @@
 		} catch (SourceException se) {
 			throw new RuntimeException("Unable to list contents for collection " + colName);
 		}
-		
+
 		for (Iterator iter = contents.iterator(); iter.hasNext();) {
             TraversableSource content = (TraversableSource) iter.next();
 			if (content.isCollection())  {
@@ -249,11 +250,11 @@
 					int localid = Integer.parseInt(name);
 					if (localid > id) id = localid;
 				} catch (Exception e) {}
-			}           
-        }	
+			}
+        }
         return ++id;
     }
-    
+
     public static boolean remove(String resourceName) {
         try {
             return remove((ModifiableTraversableSource)resolve(resourceName));
@@ -261,13 +262,13 @@
             return false;
         } catch (IOException e) {
 			return false;
-        } 
-        
+        }
+
     }
-    
+
     public static boolean remove(ModifiableTraversableSource resource) {
         boolean success = true;
-        
+
         if (resource.isCollection()) {
 			Collection contents;
 			try {
@@ -279,7 +280,7 @@
                 ModifiableTraversableSource element = (ModifiableTraversableSource) iter.next();
                 success = remove(element);
             }
-        	            
+
         }
         try {
             resource.delete();
@@ -287,19 +288,19 @@
         } catch (SourceException e) {
         	return false;
         }
-        
+
     }
-    
+
     public static void copy(String from, String to) throws IOException {
         copy((ModifiableTraversableSource)resolve(from), (ModifiableTraversableSource)resolve(to));
-    }    
+    }
 
     public static void copy(ModifiableTraversableSource from, ModifiableTraversableSource to) throws IOException {
-        
+
         if (!from.exists()) {
             throw new IOException("Cannot find source file/folder");
         }
-        
+
         if (from.isCollection()) {
             to.makeCollection();
 			Collection contents;
@@ -310,7 +311,7 @@
 			}
 			for (Iterator iter = contents.iterator(); iter.hasNext();) {
 				ModifiableTraversableSource src = (ModifiableTraversableSource) iter.next();
-				SourceUtil.copy(src, resolve(to.getURI() + "/" + src.getName()));				
+				SourceUtil.copy(src, resolve(to.getURI() + "/" + src.getName()));
 
 			}
         } else {
@@ -326,8 +327,8 @@
                 if (in != null) in.close();
             }
         }
-    }    
-    
+    }
+
     public static void copy(InputStream from, OutputStream to) throws IOException {
         byte[] buffer = new byte[64 * 1024];
         int count = 0;
@@ -335,6 +336,6 @@
             to.write(buffer, 0, count);
             count = from.read(buffer, 0, buffer.length);
         } while (count != -1);
-    }   
-       
+    }
+
 }

Modified: cocoon/branches/BRANCH_2_1_X/src/deprecated/java/org/apache/cocoon/components/xslt/XSLTProcessorImpl.java
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/deprecated/java/org/apache/cocoon/components/xslt/XSLTProcessorImpl.java?view=diff&rev=540711&r1=540710&r2=540711
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/deprecated/java/org/apache/cocoon/components/xslt/XSLTProcessorImpl.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/deprecated/java/org/apache/cocoon/components/xslt/XSLTProcessorImpl.java Tue May 22 12:36:07 2007
@@ -5,9 +5,9 @@
  * 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.
@@ -32,6 +32,7 @@
 import javax.xml.transform.stream.StreamSource;
 
 import org.apache.avalon.framework.activity.Disposable;
+import org.apache.avalon.framework.component.Component;
 import org.apache.avalon.framework.component.ComponentException;
 import org.apache.avalon.framework.component.ComponentManager;
 import org.apache.avalon.framework.component.Composable;
@@ -132,7 +133,7 @@
         if (this.manager != null) {
             this.manager.release(this.store);
             this.store = null;
-            this.manager.release(this.resolver);
+            this.manager.release((Component)this.resolver);
             this.resolver = null;
         }
         this.errorHandler = null;
@@ -146,7 +147,7 @@
     throws ParameterException {
         this.useStore = params.getParameterAsBoolean("use-store", true);
         this.incrementalProcessing = params.getParameterAsBoolean("incremental-processing", false);
-        this.factory = getTransformerFactory(params.getParameter("transformer-factory", DEFAULT_FACTORY));
+        this.factory = this.getTransformerFactory(params.getParameter("transformer-factory", DEFAULT_FACTORY));
     }
 
     /**
@@ -163,12 +164,12 @@
      * Set the transformer factory used by this component
      */
     public void setTransformerFactory(String classname) {
-        this.factory = getTransformerFactory(classname);
+        this.factory = this.getTransformerFactory(classname);
     }
 
     public TransformerHandler getTransformerHandler(org.apache.cocoon.environment.Source stylesheet)
     throws ProcessingException {
-        return getTransformerHandler(stylesheet, null);
+        return this.getTransformerHandler(stylesheet, null);
     }
 
     public TransformerHandler getTransformerHandler(org.apache.cocoon.environment.Source stylesheet,
@@ -176,10 +177,10 @@
     throws ProcessingException {
         try {
             final String id = stylesheet.getSystemId();
-            Templates templates = getTemplates(stylesheet, id);
+            Templates templates = this.getTemplates(stylesheet, id);
             if (templates == null) {
                 if (this.getLogger().isDebugEnabled()) {
-                    getLogger().debug("Creating new Templates for " + id);
+                    this.getLogger().debug("Creating new Templates for " + id);
                 }
 
                 // Create a Templates ContentHandler to handle parsing of the
@@ -196,7 +197,7 @@
                 }
 
                 if (this.getLogger().isDebugEnabled()) {
-                    getLogger().debug("Source = " + stylesheet
+                    this.getLogger().debug("Source = " + stylesheet
                     + ", templatesHandler = " + templatesHandler);
                 }
 
@@ -207,10 +208,10 @@
                 // Get the Templates object (generated during the parsing of
                 // the stylesheet) from the TemplatesHandler.
                 templates = templatesHandler.getTemplates();
-                putTemplates (templates, stylesheet, id);
+                this.putTemplates (templates, stylesheet, id);
             } else {
                 if (this.getLogger().isDebugEnabled()) {
-                    getLogger().debug("Reusing Templates for " + id);
+                    this.getLogger().debug("Reusing Templates for " + id);
                 }
             }
 
@@ -224,8 +225,8 @@
             if (e.getException() == null) {
                 throw new ProcessingException("Exception in creating Transform Handler", e);
             } else {
-                if (getLogger().isDebugEnabled())
-                    getLogger().debug("Got SAXException. Rethrowing cause exception.", e);
+                if (this.getLogger().isDebugEnabled())
+                    this.getLogger().debug("Got SAXException. Rethrowing cause exception.", e);
                 throw new ProcessingException("Exception in creating Transform Handler", e.getException());
             }
         } catch (Exception e) {
@@ -240,12 +241,12 @@
     throws ProcessingException {
         try {
             if (this.getLogger().isDebugEnabled()) {
-                getLogger().debug("XSLTProcessorImpl: transform source = " + source
+                this.getLogger().debug("XSLTProcessorImpl: transform source = " + source
                     + ", stylesheet = " + stylesheet
                     + ", parameters = " + params
                     + ", result = " + result);
             }
-            TransformerHandler handler = getTransformerHandler(stylesheet);
+            TransformerHandler handler = this.getTransformerHandler(stylesheet);
 
             Transformer transformer = handler.getTransformer();
             if (params != null) {
@@ -256,13 +257,13 @@
                 }
             }
 
-            if (getLogger().isDebugEnabled())
+            if (this.getLogger().isDebugEnabled())
                 this.getLogger().debug("XSLTProcessorImpl: starting transform");
             // Is it possible to use Source's toSAX method?
             handler.setResult(result);
             source.toSAX(handler);
 
-            if (getLogger().isDebugEnabled())
+            if (this.getLogger().isDebugEnabled())
                 this.getLogger().debug("XSLTProcessorImpl: transform done");
         } catch (Exception e) {
             throw new ProcessingException("Error in running Transformation", e);
@@ -283,20 +284,20 @@
             try {
                 _factory = (SAXTransformerFactory) ClassUtils.loadClass(factoryName).newInstance();
             } catch (ClassNotFoundException cnfe) {
-                if (getLogger().isErrorEnabled())
-                    getLogger().error("Cannot find the requested TrAX factory '" + factoryName
+                if (this.getLogger().isErrorEnabled())
+                    this.getLogger().error("Cannot find the requested TrAX factory '" + factoryName
                                       + "'. Using default TrAX Transformer Factory instead.");
                 if (this.factory != null) return this.factory;
                 _factory = (SAXTransformerFactory) TransformerFactory.newInstance();
             } catch (ClassCastException cce) {
-                if (getLogger().isErrorEnabled())
-                    getLogger().error("The indicated class '" + factoryName
+                if (this.getLogger().isErrorEnabled())
+                    this.getLogger().error("The indicated class '" + factoryName
                                       + "' is not a TrAX Transformer Factory. Using default TrAX Transformer Factory instead.");
                 if (this.factory != null) return this.factory;
                 _factory = (SAXTransformerFactory) TransformerFactory.newInstance();
             } catch (Exception e) {
-                if (getLogger().isErrorEnabled())
-                    getLogger().error("Error found loading the requested TrAX Transformer Factory '"
+                if (this.getLogger().isErrorEnabled())
+                    this.getLogger().error("Error found loading the requested TrAX Transformer Factory '"
                                       + factoryName + "'. Using default TrAX Transformer Factory instead.");
                 if (this.factory != null) return this.factory;
                 _factory = (SAXTransformerFactory) TransformerFactory.newInstance();
@@ -310,7 +311,7 @@
         // made more extensible.
         if (_factory.getClass().getName().equals("org.apache.xalan.processor.TransformerFactoryImpl")) {
             _factory.setAttribute("http://xml.apache.org/xalan/features/incremental",
-                    new Boolean (incrementalProcessing));
+                    new Boolean (this.incrementalProcessing));
         }
 
         return _factory;
@@ -319,35 +320,35 @@
     private Templates getTemplates(org.apache.cocoon.environment.Source stylesheet,
                                    String id)
     throws IOException, ProcessingException {
-        if (!useStore) {
+        if (!this.useStore) {
             return null;
         }
 
         // we must augment the template ID with the factory classname since one
         // transformer implementation cannot handle the instances of a
         // template created by another one.
-        id += factory.getClass().getName();
+        id += this.factory.getClass().getName();
 
         Templates templates = null;
         // only stylesheets with a last modification date are stored
         if (stylesheet.getLastModified() != 0) {
             // Stored is an array of the template and the caching time
-            if (store.containsKey(id)) {
-                Object[] templateAndTime = (Object[])store.get(id);
+            if (this.store.containsKey(id)) {
+                Object[] templateAndTime = (Object[])this.store.get(id);
 
                 if(templateAndTime != null && templateAndTime[1] != null) {
                     long storedTime = ((Long)templateAndTime[1]).longValue();
 
                     if (storedTime < stylesheet.getLastModified()) {
-                        store.remove(id);
+                        this.store.remove(id);
                     } else {
                         templates = (Templates)templateAndTime[0];
                     }
                 }
             }
-        } else if (store.containsKey(id)) {
+        } else if (this.store.containsKey(id)) {
             // remove an old template if it exists
-            store.remove(id);
+            this.store.remove(id);
         }
         return templates;
     }
@@ -355,14 +356,14 @@
     private void putTemplates (Templates templates, org.apache.cocoon.environment.Source stylesheet,
                                String id)
     throws IOException, ProcessingException {
-        if (!useStore) {
+        if (!this.useStore) {
             return;
         }
 
         // we must augment the template ID with the factory classname since one
         // transformer implementation cannot handle the instances of a
         // template created by another one.
-        id += factory.getClass().getName();
+        id += this.factory.getClass().getName();
 
         // only stylesheets with a last modification date are stored
         if (stylesheet.getLastModified() != 0) {
@@ -371,7 +372,7 @@
             Object[] templateAndTime = new Object[2];
             templateAndTime[0] = templates;
             templateAndTime[1] = new Long(stylesheet.getLastModified());
-            store.store(id, templateAndTime);
+            this.store.store(id, templateAndTime);
         }
     }
 
@@ -393,13 +394,13 @@
     throws TransformerException {
         if (this.getLogger().isDebugEnabled()) {
             this.getLogger().debug("resolve(href = " + href +
-                                   ", base = " + base + "); resolver = " + resolver);
+                                   ", base = " + base + "); resolver = " + this.resolver);
         }
 
         Source xslSource = null;
         try {
             if (href.indexOf(":") > 1) {
-                xslSource = resolver.resolveURI(href);
+                xslSource = this.resolver.resolveURI(href);
             } else {
                 // patch for a null pointer passed as base
                 if (base == null)
@@ -413,18 +414,18 @@
                         // always be protocol:/....
                         return null; // we can't resolve this
                     } else {
-                        xslSource = resolver.resolveURI(new StringBuffer(base.substring(0, lastPathElementPos))
+                        xslSource = this.resolver.resolveURI(new StringBuffer(base.substring(0, lastPathElementPos))
                         .append("/").append(href).toString());
                     }
                 } else {
                     File parent = new File(base.substring(5));
                     File parent2 = new File(parent.getParentFile(), href);
-                    xslSource = resolver.resolveURI(parent2.toURL().toExternalForm());
+                    xslSource = this.resolver.resolveURI(parent2.toURL().toExternalForm());
                 }
             }
 
             if (this.getLogger().isDebugEnabled()) {
-                getLogger().debug("xslSource = " + xslSource
+                this.getLogger().debug("xslSource = " + xslSource
                 + ", system id = " + xslSource.getURI());
             }
 

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/Cocoon.java
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/Cocoon.java?view=diff&rev=540711&r1=540710&r2=540711
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/Cocoon.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/Cocoon.java Tue May 22 12:36:07 2007
@@ -202,7 +202,7 @@
      */
     public Cocoon() throws ConfigurationException {
         // Set the system properties needed by Xalan2.
-        setSystemProperties();
+        this.setSystemProperties();
 
         // HACK: Provide a way to share an instance of Cocoon object between
         //       several servlets/portlets.
@@ -234,7 +234,7 @@
     public void contextualize(Context context) throws ContextException {
         if (this.context == null) {
             this.context = new ComponentContext(context);
-            SettingsHelper.createSettings((DefaultContext)this.context, getLogger());
+            SettingsHelper.createSettings((DefaultContext)this.context, this.getLogger());
             ((DefaultContext) this.context).makeReadOnly();
 
             this.classpath = (String)context.get(Constants.CONTEXT_CLASSPATH);
@@ -281,8 +281,8 @@
      * @exception Exception if an error occurs
      */
     public void initialize() throws Exception {
-        if (parentComponentManager != null) {
-            this.componentManager = new CocoonComponentManager(parentComponentManager,
+        if (this.parentComponentManager != null) {
+            this.componentManager = new CocoonComponentManager(this.parentComponentManager,
                                                                (ClassLoader) this.context.get(Constants.CONTEXT_CLASS_LOADER));
         } else {
             this.componentManager = new CocoonComponentManager((ClassLoader) this.context.get(Constants.CONTEXT_CLASS_LOADER));
@@ -290,33 +290,33 @@
         ContainerUtil.enableLogging(this.componentManager, this.rootLogger.getChildLogger("manager"));
         ContainerUtil.contextualize(this.componentManager, this.context);
         this.componentManager.setInstrumentManager(this.instrumentManager);
-        getLogger().debug("New Cocoon object.");
+        this.getLogger().debug("New Cocoon object.");
 
         // Log the System Properties.
-        dumpSystemProperties();
+        this.dumpSystemProperties();
 
         // Setup the default parser, for parsing configuration.
         // If one need to use a different parser, set the given system property
         // first check for deprecated property to be compatible:
         String parser = getSystemProperty(Constants.DEPRECATED_PARSER_PROPERTY, Constants.DEFAULT_PARSER);
         if (!Constants.DEFAULT_PARSER.equals(parser)) {
-            getLogger().warn("Deprecated property " +
+            this.getLogger().warn("Deprecated property " +
                              Constants.DEPRECATED_PARSER_PROPERTY + " is used. Please use " +
                              Constants.PARSER_PROPERTY + " instead.");
             if ("org.apache.cocoon.components.parser.XercesParser".equals(parser)) {
                 parser = XercesParser.class.getName();
             } else {
-                getLogger().warn("Unknown value for deprecated property: " +
+                this.getLogger().warn("Unknown value for deprecated property: " +
                                  Constants.DEPRECATED_PARSER_PROPERTY + ", value: " + parser +
                                  ". If you experience problems during startup, check the parser configuration section of the documentation.");
             }
         } else {
             parser = getSystemProperty(Constants.PARSER_PROPERTY, Constants.DEFAULT_PARSER);
         }
-        if (getLogger().isDebugEnabled()) {
-            getLogger().debug("Parser: " + parser);
-            getLogger().debug("Classpath: " + classpath);
-            getLogger().debug("Work directory: " + workDir.getCanonicalPath());
+        if (this.getLogger().isDebugEnabled()) {
+            this.getLogger().debug("Parser: " + parser);
+            this.getLogger().debug("Classpath: " + this.classpath);
+            this.getLogger().debug("Work directory: " + this.workDir.getCanonicalPath());
         }
 
         ExcaliburComponentManager startupManager = new ExcaliburComponentManager((ClassLoader) this.context.get(Constants.CONTEXT_CLASS_LOADER));
@@ -333,28 +333,28 @@
         }
 
         ContainerUtil.initialize(startupManager);
-        configure(startupManager);
+        this.configure(startupManager);
         ContainerUtil.dispose(startupManager);
         startupManager = null;
 
         // add the logger manager to the component locator
         final ComponentProxyGenerator proxyGenerator = new ComponentProxyGenerator();
-        final Component loggerManagerProxy = proxyGenerator.getProxy(LoggerManager.class.getName(),loggerManager);
-        componentManager.addComponentInstance(LoggerManager.ROLE,loggerManagerProxy);
+        final Component loggerManagerProxy = proxyGenerator.getProxy(LoggerManager.class.getName(),this.loggerManager);
+        this.componentManager.addComponentInstance(LoggerManager.ROLE,loggerManagerProxy);
 
         ContainerUtil.initialize(this.componentManager);
 
         // Get the Processor and keep it if it's ThreadSafe
         Processor processor = (Processor)this.componentManager.lookup(Processor.ROLE);
         if (processor instanceof ThreadSafe) {
-            if (getLogger().isDebugEnabled()) {
-                getLogger().debug("Processor of class " + processor.getClass().getName() +
+            if (this.getLogger().isDebugEnabled()) {
+                this.getLogger().debug("Processor of class " + processor.getClass().getName() +
                                   " is ThreadSafe");
             }
             this.threadSafeProcessor = processor;
         } else {
-            if (getLogger().isDebugEnabled()) {
-                getLogger().debug("Processor of class " + processor.getClass().getName() +
+            if (this.getLogger().isDebugEnabled()) {
+                this.getLogger().debug("Processor of class " + processor.getClass().getName() +
                                   " is NOT ThreadSafe -- will be looked up at each request");
             }
             this.componentManager.release(processor);
@@ -369,15 +369,15 @@
 
     /** Dump System Properties */
     private void dumpSystemProperties() {
-        if (getLogger().isDebugEnabled()) {
+        if (this.getLogger().isDebugEnabled()) {
             try {
                 Enumeration e = System.getProperties().propertyNames();
-                getLogger().debug("===== System Properties Start =====");
+                this.getLogger().debug("===== System Properties Start =====");
                 for (; e.hasMoreElements();) {
                     String key = (String) e.nextElement();
-                    getLogger().debug(key + "=" + System.getProperty(key));
+                    this.getLogger().debug(key + "=" + System.getProperty(key));
                 }
-                getLogger().debug("===== System Properties End =====");
+                this.getLogger().debug("===== System Properties End =====");
             } catch (SecurityException se) {
                 // Ignore Exceptions.
             }
@@ -398,7 +398,7 @@
         Configuration roles = null;
         try {
             p = (SAXParser) startupManager.lookup(SAXParser.ROLE);
-            SAXConfigurationHandler b = new PropertyAwareSAXConfigurationHandler(settings, getLogger());
+            SAXConfigurationHandler b = new PropertyAwareSAXConfigurationHandler(settings, this.getLogger());
             URL url = ClassUtils.getResource("org/apache/cocoon/cocoon.roles");
             InputSource is = new InputSource(url.openStream());
             is.setSystemId(url.toString());
@@ -418,7 +418,7 @@
         try {
             this.configurationFile.refresh();
             p = (SAXParser)startupManager.lookup(SAXParser.ROLE);
-            SAXConfigurationHandler b = new PropertyAwareSAXConfigurationHandler(settings, getLogger());
+            SAXConfigurationHandler b = new PropertyAwareSAXConfigurationHandler(settings, this.getLogger());
             InputSource is = SourceUtil.getInputSource(this.configurationFile);
             p.parse(is, b);
             this.configuration = b.getConfiguration();
@@ -429,14 +429,14 @@
         }
 
         Configuration conf = this.configuration;
-        if (getLogger().isDebugEnabled()) {
-            getLogger().debug("Root configuration: " + conf.getName());
+        if (this.getLogger().isDebugEnabled()) {
+            this.getLogger().debug("Root configuration: " + conf.getName());
         }
         if (!"cocoon".equals(conf.getName())) {
             throw new ConfigurationException("Invalid configuration file\n" + conf.toString());
         }
-        if (getLogger().isDebugEnabled()) {
-            getLogger().debug("Configuration version: " + conf.getAttribute("version"));
+        if (this.getLogger().isDebugEnabled()) {
+            this.getLogger().debug("Configuration version: " + conf.getAttribute("version"));
         }
         if (!Constants.CONF_VERSION.equals(conf.getAttribute("version"))) {
             throw new ConfigurationException("Invalid configuration schema version. Must be '" + Constants.CONF_VERSION + "'.");
@@ -446,7 +446,7 @@
         if (!"".equals(userRoles)) {
             try {
                 p = (SAXParser)startupManager.lookup(SAXParser.ROLE);
-                SAXConfigurationHandler b = new PropertyAwareSAXConfigurationHandler(settings, getLogger());
+                SAXConfigurationHandler b = new PropertyAwareSAXConfigurationHandler(settings, this.getLogger());
                 org.apache.cocoon.environment.Context context =
                     (org.apache.cocoon.environment.Context) this.context.get(Constants.CONTEXT_ENVIRONMENT_CONTEXT);
                 URL url = context.getResource(userRoles);
@@ -473,7 +473,7 @@
         this.componentManager.setRoleManager(drm);
         this.componentManager.setLoggerManager(this.loggerManager);
 
-        getLogger().debug("Setting up components...");
+        this.getLogger().debug("Setting up components...");
         ContainerUtil.configure(this.componentManager, conf);
     }
 
@@ -540,7 +540,7 @@
             this.componentManager.release(this.threadSafeProcessor);
             this.threadSafeProcessor = null;
 
-            this.componentManager.release(this.sourceResolver);
+            this.componentManager.release((Component)this.sourceResolver);
             this.sourceResolver = null;
 
             ContainerUtil.dispose(this.componentManager);
@@ -587,7 +587,7 @@
         msg.append("PROTOCOL: ").append(request.getProtocol()).append(lineSeparator);
         msg.append("SCHEME: ").append(request.getScheme()).append(lineSeparator);
         msg.append("AUTH TYPE: ").append(request.getAuthType()).append(lineSeparator).append(lineSeparator);
-        msg.append("CURRENT ACTIVE REQUESTS: ").append(activeRequestCount).append(lineSeparator);
+        msg.append("CURRENT ACTIVE REQUESTS: ").append(this.activeRequestCount).append(lineSeparator);
 
         // log all of the request parameters
         Enumeration e = request.getParameterNames();
@@ -658,7 +658,7 @@
             msg.append(buffer.toString());
         }
 
-        getLogger().debug(msg.toString());
+        this.getLogger().debug(msg.toString());
     }
 
     /**
@@ -681,17 +681,17 @@
                                                 this);
         try {
             boolean result;
-            if (getLogger().isDebugEnabled()) {
-                ++activeRequestCount;
-                debug(environment, false);
+            if (this.getLogger().isDebugEnabled()) {
+                ++this.activeRequestCount;
+                this.debug(environment, false);
             }
 
 
             if (this.requestListener != null) {
                 try {
-                    requestListener.onRequestStart(environment);
+                    this.requestListener.onRequestStart(environment);
                 } catch (Exception e) {
-                    getLogger().error("Error encountered monitoring request start: " + e.getMessage());
+                    this.getLogger().error("Error encountered monitoring request start: " + e.getMessage());
                 }
             }
 
@@ -699,9 +699,9 @@
                 result = this.threadSafeProcessor.process(environment);
                 if (this.requestListener != null) {
                     try {
-                        requestListener.onRequestEnd(environment);
+                        this.requestListener.onRequestEnd(environment);
                     } catch (Exception e) {
-                        getLogger().error("Error encountered monitoring request start: " + e.getMessage());
+                        this.getLogger().error("Error encountered monitoring request start: " + e.getMessage());
                     }
                 }
             } else {
@@ -710,9 +710,9 @@
                     result = processor.process(environment);
                     if (this.requestListener != null) {
                         try {
-                            requestListener.onRequestEnd(environment);
+                            this.requestListener.onRequestEnd(environment);
                         } catch (Exception e) {
-                            getLogger().error("Error encountered monitoring request start: " + e.getMessage());
+                            this.getLogger().error("Error encountered monitoring request start: " + e.getMessage());
                         }
                     }
                 } finally {
@@ -726,9 +726,9 @@
         } catch (Exception any) {
             if (this.requestListener != null) {
                 try {
-                    requestListener.onRequestException(environment, any);
+                    this.requestListener.onRequestException(environment, any);
                 } catch (Exception e) {
-                    getLogger().error("Error encountered monitoring request start: " + e.getMessage());
+                    this.getLogger().error("Error encountered monitoring request start: " + e.getMessage());
                 }
             }
             // reset response on error
@@ -737,12 +737,12 @@
         } finally {
             CocoonComponentManager.leaveEnvironment();
             CocoonComponentManager.endProcessing(environment, key);
-            if (getLogger().isDebugEnabled()) {
-                --activeRequestCount;
+            if (this.getLogger().isDebugEnabled()) {
+                --this.activeRequestCount;
             }
 
             // TODO (CZ): This is only for testing - remove it later on
-            CocoonComponentManager.checkEnvironment(environmentDepth, getLogger());
+            CocoonComponentManager.checkEnvironment(environmentDepth, this.getLogger());
         }
     }
 
@@ -753,14 +753,14 @@
      */
     public ProcessingPipeline buildPipeline(Environment environment)
     throws Exception {
-        if (disposed) {
+        if (this.disposed) {
             throw new IllegalStateException("You cannot process a Disposed Cocoon engine.");
         }
 
         try {
-            if (getLogger().isDebugEnabled()) {
-                ++activeRequestCount;
-                debug(environment, true);
+            if (this.getLogger().isDebugEnabled()) {
+                ++this.activeRequestCount;
+                this.debug(environment, true);
             }
 
             if (this.threadSafeProcessor != null) {
@@ -775,8 +775,8 @@
             }
 
         } finally {
-            if (getLogger().isDebugEnabled()) {
-                --activeRequestCount;
+            if (this.getLogger().isDebugEnabled()) {
+                --this.activeRequestCount;
             }
         }
     }
@@ -801,7 +801,7 @@
      * Accessor for active request count
      */
     public int getActiveRequestCount() {
-        return activeRequestCount;
+        return this.activeRequestCount;
     }
 
     public ExcaliburComponentManager getComponentManager() {

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/bean/CocoonBean.java
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/bean/CocoonBean.java?view=diff&rev=540711&r1=540710&r2=540711
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/bean/CocoonBean.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/bean/CocoonBean.java Tue May 22 12:36:07 2007
@@ -5,9 +5,9 @@
  * 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.
@@ -16,6 +16,7 @@
  */
 package org.apache.cocoon.bean;
 
+import org.apache.avalon.framework.component.Component;
 import org.apache.cocoon.Constants;
 import org.apache.cocoon.ProcessingException;
 import org.apache.cocoon.bean.helpers.Crawler;
@@ -84,7 +85,7 @@
     private boolean verbose;
     SourceResolver sourceResolver;
 
-    private Crawler crawler;    
+    private Crawler crawler;
     private String checksumsURI = null;
     private Map checksums;
 
@@ -101,15 +102,15 @@
             super.initialize();
 
             this.sourceResolver =
-                (SourceResolver) getComponentManager().lookup(
+                (SourceResolver) this.getComponentManager().lookup(
                     SourceResolver.ROLE);
 
-            initialized = true;
+            this.initialized = true;
         }
     }
 
     protected void finalize() throws Throwable {
-        dispose();
+        this.dispose();
         super.finalize();
     }
 
@@ -118,7 +119,7 @@
     //
 
     public void setFollowLinks(boolean follow) {
-        followLinks = follow;
+        this.followLinks = follow;
     }
 
     public void setConfirmExtensions(boolean confirmExtension) {
@@ -130,15 +131,15 @@
     }
 
     public boolean isPrecompileOnly() {
-        return precompileOnly;
+        return this.precompileOnly;
     }
-    
+
     public void setVerbose(boolean verbose) {
         this.verbose = verbose;
     }
 
     public void setDefaultFilename(String filename) {
-        defaultFilename = filename;
+        this.defaultFilename = filename;
     }
 
     public void setBrokenLinkGenerate(boolean brokenLinkGenerate) {
@@ -152,13 +153,13 @@
     public void setChecksumURI(String uri) {
         this.checksumsURI = uri;
     }
-    
+
     public boolean followLinks() {
-        return followLinks;
+        return this.followLinks;
     }
 
     public boolean confirmExtensions() {
-        return confirmExtension;
+        return this.confirmExtension;
     }
     /**
      * Adds a target for processing
@@ -180,7 +181,7 @@
         target.setFollowLinks(this.followLinks);
         target.setConfirmExtension(this.confirmExtension);
         target.setLogger(this.logger);
-        crawler.addTarget(target);
+        this.crawler.addTarget(target);
     }
 
     public void addTarget(String type, String sourceURI, String destURI)
@@ -190,7 +191,7 @@
         target.setFollowLinks(this.followLinks);
         target.setConfirmExtension(this.confirmExtension);
         target.setLogger(this.logger);
-        crawler.addTarget(target);
+        this.crawler.addTarget(target);
     }
 
     public void addTarget(String sourceURI, String destURI)
@@ -200,7 +201,7 @@
         target.setFollowLinks(this.followLinks);
         target.setConfirmExtension(this.confirmExtension);
         target.setLogger(this.logger);
-        crawler.addTarget(target);
+        this.crawler.addTarget(target);
     }
 
     public void addTargets(List uris, String destURI)
@@ -212,7 +213,7 @@
             target.setFollowLinks(this.followLinks);
             target.setConfirmExtension(this.confirmExtension);
             target.setLogger(this.logger);
-            crawler.addTarget(target);
+            this.crawler.addTarget(target);
         }
     }
 
@@ -238,26 +239,26 @@
         target.setFollowLinks(followLinks);
         target.setConfirmExtension(confirmExtension);
         target.setLogger(logger);
-        crawler.addTarget(target);
+        this.crawler.addTarget(target);
     }
 
     public int getTargetCount() {
-        return crawler.getRemainingCount();
+        return this.crawler.getRemainingCount();
     }
-    
+
     public void addExcludePattern(String pattern) {
-        excludePatterns.add(pattern);
+        this.excludePatterns.add(pattern);
     }
 
     public void addIncludePattern(String pattern) {
-        includePatterns.add(pattern);
+        this.includePatterns.add(pattern);
     }
 
     public void addIncludeLinkExtension(String extension) {
-        if (includeLinkExtensions == null) {
-            includeLinkExtensions = new ArrayList();
+        if (this.includeLinkExtensions == null) {
+            this.includeLinkExtensions = new ArrayList();
         }
-        includeLinkExtensions.add(extension);
+        this.includeLinkExtensions.add(extension);
     }
 
     public void addListener(BeanListener listener) {
@@ -272,7 +273,7 @@
                               int pagesRemaining,
                               int pagesComplete,
                               long timeTaken) {
-        Iterator i = listeners.iterator();
+        Iterator i = this.listeners.iterator();
         while (i.hasNext()) {
             BeanListener l = (BeanListener) i.next();
             l.pageGenerated(sourceURI,
@@ -287,7 +288,7 @@
     }
 
     public void sendMessage(String msg) {
-        Iterator i = listeners.iterator();
+        Iterator i = this.listeners.iterator();
         while (i.hasNext()) {
             BeanListener l = (BeanListener) i.next();
             l.messageGenerated(msg);
@@ -295,7 +296,7 @@
     }
 
     public void sendWarning(String uri, String warning) {
-        Iterator i = listeners.iterator();
+        Iterator i = this.listeners.iterator();
         while (i.hasNext()) {
             BeanListener l = (BeanListener) i.next();
             l.warningGenerated(uri, warning);
@@ -303,7 +304,7 @@
     }
 
     public void sendBrokenLinkWarning(String uri, String warning) {
-        Iterator i = listeners.iterator();
+        Iterator i = this.listeners.iterator();
         while (i.hasNext()) {
             BeanListener l = (BeanListener) i.next();
             l.brokenLinkFound(uri, "", warning, null);
@@ -311,7 +312,7 @@
     }
 
     public void pageSkipped(String uri, String message) {
-        Iterator i = listeners.iterator();
+        Iterator i = this.listeners.iterator();
         while (i.hasNext()) {
             BeanListener l = (BeanListener) i.next();
             l.pageSkipped(uri, message);
@@ -321,7 +322,7 @@
     public void dispose() {
         if (this.initialized) {
             if (this.sourceResolver != null) {
-                getComponentManager().release(this.sourceResolver);
+                this.getComponentManager().release((Component)this.sourceResolver);
                 this.sourceResolver = null;
             }
             super.dispose();
@@ -338,41 +339,41 @@
             this.initialize();
         }
 
-        if (crawler.getRemainingCount() == 0 && !precompileOnly) {
-            log.info("No targets for to be processed.");
+        if (this.crawler.getRemainingCount() == 0 && !this.precompileOnly) {
+            this.log.info("No targets for to be processed.");
             return;
         }
 
         if (this.checksumsURI != null) {
-            readChecksumFile();
+            this.readChecksumFile();
         }
-        
-        if (crawler.getRemainingCount()>=0) {
-            Iterator iterator = crawler.iterator();
+
+        if (this.crawler.getRemainingCount()>=0) {
+            Iterator iterator = this.crawler.iterator();
             while (iterator.hasNext()) {
                 Target target = (Target) iterator.next();
-                if (!precompileOnly) {
-                    processTarget(crawler, target);
+                if (!this.precompileOnly) {
+                    this.processTarget(this.crawler, target);
 								}
             }
         }
-        
+
         if (this.checksumsURI != null) {
-            writeChecksumFile();
+            this.writeChecksumFile();
         }
-        
-        if (log.isInfoEnabled()) {
-              log.info(
+
+        if (this.log.isInfoEnabled()) {
+              this.log.info(
                   "  Memory used: "
                       + (Runtime.getRuntime().totalMemory()
                           - Runtime.getRuntime().freeMemory()));
-              log.info(
+              this.log.info(
                   "  Processed, Translated & Left: "
-                      + crawler.getProcessedCount()
+                      + this.crawler.getProcessedCount()
                       + ", "
-                      + crawler.getTranslatedCount()
+                      + this.crawler.getTranslatedCount()
                       + ", "
-                      + crawler.getRemainingCount());
+                      + this.crawler.getRemainingCount());
           }
     }
 
@@ -419,7 +420,7 @@
 
         if (target.confirmExtensions()) {
             if (!crawler.hasTranslatedLink(target)) {
-                final String mimeType = getType(target.getDeparameterizedSourceURI(), target.getParameters());
+                final String mimeType = this.getType(target.getDeparameterizedSourceURI(), target.getParameters());
                 target.setMimeType(mimeType);
                 crawler.addTranslatedLink(target);
             }
@@ -432,7 +433,7 @@
 
         // Process links
         final HashMap translatedLinks = new HashMap();
-        if (target.followLinks() && target.confirmExtensions() && isCrawlablePage(target)) {
+        if (target.followLinks() && target.confirmExtensions() && this.isCrawlablePage(target)) {
             final Iterator i =
                 this.getLinks(target.getDeparameterizedSourceURI(), target.getParameters()).iterator();
 
@@ -441,22 +442,22 @@
                 Target linkTarget = target.getDerivedTarget(linkURI);
 
                 if (linkTarget == null) {
-                    pageSkipped(linkURI, "link does not share same root as parent");
+                    this.pageSkipped(linkURI, "link does not share same root as parent");
                     continue;
                 }
 
-                if (!isIncluded(linkTarget.getSourceURI())) {
-                    pageSkipped(linkTarget.getSourceURI(), "matched include/exclude rules");
+                if (!this.isIncluded(linkTarget.getSourceURI())) {
+                    this.pageSkipped(linkTarget.getSourceURI(), "matched include/exclude rules");
                     continue;
                 }
 
                 if (!crawler.hasTranslatedLink(linkTarget)) {
                     try {
                         final String mimeType =
-                                getType(linkTarget.getDeparameterizedSourceURI(), linkTarget.getParameters());
+                                this.getType(linkTarget.getDeparameterizedSourceURI(), linkTarget.getParameters());
                         linkTarget.setMimeType(mimeType);
                         crawler.addTranslatedLink(linkTarget);
-                        log.info("  Link translated: " + linkTarget.getSourceURI());
+                        this.log.info("  Link translated: " + linkTarget.getSourceURI());
                         if (crawler.addTarget(linkTarget)) {
                             newLinkCount++;
                         }
@@ -485,20 +486,20 @@
             DelayedOutputStream output = new DelayedOutputStream();
             try {
                 List gatheredLinks;
-                if (!target.confirmExtensions() && target.followLinks() && isCrawlablePage(target)) {
+                if (!target.confirmExtensions() && target.followLinks() && this.isCrawlablePage(target)) {
                     gatheredLinks = new ArrayList();
                 } else {
                     gatheredLinks = null;
                 }
 
                 final TreeMap headers = new TreeMap();
-                headers.put("user-agent", userAgent);
-                headers.put("accept", accept);
+                headers.put("user-agent", this.userAgent);
+                headers.put("accept", this.accept);
 
                 status =
-                    getPage(
+                    this.getPage(
                         target.getDeparameterizedSourceURI(),
-                        getLastModified(target),
+                        this.getLastModified(target),
                         target.getParameters(),
                         headers,
                         target.confirmExtensions() ? translatedLinks : null,
@@ -516,12 +517,12 @@
                         Target linkTarget = target.getDerivedTarget(linkURI);
 
                         if (linkTarget == null) {
-                            pageSkipped(linkURI, "link does not share same root as parent");
+                            this.pageSkipped(linkURI, "link does not share same root as parent");
                             continue;
                         }
 
-                        if (!isIncluded(linkTarget.getSourceURI())) {
-                            pageSkipped(linkTarget.getSourceURI(), "matched include/exclude rules");
+                        if (!this.isIncluded(linkTarget.getSourceURI())) {
+                            this.pageSkipped(linkTarget.getSourceURI(), "matched include/exclude rules");
                             continue;
                         }
                         if (crawler.addTarget(linkTarget)) {
@@ -540,17 +541,17 @@
             } finally {
                 if (output != null && status != -1) {
 
-                    ModifiableSource source = getSource(target);
+                    ModifiableSource source = this.getSource(target);
                     try {
                         pageSize = output.size();
-                        
-                        if (this.checksumsURI == null || !isSameContent(output, target)) {
+
+                        if (this.checksumsURI == null || !this.isSameContent(output, target)) {
                             OutputStream stream = source.getOutputStream();
                             output.setFileOutputStream(stream);
                             output.flush();
                             output.close();
-                            pageGenerated(target.getSourceURI(), 
-                                          target.getAuthlessDestURI(), 
+                            this.pageGenerated(target.getSourceURI(),
+                                          target.getAuthlessDestURI(),
                                           pageSize,
                                           linkCount,
                                           newLinkCount,
@@ -559,17 +560,17 @@
                                           System.currentTimeMillis()- startTimeMillis);
                         } else {
                             output.close();
-                            pageSkipped(target.getSourceURI(), "Page not changed");
+                            this.pageSkipped(target.getSourceURI(), "Page not changed");
                         }
                     } catch (IOException ioex) {
-                        log.warn(ioex.toString());
+                        this.log.warn(ioex.toString());
                     } finally {
-                        releaseSource(source);
+                        this.releaseSource(source);
                     }
                 }
             }
         } catch (Exception rnfe) {
-            log.warn("Could not process URI: " + target.getSourceURI());
+            this.log.warn("Could not process URI: " + target.getSourceURI());
             rnfe.printStackTrace();
             this.sendBrokenLinkWarning(target.getSourceURI(), "URI not found: "+rnfe.getMessage());
         }
@@ -583,12 +584,12 @@
      */
     private void resourceUnavailable(Target target)
         throws IOException, ProcessingException {
-        if (brokenLinkGenerate) {
+        if (this.brokenLinkGenerate) {
             //Why decode this URI now?
             //String brokenFile = NetUtils.decodePath(destinationURI);
 
-            if (brokenLinkExtension != null) {
-                target.setExtraExtension(brokenLinkExtension);
+            if (this.brokenLinkExtension != null) {
+                target.setExtraExtension(this.brokenLinkExtension);
             }
             SimpleNotifyingBean n = new SimpleNotifyingBean(this);
             n.setType("resource-not-found");
@@ -599,7 +600,7 @@
             n.addExtraDescription(Notifying.EXTRA_REQUESTURI, target.getSourceURI());
             n.addExtraDescription("missing-file", target.getSourceURI());
 
-            ModifiableSource source = getSource(target);
+            ModifiableSource source = this.getSource(target);
             OutputStream stream = null;
             PrintStream out = null;
             try {
@@ -609,7 +610,7 @@
             } finally {
                 if (out != null) out.close();
                 if (stream != null) stream.close();
-                releaseSource(source);
+                this.releaseSource(source);
             }
         }
     }
@@ -617,9 +618,9 @@
     public ModifiableSource getSource(Target target)
         throws IOException, ProcessingException {
         final String finalDestinationURI = target.getDestinationURI();
-        Source src = sourceResolver.resolveURI(finalDestinationURI);
+        Source src = this.sourceResolver.resolveURI(finalDestinationURI);
         if (!(src instanceof ModifiableSource)) {
-            sourceResolver.release(src);
+            this.sourceResolver.release(src);
             throw new ProcessingException(
                 "Source is not Modifiable: " + finalDestinationURI);
         }
@@ -627,25 +628,25 @@
     }
 
     public long getLastModified(Target target) throws IOException, ProcessingException {
-        Source src = getSource(target);
+        Source src = this.getSource(target);
         long lastModified = src.getLastModified();
         this.releaseSource(src);
         return lastModified;
     }
 
     public void releaseSource(Source source) {
-        sourceResolver.release(source);
+        this.sourceResolver.release(source);
     }
     private boolean isIncluded(String uri) {
         boolean included;
         Iterator i;
         HashMap map = new HashMap();
 
-        if (includePatterns.size() == 0) {
+        if (this.includePatterns.size() == 0) {
             included = true;
         } else {
             included = false;
-            i = includePatterns.iterator();
+            i = this.includePatterns.iterator();
             while (i.hasNext()){
                 final String pattern = (String)i.next();
                 if (WildcardMatcherHelper.match(pattern, uri) != null ) {
@@ -654,8 +655,8 @@
                 }
             }
         }
-        if (excludePatterns.size() != 0) {
-            i = excludePatterns.iterator();
+        if (this.excludePatterns.size() != 0) {
+            i = this.excludePatterns.iterator();
             while (i.hasNext()) {
                 final String pattern = (String)i.next();
                 if (WildcardMatcherHelper.match(pattern, uri) != null ) {
@@ -667,23 +668,23 @@
         return included;
     }
     private boolean isCrawlablePage(Target target) {
-        if (includeLinkExtensions == null) {
+        if (this.includeLinkExtensions == null) {
             return true;
         } else {
-            return includeLinkExtensions.contains(target.getExtension());
+            return this.includeLinkExtensions.contains(target.getExtension());
         }
     }
 
     /* NB. This is a temporary solution - it may well be replaced by storing the checksum info
-     *     in the XML 'report' file, along with details of what pages were created, etc. 
-     */ 
+     *     in the XML 'report' file, along with details of what pages were created, etc.
+     */
     private void readChecksumFile() throws Exception {
-        checksums = new HashMap();
+        this.checksums = new HashMap();
         InputStream is = null;
         InputStreamReader isr = null;
         BufferedReader reader = null;
         try {
-            Source checksumSource = sourceResolver.resolveURI(checksumsURI);
+            Source checksumSource = this.sourceResolver.resolveURI(this.checksumsURI);
             is = checksumSource.getInputStream();
             isr = new InputStreamReader(is);
             reader = new BufferedReader(isr);
@@ -694,12 +695,12 @@
                 if (line.trim().startsWith("#") || line.trim().length() == 0) {
                     continue;
                 }
-                if (line.indexOf("\t") == -1) { 
-                    throw new ProcessingException("Missing tab at line " + lineNo + " of " + checksumsURI);
+                if (line.indexOf("\t") == -1) {
+                    throw new ProcessingException("Missing tab at line " + lineNo + " of " + this.checksumsURI);
                 }
                 String filename = line.substring(0, line.indexOf("\t"));
                 String checksum = line.substring(line.indexOf("\t") + 1);
-                checksums.put(filename, checksum);
+                this.checksums.put(filename, checksum);
             }
             reader.close();
         } catch (SourceNotFoundException e) {
@@ -712,16 +713,16 @@
     }
 
     private void writeChecksumFile() throws Exception {
-        Source checksumSource = sourceResolver.resolveURI(checksumsURI);
+        Source checksumSource = this.sourceResolver.resolveURI(this.checksumsURI);
         if (!(checksumSource instanceof ModifiableSource)) {
             throw new ProcessingException("Checksum file is not Modifiable:" + checksumSource);
         }
         ModifiableSource source = (ModifiableSource) checksumSource;
         PrintWriter writer = new PrintWriter(new OutputStreamWriter(source.getOutputStream()));
-        Iterator i = checksums.keySet().iterator();
+        Iterator i = this.checksums.keySet().iterator();
         while (i.hasNext()){
             String key = (String) i.next();
-            String checksum = (String) checksums.get(key);
+            String checksum = (String) this.checksums.get(key);
             writer.println(key + "\t" + checksum);
         }
         writer.close();
@@ -732,12 +733,12 @@
             MessageDigest md5 = MessageDigest.getInstance("MD5");
             md5.update(stream.getContent());
             String streamDigest = SourceUtil.encodeBASE64(new String(md5.digest()));
-            String targetDigest = (String)checksums.get(target.getSourceURI());
-            
+            String targetDigest = (String)this.checksums.get(target.getSourceURI());
+
             if (streamDigest.equals(targetDigest)) {
                 return true;
             } else {
-                checksums.put(target.getSourceURI(), streamDigest);
+                this.checksums.put(target.getSourceURI(), streamDigest);
                 return false;
             }
         } catch (NoSuchAlgorithmException e) {

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/CocoonComponentManager.java
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/CocoonComponentManager.java?view=diff&rev=540711&r1=540710&r2=540711
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/CocoonComponentManager.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/CocoonComponentManager.java Tue May 22 12:36:07 2007
@@ -56,7 +56,7 @@
  * @version CVS $Id$
  */
 public final class CocoonComponentManager extends ExcaliburComponentManager
-                                          implements SourceResolver {
+                                          implements SourceResolver, Component {
 
     /** The key used to store the current process environment */
     private static final String PROCESS_KEY = CocoonComponentManager.class.getName();
@@ -324,10 +324,10 @@
 
         if (role.equals(SourceResolver.ROLE)) {
             if (null == this.sourceResolver) {
-                if(wasDisposed) {
+                if(this.wasDisposed) {
                     // (BD) working on bug 27249: I think we could throw an Exception here, as
                     // the following call fails anyway, but I'm not sure enough ;-)
-                    getLogger().warn("Trying to lookup SourceResolver on disposed CocoonComponentManager");
+                    this.getLogger().warn("Trying to lookup SourceResolver on disposed CocoonComponentManager");
                 }
                 this.sourceResolver = (SourceResolver) super.lookup( role );
             }
@@ -511,12 +511,12 @@
      * Dispose
      */
     public void dispose() {
-        if (getLogger().isDebugEnabled()) {
-            getLogger().debug("CocoonComponentManager.dispose() called");
+        if (this.getLogger().isDebugEnabled()) {
+            this.getLogger().debug("CocoonComponentManager.dispose() called");
         }
 
         if (null != this.sourceResolver) {
-            super.release(this.sourceResolver);
+            super.release((Component)this.sourceResolver);
             // We cannot null out sourceResolver here yet as some other not
             // disposed yet components might still have unreleased sources,
             // and they will call {@link #release(Source)} during their
@@ -575,21 +575,21 @@
         // Note that at this point, we're not initialized and cannot do
         // lookups, so defer parental introductions to initialize().
         if (ParentAware.class.isAssignableFrom(clazz)) {
-            parentAwareComponents.add(role);
+            this.parentAwareComponents.add(role);
         }
     }
 
     public void initialize() throws Exception {
         super.initialize();
-        if (parentAwareComponents == null) {
+        if (this.parentAwareComponents == null) {
             throw new ComponentException(null, "CocoonComponentManager already initialized");
         }
         // Set parents for parentAware components
-        Iterator iter = parentAwareComponents.iterator();
+        Iterator iter = this.parentAwareComponents.iterator();
         while (iter.hasNext()) {
             String role = (String)iter.next();
-            getLogger().debug(".. "+role);
-            if ( parentManager != null && parentManager.hasComponent( role ) ) {
+            this.getLogger().debug(".. "+role);
+            if ( this.parentManager != null && this.parentManager.hasComponent( role ) ) {
                 // lookup new component
                 Component component = null;
                 try {
@@ -602,7 +602,7 @@
                 }
             }
         }
-        parentAwareComponents = null;  // null to save memory, and catch logic bugs.
+        this.parentAwareComponents = null;  // null to save memory, and catch logic bugs.
     }
 
     /**
@@ -632,7 +632,7 @@
             Object oldStack = environmentStack.get();
             CocoonComponentManager.environmentStack.set(this.parentStack);
             try {
-                doRun();
+                this.doRun();
             } finally {
                 // Restore the previous stack
                 CocoonComponentManager.environmentStack.set(oldStack);
@@ -662,10 +662,10 @@
     }
 
     Map getGlobalRequestLifcecycleComponents() {
-        Map m = (Map)environment.getAttribute(GlobalRequestLifecycleComponent.class.getName());
+        Map m = (Map)this.environment.getAttribute(GlobalRequestLifecycleComponent.class.getName());
         if ( m == null ) {
             m = new HashMap();
-            environment.setAttribute(GlobalRequestLifecycleComponent.class.getName(), m);
+            this.environment.setAttribute(GlobalRequestLifecycleComponent.class.getName(), m);
         }
         return m;
     }
@@ -686,8 +686,8 @@
             this.requestLifecycleComponents.clear();
         }
 
-        for (int i = 0; i < autoreleaseComponents.size(); i++) {
-            final Object[] o = (Object[])autoreleaseComponents.get(i);
+        for (int i = 0; i < this.autoreleaseComponents.size(); i++) {
+            final Object[] o = (Object[])this.autoreleaseComponents.get(i);
             final Component component = (Component)o[0];
             if (o[1] instanceof ComponentManager) {
                 ((ComponentManager)o[1]).release( component );

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/modules/input/LocateResource.java
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/modules/input/LocateResource.java?view=diff&rev=540711&r1=540710&r2=540711
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/modules/input/LocateResource.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/modules/input/LocateResource.java Tue May 22 12:36:07 2007
@@ -5,9 +5,9 @@
  * 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.
@@ -16,6 +16,7 @@
  */
 package org.apache.cocoon.components.modules.input;
 
+import org.apache.avalon.framework.component.Component;
 import org.apache.avalon.framework.component.ComponentException;
 import org.apache.avalon.framework.component.ComponentManager;
 import org.apache.avalon.framework.component.Composable;
@@ -34,26 +35,26 @@
 
 /**
  * Locate a resource in a resource tree. Any attribute name is interpreted as a
- * URI with the last part being the resource name unless it ends with a slash. 
+ * URI with the last part being the resource name unless it ends with a slash.
  * The URI is checked if the resource exists and the URI is returned. If the
  * resource does not exist, the URI is shortened until the resource name is found
  * and the new URI is returned. If no resource with the given name exists, null
- * is returned. 
- * 
+ * is returned.
+ *
  * <p>A use case is to locate the closest menu file or when moving a site from
  * a filesystem path == URL system from a httpd to Cocoon and provide similar
  * functions to .htaccess files.</p>
- * 
+ *
  * <p>Example: for context:/some/path/to/a/file.xml the following URIs
  * are tested: context:/some/path/to/a/file.xml, context:/some/path/to/file.xml,
  * context:/some/path/file.xml, context:/some/file.xml, and context:/file.xml.
  * For the attribute name context:/some/path/foo/ tests context:/some/path/foo/,
- * context:/some/path/, context:/some/, and context:/ are tested.</p> 
- * 
- * <p>The getAttribute() method will return the URI for the first match while 
- * getAttributeValues() will return an array of all existing paths. 
+ * context:/some/path/, context:/some/, and context:/ are tested.</p>
+ *
+ * <p>The getAttribute() method will return the URI for the first match while
+ * getAttributeValues() will return an array of all existing paths.
  * getAttributeNames() will return an Iterator to an empty collection.</p>
- * 
+ *
  * @author <a href="mailto:haul@apache.org">Christian Haul</a>
  * @version $Id$
  */
@@ -80,7 +81,7 @@
     /**
      * Remove one path element from the URL unless minimum length has
      * been reached.
-     * 
+     *
      * @param urlstring
      * @param minLen
      * @return shortened URI
@@ -94,7 +95,7 @@
         return urlstring;
     }
 
-    /** 
+    /**
      * if the url does not end with a "/", keep the last part in
      * order to add it later again after traversing up
      */
@@ -113,7 +114,7 @@
      * Locate a resource with the given URL consisting of urlstring + filename.
      * The filename is appended each time the path is shortened. Returns the first
      * existing occurance.
-     * 
+     *
      * @param urlstring
      * @param filename
      * @param minLen
@@ -141,7 +142,7 @@
                     resolver.release(src);
                 }
                 if (!found) {
-                    urlstring = shortenURI(urlstring, minLen);
+                    urlstring = this.shortenURI(urlstring, minLen);
                 }
             }
         } catch (ComponentException e1) {
@@ -149,7 +150,7 @@
                 this.getLogger().error("Exception obtaining source resolver ", e1);
         } finally {
             if (resolver != null) {
-                this.manager.release(resolver);
+                this.manager.release((Component)resolver);
             }
         }
         return (found ? urlstring : null);
@@ -170,13 +171,13 @@
         throws ConfigurationException {
 
         String urlstring = name;
-        String filename = extractFilename(urlstring);
-        int minLen = calculateMinLen(name);
+        String filename = this.extractFilename(urlstring);
+        int minLen = this.calculateMinLen(name);
         if (filename.length() > 0) {
-            urlstring = shortenURI(urlstring, minLen);
+            urlstring = this.shortenURI(urlstring, minLen);
         }
 
-        String result = locateResource(urlstring, filename, minLen);
+        String result = this.locateResource(urlstring, filename, minLen);
         if (result != null) {
             result += filename;
         }
@@ -203,10 +204,10 @@
 
         Vector uris = null;
         String urlstring = name;
-        String filename = extractFilename(urlstring);
-        int minLen = calculateMinLen(name);
+        String filename = this.extractFilename(urlstring);
+        int minLen = this.calculateMinLen(name);
         if (filename.length() > 0) {
-            urlstring = shortenURI(urlstring, minLen);
+            urlstring = this.shortenURI(urlstring, minLen);
         }
 
         while (urlstring != null && urlstring.length() > minLen) {
@@ -217,7 +218,7 @@
                 if (this.getLogger().isDebugEnabled())
                     this.getLogger().debug("-> located " + name + " @ " + urlstring + filename);
                 uris.add(urlstring + filename);
-                urlstring = shortenURI(urlstring, minLen);
+                urlstring = this.shortenURI(urlstring, minLen);
             }
         }
         return (uris == null ? null : uris.toArray());



Mime
View raw message