avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/kernel ComponentFactory.java
Date Fri, 02 Aug 2002 05:22:15 GMT
donaldp     2002/08/01 22:22:15

  Added:       containerkit/src/java/org/apache/excalibur/containerkit/kernel
                        ComponentFactory.java
  Log:
  Initial cut at a ComponentFactory interface.
  This is used to create components and their
  associated ComponentInfo objects.
  
  Revision  Changes    Path
  1.1                  jakarta-avalon-excalibur/containerkit/src/java/org/apache/excalibur/containerkit/kernel/ComponentFactory.java
  
  Index: ComponentFactory.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.excalibur.containerkit.kernel;
  
  import org.apache.excalibur.containerkit.metainfo.ComponentInfo;
  
  /**
   * This interface defines the mechanism via which a
   * component or its associated {@link ComponentInfo} can
   * be created.
   *
   * <p>Usually the component or componentInfo will just be loaded
   * from a particular ClassLoader. However if a developer wanted
   * to dynamically assemble applications they could implement
   * a custom factory that created components via non-standard
   * mechanisms (say by wrapping remote, CORBA, or other style
   * objects).</p>
   *
   * <p>The methods take a <code>implementationKey</code> parameter
   * and usually this represents the class name of the component.
   * However in alternative component systems this may designate
   * objects via different mechanisms.</p>
   *
   * @author <a href="mailto:peter@apache.org">Peter Donald</a>
   * @version $Revision: 1.1 $ $Date: 2002/08/02 05:22:15 $
   */
  public interface ComponentFactory
  {
      /**
       * Create a {@link ComponentInfo} for component
       * specified by implementationKey.
       *
       * @param implementationKey the key indicating type of component (usually classname)
       * @return the ComponentInfo for component
       * @throws Exception if unable to create Info object
       */
      ComponentInfo createInfo( String implementationKey )
          throws Exception;
  
      /**
       * Create an instance of component with specified
       * implementationKey.
       *
       * @param implementationKey the key indicating type of component (usually classname)
       * @return an instance of component
       * @throws Exception if unable to create component
       */
      Object createComponent( String implementationKey )
          throws Exception;
  }
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message