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/test/org/apache/myrmidon/components AbstractComponentTest.java
Date Sat, 11 May 2002 08:23:32 GMT
donaldp     02/05/11 01:23:31

  Modified:    container/src/java/org/apache/myrmidon/components/embeddor
                        DefaultEmbeddor.java
               container/src/test/org/apache/myrmidon/components
                        AbstractComponentTest.java
  Added:       container/src/java/org/apache/myrmidon/interfaces/executor
                        DefaultExecutionFrame.java
  Removed:     container/src/java/org/apache/myrmidon/components/workspace
                        DefaultExecutionFrame.java
  Log:
  Temporarily move DefaultExecutionFrame to the interfaces hierarchy so that it is accessible
to tasks.
  
  Revision  Changes    Path
  1.63      +2 -2      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.62
  retrieving revision 1.63
  diff -u -r1.62 -r1.63
  --- DefaultEmbeddor.java	10 May 2002 06:27:31 -0000	1.62
  +++ DefaultEmbeddor.java	11 May 2002 08:23:31 -0000	1.63
  @@ -32,7 +32,7 @@
   import org.apache.myrmidon.Constants;
   import org.apache.myrmidon.api.TaskContext;
   import org.apache.myrmidon.components.property.DefaultPropertyStore;
  -import org.apache.myrmidon.components.workspace.DefaultExecutionFrame;
  +import org.apache.myrmidon.interfaces.executor.DefaultExecutionFrame;
   import org.apache.myrmidon.interfaces.builder.ProjectBuilder;
   import org.apache.myrmidon.interfaces.configurer.Configurer;
   import org.apache.myrmidon.interfaces.converter.ConverterRegistry;
  @@ -64,7 +64,7 @@
    * Instantiate this to embed inside other applications.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.62 $ $Date: 2002/05/10 06:27:31 $
  + * @version $Revision: 1.63 $ $Date: 2002/05/11 08:23:31 $
    */
   public class DefaultEmbeddor
       extends AbstractLogEnabled
  
  
  
  1.1                  jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/executor/DefaultExecutionFrame.java
  
  Index: DefaultExecutionFrame.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.myrmidon.interfaces.executor;
  
  import org.apache.avalon.framework.logger.Logger;
  import org.apache.avalon.framework.service.DefaultServiceManager;
  import org.apache.avalon.framework.service.ServiceManager;
  import org.apache.myrmidon.interfaces.event.TaskEventManager;
  import org.apache.myrmidon.interfaces.property.PropertyStore;
  import java.io.File;
  
  /**
   * Frames in which tasks are executed.
   *
   * @author <a href="mailto:peter@apache.org">Peter Donald</a>
   * @version $Revision: 1.1 $ $Date: 2002/05/11 08:23:31 $
   */
  public class DefaultExecutionFrame
      implements ExecutionFrame
  {
      private final String m_name;
      private final File m_baseDirectory;
      private final Logger m_logger;
      private final PropertyStore m_propertyStore;
      private final ServiceManager m_serviceManager;
      private final TaskEventManager m_eventManager;
  
      public DefaultExecutionFrame( final String name,
                                    final File baseDirectory,
                                    final Logger logger,
                                    final PropertyStore propertyStore,
                                    final ServiceManager serviceManager,
                                    final TaskEventManager eventManager )
      {
          m_name = name;
          m_baseDirectory = baseDirectory;
          m_logger = logger;
          m_propertyStore = propertyStore;
          m_serviceManager = serviceManager;
          m_eventManager = eventManager;
      }
  
      /**
       * Returns the name of the execution frame.
       * This is used when generating TaskEvents as the
       * "path" element.
       *
       * @return the name of execution frame
       */
      public String getName()
      {
          return m_name;
      }
  
      public File getBaseDirectory()
      {
          return m_baseDirectory;
      }
  
      /**
       * Returns the logger which is to be supplied to tasks.
       */
      public Logger getLogger()
      {
          return m_logger;
      }
  
      /**
       * Returns the set of services to use to create, configure, and execute
       * tasks.
       */
      public ServiceManager getServiceManager()
      {
          return m_serviceManager;
      }
  
      /**
       * Returns the set of properties to be supplied to tasks.
       */
      public PropertyStore getPropertyStore()
      {
          return m_propertyStore;
      }
  
      /**
       * Returns the {@link org.apache.myrmidon.interfaces.event.TaskEventManager} that can
be used to fire events
       * or to register listeners.
       */
      public TaskEventManager getTaskEventManager()
      {
          return m_eventManager;
      }
  
      /**
       * Create a child execution frame.
       *
       * @param name the name of child frame relative to current frame
       * @param partition true if frame is partition frame
       * @return the new child ExecutionFrame
       * @see org.apache.myrmidon.interfaces.executor.ExecutionFrame#createChildFrame
       */
      public ExecutionFrame createChildFrame( final String name,
                                              final File baseDirectory,
                                              final boolean partition )
      {
          final String newName = getName() + "/" + name;
          File dir = baseDirectory;
          if( null == dir )
          {
              dir = getBaseDirectory();
          }
          if( !partition )
          {
              return new DefaultExecutionFrame( newName,
                                                dir,
                                                getLogger(),
                                                getPropertyStore(),
                                                getServiceManager(),
                                                getTaskEventManager() );
          }
          else
          {
              return createPartitionedFrame( newName, dir );
          }
      }
  
      /**
       * Create a partitioned pane so that modifications of child
       * elements does not effect parent objects.
       *
       * @param newName the name of new frame
       * @return the partiioned frame that is created
       */
      private ExecutionFrame createPartitionedFrame( final String newName,
                                                     final File dir )
      {
          final PropertyStore propertyStore =
              getPropertyStore().createChildStore();
          final DefaultServiceManager serviceManager =
              new DefaultServiceManager( getServiceManager() );
  
          return new DefaultExecutionFrame( newName,
                                            dir,
                                            getLogger(),
                                            propertyStore,
                                            serviceManager,
                                            getTaskEventManager() );
      }
  }
  
  
  
  1.34      +2 -2      jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/components/AbstractComponentTest.java
  
  Index: AbstractComponentTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/components/AbstractComponentTest.java,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- AbstractComponentTest.java	10 May 2002 06:27:32 -0000	1.33
  +++ AbstractComponentTest.java	11 May 2002 08:23:31 -0000	1.34
  @@ -35,7 +35,7 @@
   import org.apache.myrmidon.components.type.DefaultTypeManager;
   import org.apache.myrmidon.components.event.DefaultTaskEventManager;
   import org.apache.myrmidon.components.property.DefaultPropertyStore;
  -import org.apache.myrmidon.components.workspace.DefaultExecutionFrame;
  +import org.apache.myrmidon.interfaces.executor.DefaultExecutionFrame;
   import org.apache.myrmidon.components.workspace.DefaultTaskContext;
   import org.apache.myrmidon.components.library.DefaultLibraryManager;
   import org.apache.myrmidon.components.library.DefaultTypeLibraryManager;
  @@ -60,7 +60,7 @@
    * A base class for tests for the default components.
    *
    * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
  - * @version $Revision: 1.33 $ $Date: 2002/05/10 06:27:32 $
  + * @version $Revision: 1.34 $ $Date: 2002/05/11 08:23:31 $
    */
   public abstract class AbstractComponentTest
       extends AbstractContainerTestCase
  
  
  

--
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