You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by mc...@apache.org on 2002/08/03 12:52:45 UTC

cvs commit: jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/container DefaultContainer.java

mcconnell    2002/08/03 03:52:45

  Modified:    assembly/demo/src/java/org/apache/excalibur/playground
                        EmbeddedDemo.java
               assembly/src/java/org/apache/excalibur/merlin/assembly
                        ContainerManager.java TypeRegistry.java
               assembly/src/java/org/apache/excalibur/merlin/container
                        DefaultContainer.java
  Log:
  embedded demo update
  
  Revision  Changes    Path
  1.3       +10 -24    jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground/EmbeddedDemo.java
  
  Index: EmbeddedDemo.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground/EmbeddedDemo.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- EmbeddedDemo.java	2 Aug 2002 12:31:01 -0000	1.2
  +++ EmbeddedDemo.java	3 Aug 2002 10:52:45 -0000	1.3
  @@ -52,25 +52,6 @@
       {
           getLogger().info("initialize");
   
  -        ClassLoader classloader;
  -        try
  -        {
  -            classloader = (ClassLoader) m_context.get("classloader");
  -            getLogger().info("classloader " + classloader );
  -        }
  -        catch( Throwable e )
  -        {
  -            getLogger().error("classloader access didn't work.", e );
  -        }
  -
  -        // ###################################################################
  -        // Need to create a formal interface (or at least review the API) for
  -        // ContainerManager and document this as a publically accessible class
  -        // via a standard context key.  The classloader should be usable as a
  -        // context argument to the creation of a new kernel so we get access
  -        // to all of the classes in our current classloder.
  -        // ###################################################################
  -
           //
           // create the kernel and get the root container
           //
  @@ -80,16 +61,20 @@
           m_kernel.contextualize( m_context );
           m_kernel.configure( new DefaultConfiguration( "kernel", null ) );
           m_kernel.initialize();
  -        m_container = m_kernel.getRootContainer();
   
           //
  -        // create and add a profile to the container
  +        // get the manager
           //
  -
  -        Type type = m_container.getType( "org.apache.excalibur.playground.SimpleComponent" );
  +   
  +        ContainerManager manager = (ContainerManager) Thread.currentThread().getContextClassLoader();
  +        Type type = manager.loadType( "org.apache.excalibur.playground.SimpleComponent" );
           getLogger().info("TYPE: " + type );
  -        //Profile profile = new Profile();
   
  +        //
  +        // create and add a profile to the container
  +        //
  +
  +        m_container = m_kernel.getRootContainer();
       }
   
       //=======================================================================
  @@ -111,6 +96,7 @@
       public void dispose()
       {
           getLogger().debug( "dispose" );
  +        m_kernel.dispose();
       }
   
   }
  
  
  
  1.3       +5 -0      jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/assembly/ContainerManager.java
  
  Index: ContainerManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/assembly/ContainerManager.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ContainerManager.java	3 Aug 2002 09:29:05 -0000	1.2
  +++ ContainerManager.java	3 Aug 2002 10:52:45 -0000	1.3
  @@ -339,6 +339,11 @@
           // start internal initialization
           //
   
  +        getLogger().debug(
  +          "creating manager '" + m_descriptor.getName() 
  +          + "' " + System.identityHashCode( this ) 
  +          + " with parent: " + System.identityHashCode( getParent() ) );
  +
           super.initialize();
   
           getLocalLogger().debug("manager initialization");
  
  
  
  1.4       +1 -3      jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/assembly/TypeRegistry.java
  
  Index: TypeRegistry.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/assembly/TypeRegistry.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TypeRegistry.java	2 Aug 2002 06:36:09 -0000	1.3
  +++ TypeRegistry.java	3 Aug 2002 10:52:45 -0000	1.4
  @@ -205,7 +205,6 @@
           }
       }
   
  -
      /**
       * Returns the service type implementation class.
       * @param service the service type descriptor
  @@ -268,7 +267,6 @@
           }
           return (Facility[]) list.toArray( new Facility[ list.size() ] );
       }
  -
   
      /**
       * Returns the set of component types know to the registry that are capable of 
  
  
  
  1.23      +1 -1      jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/container/DefaultContainer.java
  
  Index: DefaultContainer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/assembly/src/java/org/apache/excalibur/merlin/container/DefaultContainer.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- DefaultContainer.java	3 Aug 2002 09:29:05 -0000	1.22
  +++ DefaultContainer.java	3 Aug 2002 10:52:45 -0000	1.23
  @@ -231,7 +231,7 @@
       */
       public void handleInitialize() throws Exception
       {
  -        getLogger().debug( "initialization" );
  +        getLogger().info( "initialization" );
   
           Configuration[] components = m_configuration.getChildren("component");
           for( int i=0; i<components.length; i++ )
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>