ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/embeddor DefaultEmbeddor.java
Date Sun, 30 Jun 2002 07:01:30 GMT
donaldp     2002/06/30 00:01:30

  Modified:    container/src/java/org/apache/myrmidon/components/embeddor
                        DefaultEmbeddor.java
  Log:
  Dont cache references to services, reaquire them when required.
  
  Revision  Changes    Path
  1.111     +9 -15     jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/embeddor/DefaultEmbeddor.java
  
  Index: DefaultEmbeddor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/embeddor/DefaultEmbeddor.java,v
  retrieving revision 1.110
  retrieving revision 1.111
  diff -u -r1.110 -r1.111
  --- DefaultEmbeddor.java	30 Jun 2002 06:57:56 -0000	1.110
  +++ DefaultEmbeddor.java	30 Jun 2002 07:01:30 -0000	1.111
  @@ -76,9 +76,6 @@
       /** Namespace for the container types */
       private static final String CONTAINER_TYPE_NAMESPACE = "myrmidon";
   
  -    private TypeManager m_typeManager;
  -    private LibraryManager m_libraryManager;
  -
       private InstantiatingServiceManager m_serviceManager;
   
       private Context m_context;
  @@ -198,21 +195,16 @@
           m_rootProps = new DefaultPropertyStore();
           ContainerUtil.service( m_rootProps, m_serviceManager );
   
  -        m_typeManager = new DefaultTypeManager();
  -
  -        m_serviceManager.registerService( new String[]{RoleManager.ROLE, RoleRegistry.ROLE},
  -                                          m_typeManager );
  -        m_serviceManager.registerService( new String[]{TypeManager.ROLE, TypeRegistry.ROLE},
  -                                          m_typeManager );
  +        final DefaultTypeManager typeManager = new DefaultTypeManager();
  +        m_serviceManager.registerService( new String[]{RoleManager.ROLE, RoleRegistry.ROLE,
  +                                                       TypeManager.ROLE, TypeRegistry.ROLE},
  +                                          typeManager );
           m_serviceManager.registerService( new String[]{PropertyStore.ROLE},
                                             m_rootProps );
   
           // Add this embeddor
           m_serviceManager.registerService( new String[]{Embeddor.ROLE}, this );
   
  -        // locate the components we need
  -        m_libraryManager = (LibraryManager)m_serviceManager.lookup( LibraryManager.ROLE
);
  -
           // create the root execution frame
           m_rootFrame = new DefaultExecutionFrame( "", new File( "." ), m_serviceManager
);
           m_rootContext = m_rootFrame.createTaskContext( "<init>", "<init>" );
  @@ -223,15 +215,17 @@
           throws Exception
       {
           // Deploy all types found in the container classpath
  +        final LibraryManager libraryManager =
  +            (LibraryManager)getService( null, LibraryManager.class );
           final ClassLoader containerClassLoader = getClass().getClassLoader();
           final Library containerLib =
  -            m_libraryManager.createLibrary( containerClassLoader );
  +            libraryManager.createLibrary( containerClassLoader );
   
           final Deployer deployer = (Deployer)getService( null, Deployer.class );
           deployer.deployTypes( containerLib, CONTAINER_TYPE_NAMESPACE, m_rootContext );
   
           // Deploy all core type libraries in the lib directory
  -        final Library[] coreLibs = m_libraryManager.getCoreLibraries();
  +        final Library[] coreLibs = libraryManager.getCoreLibraries();
   
           if( getLogger().isInfoEnabled() )
           {
  
  
  

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


Mime
View raw message