cziegeler    2003/01/09 06:58:37

  Modified:    src/scratchpad/src/org/apache/cocoon/components/source/impl
                        BlobSource.java BlobSourceFactory.java
                        XMLDBSourceFactory.java XMLDBSource.java
  Log:
  Fixing compose in scratchpad sources
  
  Revision  Changes    Path
  1.5       +2 -2      
xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/impl/BlobSource.java
  
  Index: BlobSource.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/impl/BlobSource.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- BlobSource.java   9 Jan 2003 14:45:51 -0000       1.4
  +++ BlobSource.java   9 Jan 2003 14:58:35 -0000       1.5
  @@ -175,7 +175,7 @@
        * Set the current <code>ComponentManager</code> instance used by this
        * <code>Composable</code>.
        */
  -    public void compose(ComponentManager manager) throws ComponentException {
  +    public void compose(ComponentManager manager)  {
           this.manager = manager;
       }
   
  
  
  
  1.3       +18 -3     
xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/impl/BlobSourceFactory.java
  
  Index: BlobSourceFactory.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/impl/BlobSourceFactory.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BlobSourceFactory.java    9 Jan 2003 14:45:51 -0000       1.2
  +++ BlobSourceFactory.java    9 Jan 2003 14:58:35 -0000       1.3
  @@ -55,6 +55,9 @@
   
   package org.apache.cocoon.components.source.impl;
   
  +import org.apache.avalon.framework.component.ComponentException;
  +import org.apache.avalon.framework.component.ComponentManager;
  +import org.apache.avalon.framework.component.Composable;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.avalon.framework.thread.ThreadSafe;
   
  @@ -75,15 +78,20 @@
    */
   public class BlobSourceFactory
     extends AbstractLogEnabled
  -  implements SourceFactory, ThreadSafe {
  +  implements Composable, SourceFactory, ThreadSafe {
       
  +    /** The component manager instance */
  +    protected ComponentManager manager;
  +
       /**
        * Get a <code>Source</code> object.
        * @param parameters This is optional.
        */
       public Source getSource(String location, Map parameters)
           throws MalformedURLException, IOException, SourceException {
  -        return new BlobSource(location);
  +        BlobSource blob = new BlobSource(location);
  +        blob.compose(this.manager);
  +        return blob;
       }
   
       /**
  @@ -97,5 +105,12 @@
               // simply do nothing
           }
       }
  +     /**
  +      * @see 
org.apache.avalon.framework.component.Composable#compose(org.apache.avalon.framework.component.ComponentManager)
  +      */
  +     public void compose(ComponentManager manager) throws ComponentException {
  +        this.manager = manager;
  +     }
  +
   }
       
  
  
  
  1.4       +19 -3     
xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/impl/XMLDBSourceFactory.java
  
  Index: XMLDBSourceFactory.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/impl/XMLDBSourceFactory.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- XMLDBSourceFactory.java   9 Jan 2003 14:45:51 -0000       1.3
  +++ XMLDBSourceFactory.java   9 Jan 2003 14:58:35 -0000       1.4
  @@ -56,6 +56,9 @@
   import java.util.HashMap;
   import java.util.Map;
   
  +import org.apache.avalon.framework.component.ComponentException;
  +import org.apache.avalon.framework.component.ComponentManager;
  +import org.apache.avalon.framework.component.Composable;
   import org.apache.avalon.framework.configuration.Configurable;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
  @@ -79,7 +82,10 @@
    */
   public final class XMLDBSourceFactory
       extends AbstractLogEnabled
  -    implements SourceFactory, Configurable {
  +    implements SourceFactory, Composable, Configurable {
  +
  +    /** The component manager instance */
  +    protected ComponentManager manager;
   
       /** The driver implementation class */
       protected String driver;
  @@ -166,7 +172,10 @@
                                         type + " \" database type, please check the 
configuration");
           }
   
  -        return new XMLDBSource(location);
  +        XMLDBSource source = new XMLDBSource(location);
  +        source.compose(this.manager);
  +
  +        return source;
       }
       
       /**
  @@ -179,6 +188,13 @@
               }
               // simply do nothing
           }
  +    }
  +
  +    /**
  +     * @see 
org.apache.avalon.framework.component.Composable#compose(org.apache.avalon.framework.component.ComponentManager)
  +     */
  +    public void compose(ComponentManager manager) throws ComponentException {
  +        this.manager = manager;
       }
   
   }
  
  
  
  1.4       +2 -2      
xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/impl/XMLDBSource.java
  
  Index: XMLDBSource.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/impl/XMLDBSource.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- XMLDBSource.java  9 Jan 2003 14:45:51 -0000       1.3
  +++ XMLDBSource.java  9 Jan 2003 14:58:35 -0000       1.4
  @@ -170,7 +170,7 @@
        *
        * @throws ComponentException
        */
  -    public void compose(ComponentManager manager) throws ComponentException {
  +    public void compose(ComponentManager manager)  {
           this.manager = manager;
       }
   
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to