cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ovi...@apache.org
Subject cvs commit: xml-cocoon2/src/scratchpad/schecoon/src/org/apache/cocoon/components/flow InterpreterSelector.java
Date Wed, 13 Mar 2002 18:59:19 GMT
ovidiu      02/03/13 10:59:19

  Added:       src/scratchpad/schecoon/src/org/apache/cocoon/components/flow
                        InterpreterSelector.java
  Log:
  Selector of different flow control interpreters.
  
  Revision  Changes    Path
  1.1                  xml-cocoon2/src/scratchpad/schecoon/src/org/apache/cocoon/components/flow/InterpreterSelector.java
  
  Index: InterpreterSelector.java
  ===================================================================
  package org.apache.cocoon.components.flow;
  
  import org.apache.avalon.excalibur.component.ExcaliburComponentSelector;
  import org.apache.avalon.framework.configuration.Configurable;
  import org.apache.avalon.framework.configuration.Configuration;
  import org.apache.avalon.framework.configuration.ConfigurationException;
  
  public class InterpreterSelector extends ExcaliburComponentSelector
    implements Configurable
  {
    ClassLoader loader = Thread.currentThread().getContextClassLoader();
  
    public void configure(Configuration config)
      throws ConfigurationException
    {
      System.out.println("InterpreterSelector = " + this);
      
      Configuration[] components = config.getChildren("component-instance");
      for (int i = 0; i < components.length; i++) {
        Configuration component = components[i];
        String name = component.getAttribute("name");
        String className = component.getAttribute("class");
        System.out.println("Adding component with name " + name
                           + ", class = " + className);
  
        Class clazz;
        try {
          clazz = loader.loadClass(className);
          addComponent(name, clazz, component);
        }
        catch (Exception ex) {
          throw new ConfigurationException("Cannot load class " + className);
        }
      }
    }
  }
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message