cziegeler    2003/01/09 07:21:49

  Modified:    src/scratchpad/src/org/apache/cocoon/components/source/impl
                        SlideSourceFactory.java SlideSource.java
  Log:
  Fixing SlideSource
  
  Revision  Changes    Path
  1.5       +30 -3     
xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/impl/SlideSourceFactory.java
  
  Index: SlideSourceFactory.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/impl/SlideSourceFactory.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SlideSourceFactory.java   7 Jan 2003 23:56:14 -0000       1.4
  +++ SlideSourceFactory.java   9 Jan 2003 15:21:49 -0000       1.5
  @@ -64,6 +64,9 @@
   import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.component.ComponentSelector;
   import org.apache.avalon.framework.component.Composable;
  +import org.apache.avalon.framework.context.Context;
  +import org.apache.avalon.framework.context.ContextException;
  +import org.apache.avalon.framework.context.Contextualizable;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.avalon.framework.thread.ThreadSafe;
   
  @@ -83,10 +86,11 @@
    * @version $Id$
    */
   public class SlideSourceFactory extends AbstractLogEnabled
  -  implements SourceFactory, ThreadSafe, Composable {
  +  implements SourceFactory, ThreadSafe, Composable, Contextualizable {
   
       /** The component manager instance */
       private ComponentManager manager = null;
  +     private Context context;
   
       /**
        * Set the current <code>ComponentManager</code> instance used by this
  @@ -166,8 +170,12 @@
               if (sliderepository.getDomain().getNamespaceToken(namespace)==null)
                   throw new SourceException("Repository with the namespace 
'"+namespace+"' couldn't be found");
   
  -            return new 
SlideSource(sliderepository.getDomain().getNamespaceToken(namespace), 
  +            SlideSource source = new 
SlideSource(sliderepository.getDomain().getNamespaceToken(namespace), 
                                      protocol, location, credential, revision, 
branch);
  +            source.contextualize(this.context);
  +            source.compose(this.manager);
  +            
  +            return source;
   
           } catch (ComponentException ce) {
               getLogger().error("Could not lookup for component.", ce);
  @@ -183,5 +191,24 @@
   
           return null;
       }
  +
  +    /**
  +     * Release a {@link Source} object.
  +     */
  +    public void release( Source source ) {
  +        if ( null != source ) {
  +            if ( this.getLogger().isDebugEnabled() ) {
  +                this.getLogger().debug("Releasing source " + source.getSystemId());
  +            }
  +            // simply do nothing
  +        }
  +    }
  +     /**
  +      * @see 
org.apache.avalon.framework.context.Contextualizable#contextualize(org.apache.avalon.framework.context.Context)
  +      */
  +     public void contextualize(Context context) throws ContextException {
  +        this.context = context;
  +     }
  +
   }
   
  
  
  
  1.25      +8 -9      
xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/impl/SlideSource.java
  
  Index: SlideSource.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/impl/SlideSource.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- SlideSource.java  9 Jan 2003 14:35:25 -0000       1.24
  +++ SlideSource.java  9 Jan 2003 15:21:49 -0000       1.25
  @@ -162,7 +162,7 @@
       private CredentialsToken credToken;
   
       /** Slide token. */
  -    SlideToken slideToken;
  +    private SlideToken slideToken;
   
       /** Pseudo protocol */
       private String protocol = "slide";
  @@ -243,7 +243,7 @@
        * @param context the context
        * @throws ContextException if context is invalid
        */
  -    public void contextualize(Context context) throws ContextException {
  +    public void contextualize(Context context)  {
           this.context = context;
       }
   
  @@ -1519,13 +1519,12 @@
               throw new SourceException("Could not retrieve revision descriptor", se);
           }
       }
  -    /* (non-Javadoc)
  -     * @see org.apache.excalibur.source.Source#getProtocol()
  -     */
  -    public String getProtocol()
  -    {
  -        return null;
  -    }
  +     /**
  +      * @see org.apache.excalibur.source.Source#getProtocol()
  +      */
  +     public String getProtocol() {
  +             return this.protocol;
  +     }
   
   }
   
  
  
  

----------------------------------------------------------------------
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