You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by bl...@apache.org on 2003/10/16 16:57:36 UTC

cvs commit: cocoon-2.2/src/java/org/apache/cocoon/components/flow AbstractInterpreter.java

bloritsch    2003/10/16 07:57:36

  Modified:    src/java/org/apache/cocoon/components/flow/javascript/fom
                        FOM_Cocoon.java FOM_WebContinuation.java
               src/java/org/apache/cocoon/components/flow/javascript
                        JSCocoon.java JSWebContinuation.java
               src/java/org/apache/cocoon/components/flow
                        AbstractInterpreter.java
  Log:
  Update to Serviceable contracts
  
  Revision  Changes    Path
  1.14      +83 -84    cocoon-2.2/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_Cocoon.java
  
  Index: FOM_Cocoon.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_Cocoon.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- FOM_Cocoon.java	15 Oct 2003 17:04:50 -0000	1.13
  +++ FOM_Cocoon.java	16 Oct 2003 14:57:36 -0000	1.14
  @@ -59,9 +59,8 @@
   import java.util.Locale;
   import java.util.Map;
   
  -import org.apache.avalon.framework.component.Component;
  -import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.logger.Logger;
  +import org.apache.avalon.framework.service.ServiceManager;
   import org.apache.cocoon.components.flow.ContinuationsManager;
   import org.apache.cocoon.components.flow.WebContinuation;
   import org.apache.cocoon.components.flow.Interpreter.Argument;
  @@ -82,7 +81,7 @@
   /**
    * Implementation of FOM (Flow Object Model).
    *
  - * @since 2.1 
  + * @since 2.1
    * @author <a href="mailto:coliver.at.apache.org">Christopher Oliver</a>
    * @author <a href="mailto:reinhard.at.apache.org">Reinhard P�tz</a>
    * @version CVS $Id$
  @@ -93,7 +92,7 @@
       private FOM_JavaScriptInterpreter interpreter;
   
       private Environment environment;
  -    private ComponentManager componentManager;
  +    private ServiceManager serviceManager;
       private Logger logger;
   
       private FOM_Request request;
  @@ -122,19 +121,19 @@
       }
   
       void setup(FOM_JavaScriptInterpreter interp,
  -               Environment env, 
  -               ComponentManager manager,
  -               Logger logger) {
  +                      Environment env,
  +                      ServiceManager manager,
  +                      Logger logger) {
           this.interpreter = interp;
           this.environment = env;
  -        this.componentManager = manager;
  +        this.serviceManager = manager;
           this.logger = logger;
       }
   
       void invalidate() {
           // Clear the scope attribute
           this.getRequest().removeAttribute(FOM_JavaScriptFlowHelper.FOM_SCOPE);
  -        
  +
           // Cleanup everything
           this.request = null;
           this.response = null;
  @@ -142,32 +141,32 @@
           this.context = null;
           this.log = null;
           this.logger = null;
  -        this.componentManager = null;
  +        this.serviceManager = null;
           this.environment = null;
           this.interpreter = null;
       }
   
   
       private FOM_WebContinuation forwardTo(String uri, Object bizData,
  -                                          Continuation continuation) 
  +                                          Continuation continuation)
           throws Exception {
           WebContinuation wk = null;
           if (continuation != null) {
               ContinuationsManager contMgr = (ContinuationsManager)
  -                componentManager.lookup(ContinuationsManager.ROLE);
  -            wk = lastContinuation = 
  +                serviceManager.lookup(ContinuationsManager.ROLE);
  +            wk = lastContinuation =
                   contMgr.createWebContinuation(continuation,
                                                 lastContinuation,
                                                 0,
                                                 null);
           }
  -        
  +
           String redUri = uri;
  -        
  +
           FOM_WebContinuation fom_wk =
               new FOM_WebContinuation(wk);
           fom_wk.setParentScope(getParentScope());
  -        fom_wk.setPrototype(getClassPrototype(getParentScope(), 
  +        fom_wk.setPrototype(getClassPrototype(getParentScope(),
                                                 fom_wk.getClassName()));
           interpreter.forwardTo(getParentScope(), this, redUri,
                                 bizData, fom_wk, environment);
  @@ -182,23 +181,23 @@
           return result;
       }
   
  -    public FOM_WebContinuation jsFunction_sendPage(String uri, 
  -                                                   Object obj, 
  -                                                   Object continuation) 
  +    public FOM_WebContinuation jsFunction_sendPage(String uri,
  +                                                   Object obj,
  +                                                   Object continuation)
           throws Exception {
  -        return forwardTo(uri, obj, (Continuation)unwrap(continuation)); 
  +        return forwardTo(uri, obj, (Continuation)unwrap(continuation));
       }
  -                                    
  +
   
       public void jsFunction_processPipelineTo(String uri,
                                                Object map,
  -                                             Object outputStream) 
  +                                             Object outputStream)
           throws Exception {
           if (!(unwrap(outputStream) instanceof OutputStream)) {
               throw new JavaScriptException("expected a java.io.OutputStream instead of " + outputStream);
           }
  -        interpreter.process(getParentScope(), this, uri, map, 
  -                            (OutputStream)unwrap(outputStream), 
  +        interpreter.process(getParentScope(), this, uri, map,
  +                            (OutputStream)unwrap(outputStream),
                               environment);
       }
   
  @@ -212,39 +211,39 @@
    designed in the future. It has been postponed because we think
    there are more important things to do at the moment, but these
    are left here to indicate that they are planned.
  - 
  -    public void jsFunction_addEventListener(String eventName, 
  +
  +    public void jsFunction_addEventListener(String eventName,
                                               Object function) {
           // what is this?
       }
  -    
  +
       public void jsFunction_removeEventListener(String eventName,
                                                  Object function) {
           // what is this?
       }
  -    
  +
   */
   
       /**
        * Access components.
  -     * 
  +     *
        * TODO: Do we want to restrict the access of sitemap components? (RP)
        * TODO: Do we want to raise an error or return null? (RP)
  -     */  
  -    public Object jsFunction_getComponent(String id) 
  -        throws Exception { 
  -        return componentManager.lookup(id);
  +     */
  +    public Object jsFunction_getComponent(String id)
  +        throws Exception {
  +        return serviceManager.lookup(id);
       }
  -    
  +
       /**
        * Release pooled components.
  -     * 
  -     * @param component - an <code>Object</code> that is an instance 
  +     *
  +     * @param component - an <code>Object</code> that is an instance
        * of <code>org.apache.avalon.framework.component.Component</code>
        */
       public void jsFunction_releaseComponent( Object component ) throws Exception {
           try {
  -            this.componentManager.release( (Component) unwrap(component) );
  +            this.serviceManager.release( unwrap(component) );
           } catch( ClassCastException cce ) {
               throw new JavaScriptException( "Only components can be released!" );
           }
  @@ -257,17 +256,17 @@
        * @return an <code>Object</code> value
        * @exception JavaScriptException if an error occurs
        */
  -    public Object jsFunction_load( String filename ) 
  +    public Object jsFunction_load( String filename )
           throws Exception {
  -        org.mozilla.javascript.Context cx = 
  +        org.mozilla.javascript.Context cx =
               org.mozilla.javascript.Context.getCurrentContext();
           Scriptable scope = getParentScope();
  -        Script script = interpreter.compileScript( cx, 
  +        Script script = interpreter.compileScript( cx,
                                                      environment,
                                                      filename );
           return script.exec( cx, scope );
  -    }    
  -        
  +    }
  +
       public static class FOM_Request extends ScriptableObject {
   
           Request request;
  @@ -279,7 +278,7 @@
           public FOM_Request(Object request) {
               this.request = (Request)unwrap(request);
           }
  -		
  +
           public String getClassName() {
               return "FOM_Request";
           }
  @@ -335,7 +334,7 @@
               return request.getCharacterEncoding();
           }
   
  -        public void jsFunction_setCharacterEncoding(String value) 
  +        public void jsFunction_setCharacterEncoding(String value)
               throws Exception {
               request.setCharacterEncoding(value);
           }
  @@ -363,47 +362,47 @@
           public String jsFunction_getAuthType() {
               return request.getAuthType();
           }
  -        
  +
           public String jsFunction_getProtocol() {
               return request.getProtocol();
           }
  -        
  +
           public String jsFunction_getServerName() {
               return request.getServerName();
           }
  -        
  +
           public String jsFunction_getRemoteAddr() {
               return request.getRemoteAddr();
           }
  -        
  +
           public String jsFunction_getRemoteHost() {
               return request.getRemoteHost();
           }
  -        
  +
           public int jsFunction_getServerPort() {
               return request.getServerPort();
           }
  -        
  +
           public String jsFunction_getScheme() {
               return request.getScheme();
           }
  -        
  +
           public String jsFunction_getMethod() {
               return request.getMethod();
           }
  -        
  +
           public boolean jsFunction_isSecure() {
               return request.isSecure();
           }
  -        
  +
           public Locale jsFunction_getLocale() {
               return request.getLocale();
           }
  -        
  +
           public Enumeration jsFunction_getLocales() {
               return request.getLocales();
           }
  -        
  +
           public FOM_Cookie[] jsFunction_getCookies() {
               Cookie[] cookies = request.getCookies();
               FOM_Cookie[] FOM_cookies = new FOM_Cookie[cookies!=null ? cookies.length : 0];
  @@ -415,11 +414,11 @@
               }
               return FOM_cookies;
           }
  -        
  +
           public Scriptable jsGet_cookies() {
               return Context.getCurrentContext().newArray(getParentScope(), jsFunction_getCookies());
           }
  -            
  +
           public FOM_Cookie jsFunction_getCookie(String name) {
               Object     cookie  = request.getCookieMap().get(name);
               FOM_Cookie fcookie = null;
  @@ -430,19 +429,19 @@
               }
               return fcookie;
           }
  -        
  +
           public String jsFunction_getHeader(String name) {
               return request.getHeader(name);
           }
  -        
  +
           public Enumeration jsFunction_getHeaders(String name) {
               return request.getHeaders(name);
           }
  -        
  +
           public Enumeration jsFunction_getHeaderNames() {
               return request.getHeaderNames();
           }
  -        
  +
           public Principal jsFunction_getUserPrincipal() {
               return request.getUserPrincipal();
           }
  @@ -546,14 +545,14 @@
           }
   
           public Object jsFunction_createCookie(String name, String value) {
  -            FOM_Cookie result = 
  +            FOM_Cookie result =
                   new FOM_Cookie(response.createCookie(name, value));
               result.setParentScope(getParentScope());
               result.setPrototype(getClassPrototype(this, result.getClassName()));
               return result;
           }
   
  -        public void jsFunction_addCookie(Object cookie) 
  +        public void jsFunction_addCookie(Object cookie)
               throws JavaScriptException {
               if (!(cookie instanceof FOM_Cookie)) {
                   throw new JavaScriptException("expected a Cookie instead of " + cookie);
  @@ -619,7 +618,7 @@
           public Object jsFunction_getAttribute(String name) {
               return session.getAttribute(name);
           }
  -        
  +
           public void jsFunction_setAttribute(String name, Object value) {
               session.setAttribute(name, value);
           }
  @@ -721,7 +720,7 @@
               }
               return value;
           }
  -        
  +
           /* TODO: Vote on the inclusion of this method
           public String jsFunction_getRealPath(String path) {
           	return context.getRealPath(path);
  @@ -743,19 +742,19 @@
           public String getClassName() {
               return "FOM_Log";
           }
  -        
  +
           public void jsFunction_debug(String message) {
               logger.debug(message);
           }
  -        
  +
           public void jsFunction_info(String message) {
               logger.info(message);
           }
  -        
  +
           public void jsFunction_warn(String message) {
               logger.warn(message);
           }
  -        
  +
           public void jsFunction_error(String message) {
               logger.error(message);
           }
  @@ -801,7 +800,7 @@
               return null;
           }
           Map objectModel = environment.getObjectModel();
  -        response = 
  +        response =
               new FOM_Response(ObjectModelHelper.getResponse(objectModel));
           response.setParentScope(getParentScope());
           response.setPrototype(getClassPrototype(this, "FOM_Response"));
  @@ -823,7 +822,7 @@
               return context;
           }
           Map objectModel = environment.getObjectModel();
  -        context = 
  +        context =
               new FOM_Context(ObjectModelHelper.getContext(objectModel));
           context.setParentScope(getParentScope());
           context.setPrototype(getClassPrototype(this, "FOM_Context"));
  @@ -839,7 +838,7 @@
               return null;
           }
           Map objectModel = environment.getObjectModel();
  -        session = 
  +        session =
               new FOM_Session(ObjectModelHelper.getRequest(objectModel).getSession(true));
           session.setParentScope(getParentScope());
           session.setPrototype(getClassPrototype(this, "FOM_Session"));
  @@ -849,7 +848,7 @@
       /**
        * Get Sitemap parameters
        *
  -     * @return a <code>Scriptable</code> value whose properties represent 
  +     * @return a <code>Scriptable</code> value whose properties represent
        * the Sitemap parameters from <map:call>
        */
       public Scriptable jsGet_parameters() {
  @@ -920,8 +919,8 @@
        * @return The component manager
        */
   
  -    public ComponentManager getComponentManager() {
  -        return componentManager;
  +    public ServiceManager getServiceManager() {
  +        return serviceManager;
       }
   
       /**
  @@ -933,10 +932,10 @@
   
       public void forwardTo(String uri,
                             Object bean,
  -                          FOM_WebContinuation fom_wk) 
  +                          FOM_WebContinuation fom_wk)
           throws Exception {
           interpreter.forwardTo(getTopLevelScope(this),
  -                              this, 
  +                              this,
                                 uri,
                                 bean,
                                 fom_wk,
  @@ -945,14 +944,14 @@
   
       /**
        * Perform the behavior of <map:call continuation="blah">
  -     * This can be used in cases where the continuation id is not encoded 
  +     * This can be used in cases where the continuation id is not encoded
        * in the request in a form convenient to access in the sitemap.
  -     * Your script can extract the id from the request and then call 
  +     * Your script can extract the id from the request and then call
        * this method to process it as normal.
        * @param kontId The continuation id
        * @param parameters Any parameters you want to pass to the continuation (may be null)
        */
  -    public void handleContinuation(String kontId, Scriptable parameters) 
  +    public void handleContinuation(String kontId, Scriptable parameters)
           throws Exception {
           List list = null;
           if (parameters == null || parameters == Undefined.instance) {
  @@ -979,20 +978,20 @@
   
       public FOM_WebContinuation makeWebContinuation(Continuation k,
                                                      FOM_WebContinuation parent,
  -                                                   int timeToLive) 
  +                                                   int timeToLive)
           throws Exception {
           if (k == null) return null;
           WebContinuation wk;
           ContinuationsManager contMgr;
           contMgr = (ContinuationsManager)
  -            componentManager.lookup(ContinuationsManager.ROLE);
  +            serviceManager.lookup(ContinuationsManager.ROLE);
           wk = contMgr.createWebContinuation(unwrap(k),
                                              (parent == null ? null : parent.getWebContinuation()),
                                              timeToLive,
                                              null);
           FOM_WebContinuation result = new FOM_WebContinuation(wk);
           result.setParentScope(getParentScope());
  -        result.setPrototype(getClassPrototype(getParentScope(), 
  +        result.setPrototype(getClassPrototype(getParentScope(),
                                                 result.getClassName()));
           return result;
       }
  
  
  
  1.3       +16 -16    cocoon-2.2/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_WebContinuation.java
  
  Index: FOM_WebContinuation.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_WebContinuation.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FOM_WebContinuation.java	21 Jul 2003 23:13:00 -0000	1.2
  +++ FOM_WebContinuation.java	16 Oct 2003 14:57:36 -0000	1.3
  @@ -53,48 +53,48 @@
   import java.util.Iterator;
   import java.util.List;
   
  -import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.cocoon.components.flow.ContinuationsManager;
   import org.apache.cocoon.components.flow.WebContinuation;
  +import org.apache.avalon.framework.service.ServiceManager;
   import org.mozilla.javascript.NativeArray;
   import org.mozilla.javascript.ScriptableObject;
   import org.mozilla.javascript.Wrapper;
   
   public class FOM_WebContinuation extends ScriptableObject {
  -    
  +
       WebContinuation wk;
  -    
  +
       public FOM_WebContinuation() {
       }
  -    
  +
       public FOM_WebContinuation(Object wk) {
           if (wk instanceof Wrapper) {
               wk = ((Wrapper)wk).unwrap();
           }
           this.wk = (WebContinuation)wk;
       }
  -    
  +
       public String getClassName() {
           return "FOM_WebContinuation";
       }
  -    
  +
       public String jsGet_id() {
           return wk.getId();
       }
  -    
  +
       public FOM_WebContinuation jsFunction_getParent() {
           WebContinuation parent = wk.getParentContinuation();
           if (parent == null) return null;
           FOM_WebContinuation pwk = new FOM_WebContinuation(parent);
           pwk.setParentScope(getParentScope());
  -        pwk.setPrototype(getClassPrototype(getParentScope(), 
  +        pwk.setPrototype(getClassPrototype(getParentScope(),
                                              pwk.getClassName()));
           return pwk;
       }
  -    
  +
       public NativeArray jsFunction_getChildren() throws Exception {
           List list = wk.getChildren();
  -        NativeArray arr = 
  +        NativeArray arr =
               (NativeArray)org.mozilla.javascript.Context.getCurrentContext().newObject(getParentScope(),
                                                                                         "Array",
                                                                                         new Object[]{new Integer(list.size())});
  @@ -103,25 +103,25 @@
               WebContinuation child = (WebContinuation)iter.next();
               FOM_WebContinuation cwk = new FOM_WebContinuation(child);
               cwk.setParentScope(getParentScope());
  -            cwk.setPrototype(getClassPrototype(getParentScope(), 
  +            cwk.setPrototype(getClassPrototype(getParentScope(),
                                                  cwk.getClassName()));
               arr.put(i, arr, cwk);
           }
           return arr;
       }
  -    
  +
       public void jsFunction_invalidate() throws Exception {
           ContinuationsManager contMgr = null;
  -        FOM_Cocoon cocoon = 
  +        FOM_Cocoon cocoon =
               (FOM_Cocoon)getProperty(getTopLevelScope(this),
                                       "cocoon");
  -        ComponentManager componentManager = 
  -            cocoon.getComponentManager();
  +        ServiceManager componentManager =
  +            cocoon.getServiceManager();
           contMgr = (ContinuationsManager)
               componentManager.lookup(ContinuationsManager.ROLE);
           contMgr.invalidateWebContinuation(wk);
       }
  -    
  +
       public WebContinuation getWebContinuation() {
           return wk;
       }
  
  
  
  1.12      +21 -22    cocoon-2.2/src/java/org/apache/cocoon/components/flow/javascript/JSCocoon.java
  
  Index: JSCocoon.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/flow/javascript/JSCocoon.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- JSCocoon.java	8 May 2003 00:05:04 -0000	1.11
  +++ JSCocoon.java	16 Oct 2003 14:57:36 -0000	1.12
  @@ -74,10 +74,9 @@
   import org.apache.cocoon.components.flow.WebContinuation;
   import org.apache.cocoon.acting.Action;
   import org.apache.avalon.framework.parameters.Parameters;
  -import org.apache.avalon.framework.component.ComponentSelector;
  -import org.apache.avalon.framework.component.ComponentManager;
  -import org.apache.avalon.framework.component.ComponentException;
  -import org.apache.avalon.framework.component.Component;
  +import org.apache.avalon.framework.service.ServiceManager;
  +import org.apache.avalon.framework.service.ServiceException;
  +import org.apache.avalon.framework.service.ServiceSelector;
   
   /**
    * JavaScript interface to various Cocoon abstractions.
  @@ -92,7 +91,7 @@
       protected JavaScriptInterpreter interpreter;
       protected NativeArray parameters;
       protected Environment environment;
  -    protected ComponentManager manager;
  +    protected ServiceManager manager;
   
       public JSCocoon() {}
   
  @@ -112,7 +111,7 @@
           this.interpreter = interpreter;
       }
   
  -    public void setContext(ComponentManager manager, Environment environment)
  +    public void setContext(ServiceManager manager, Environment environment)
       {
           this.manager = manager;
           this.environment = environment;
  @@ -178,7 +177,7 @@
           return ObjectModelHelper.getContext(objectModel);
       }
   
  -    public ComponentManager jsGet_componentManager()
  +    public ServiceManager jsGet_componentManager()
       {
           return manager;
       }
  @@ -290,7 +289,7 @@
       }
   
       public void jsFunction_diplayAllContinuations()
  -        throws ComponentException
  +        throws ServiceException
       {
           ContinuationsManager continuationsMgr
               = (ContinuationsManager)manager.lookup(ContinuationsManager.ROLE);
  @@ -298,14 +297,14 @@
           try {
               continuationsMgr.displayAllContinuations();
           } finally {
  -            manager.release((Component)continuationsMgr);
  +            manager.release(continuationsMgr);
           }
       }
   
       // All right, this breaks the encapsulation, but I couldn't find any
       // better way to obtain the ComponentManager for a
       // JSWebContinuation.
  -    ComponentManager getComponentManager()
  +    ServiceManager getComponentManager()
       {
           return manager;
       }
  @@ -346,9 +345,9 @@
           Redirector redirector = new SitemapRedirector(this.environment);
           SourceResolver resolver = (SourceResolver)this.environment.getObjectModel()
               .get(OBJECT_SOURCE_RESOLVER);
  -        ComponentManager sitemapManager = CocoonComponentManager.getSitemapComponentManager();
  -        ComponentSelector actionSelector
  -            = (ComponentSelector)sitemapManager.lookup(Action.ROLE + "Selector");
  +        ServiceManager sitemapManager = CocoonComponentManager.getSitemapComponentManager();
  +        ServiceSelector actionSelector
  +            = (ServiceSelector)sitemapManager.lookup(Action.ROLE + "Selector");
           Action action = (Action)actionSelector.select(type);
           Map result = null;
           try {
  @@ -388,8 +387,8 @@
       {
           // since no new components can be declared on sitemap we could
           // very well use the 'other' one here. Anyway, since it's there...
  -        ComponentManager sitemapManager = CocoonComponentManager.getSitemapComponentManager();
  -        ComponentSelector inputSelector = (ComponentSelector)sitemapManager
  +        ServiceManager sitemapManager = CocoonComponentManager.getSitemapComponentManager();
  +        ServiceSelector inputSelector = (ServiceSelector)sitemapManager
               .lookup(InputModule.ROLE + "Selector");
           InputModule input = (InputModule) inputSelector.select(type);
           Object result = null;
  @@ -408,8 +407,8 @@
       {
           // since no new components can be declared on sitemap we could
           // very well use the 'other' one here. Anyway, since it's there...
  -        ComponentManager sitemapManager = CocoonComponentManager.getSitemapComponentManager();
  -        ComponentSelector outputSelector = (ComponentSelector)sitemapManager
  +        ServiceManager sitemapManager = CocoonComponentManager.getSitemapComponentManager();
  +        ServiceSelector outputSelector = (ServiceSelector)sitemapManager
               .lookup(OutputModule.ROLE + "Selector");
           OutputModule output = (OutputModule) outputSelector.select(type);
           try {
  @@ -426,8 +425,8 @@
       {
           // since no new components can be declared on sitemap we could
           // very well use the 'other' one here. Anyway, since it's there...
  -        ComponentManager sitemapManager = CocoonComponentManager.getSitemapComponentManager();
  -        ComponentSelector outputSelector = (ComponentSelector)sitemapManager
  +        ServiceManager sitemapManager = CocoonComponentManager.getSitemapComponentManager();
  +        ServiceSelector outputSelector = (ServiceSelector)sitemapManager
               .lookup(OutputModule.ROLE + "Selector");
           OutputModule output = (OutputModule) outputSelector.select(type);
           try {
  @@ -442,8 +441,8 @@
       {
           // since no new components can be declared on sitemap we could
           // very well use the 'other' one here. Anyway, since it's there...
  -        ComponentManager sitemapManager = CocoonComponentManager.getSitemapComponentManager();
  -        ComponentSelector outputSelector = (ComponentSelector)sitemapManager
  +        ServiceManager sitemapManager = CocoonComponentManager.getSitemapComponentManager();
  +        ServiceSelector outputSelector = (ServiceSelector)sitemapManager
               .lookup(OutputModule.ROLE + "Selector");
           OutputModule output = (OutputModule) outputSelector.select(type);
           try {
  
  
  
  1.4       +4 -4      cocoon-2.2/src/java/org/apache/cocoon/components/flow/javascript/JSWebContinuation.java
  
  Index: JSWebContinuation.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/flow/javascript/JSWebContinuation.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JSWebContinuation.java	26 Aug 2003 09:05:52 -0000	1.3
  +++ JSWebContinuation.java	16 Oct 2003 14:57:36 -0000	1.4
  @@ -45,9 +45,9 @@
   */
   package org.apache.cocoon.components.flow.javascript;
   
  -import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.cocoon.components.flow.ContinuationsManager;
   import org.apache.cocoon.components.flow.WebContinuation;
  +import org.apache.avalon.framework.service.ServiceManager;
   import org.mozilla.javascript.Context;
   import org.mozilla.javascript.Function;
   import org.mozilla.javascript.Scriptable;
  @@ -82,12 +82,12 @@
     }
   
     public static Scriptable jsConstructor(Context cx, Object[] args,
  -                                         Function ctorObj, 
  +                                         Function ctorObj,
                                            boolean inNewExpr)
       throws Exception
     {
       JSCocoon cocoon = (JSCocoon)args[0];
  -    ComponentManager manager = cocoon.getComponentManager();
  +    ServiceManager manager = cocoon.getComponentManager();
   
       ContinuationsManager contMgr
         = (ContinuationsManager)manager.lookup(ContinuationsManager.ROLE);
  
  
  
  1.11      +12 -18    cocoon-2.2/src/java/org/apache/cocoon/components/flow/AbstractInterpreter.java
  
  Index: AbstractInterpreter.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/flow/AbstractInterpreter.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- AbstractInterpreter.java	15 Oct 2003 17:04:50 -0000	1.10
  +++ AbstractInterpreter.java	16 Oct 2003 14:57:36 -0000	1.11
  @@ -45,11 +45,6 @@
   */
   package org.apache.cocoon.components.flow;
   
  -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;
   import org.apache.avalon.framework.configuration.Configurable;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
  @@ -57,6 +52,9 @@
   import org.apache.avalon.framework.context.Contextualizable;
   import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.avalon.framework.thread.SingleThreaded;
  +import org.apache.avalon.framework.service.Serviceable;
  +import org.apache.avalon.framework.service.ServiceManager;
  +import org.apache.avalon.framework.service.ServiceException;
   import org.apache.cocoon.Constants;
   import org.apache.cocoon.Processor;
   import org.apache.cocoon.components.CocoonComponentManager;
  @@ -82,8 +80,8 @@
    * @version CVS $Id$
    */
   public abstract class AbstractInterpreter extends AbstractLogEnabled
  -  implements Component, Composable, Contextualizable, Interpreter,
  -             SingleThreaded, Configurable, Disposable
  +  implements Serviceable, Contextualizable, Interpreter,
  +             SingleThreaded, Configurable
   {
       /**
        * List of source locations that need to be resolved.
  @@ -91,9 +89,9 @@
       protected ArrayList needResolve = new ArrayList();
   
       protected org.apache.cocoon.environment.Context context;
  -    protected ComponentManager manager;
  +    protected ServiceManager manager;
       protected ContinuationsManager continuationsMgr;
  -    
  +
       /**
        * Whether reloading of scripts should be done. Specified through
        * the "reload-scripts" attribute in <code>flow.xmap</code>.
  @@ -111,10 +109,7 @@
           checkTime = config.getChild("check-time").getValueAsLong(1000L);
       }
   
  -    /**
  -     * Composable
  -     */
  -    public void compose(ComponentManager manager) throws ComponentException {
  +    public void service(ServiceManager manager) throws ServiceException {
           this.manager = manager;
           this.continuationsMgr = (ContinuationsManager)manager.lookup(ContinuationsManager.ROLE);
       }
  @@ -129,7 +124,7 @@
        */
       public void dispose() {
           if ( this.manager != null ) {
  -            this.manager.release( (Component)this.continuationsMgr );
  +            this.manager.release( this.continuationsMgr );
               this.continuationsMgr = null;
               this.manager = null;
           }
  @@ -159,7 +154,6 @@
        *
        * @param source the location of the script
        *
  -     * @see org.apache.cocoon.components.source.SourceFactory
        * @see org.apache.cocoon.environment.Environment
        * @see org.apache.cocoon.components.source.impl.DelayedRefreshSourceWrapper
        */
  @@ -211,10 +205,10 @@
           try {
               // Retrieve a processor instance
               processor = (Processor)this.manager.lookup(Processor.ROLE);
  -            
  +
               // Enter the environment
               CocoonComponentManager.enterEnvironment(wrapper, this.manager, processor);
  -            
  +
               // Process the subrequest
               result = processor.process(wrapper);
               wrapper.commitResponse();