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/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/service ComponentManagerAdaptor.java
Date Thu, 14 Feb 2002 10:26:36 GMT
donaldp     02/02/14 02:26:36

  Modified:    proposal/myrmidon/src/java/org/apache/myrmidon/components/workspace
                        DefaultWorkspace.java
  Added:       proposal/myrmidon/src/java/org/apache/myrmidon/components/workspace
                        ComponentManagerAdaptor.java
  Removed:     proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/service
                        ComponentManagerAdaptor.java
  Log:
  Move ComponentManagerAdapter into workspace package as thats the only place it is used.
  
  Revision  Changes    Path
  1.23      +1 -2      jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/workspace/DefaultWorkspace.java
  
  Index: DefaultWorkspace.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/workspace/DefaultWorkspace.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- DefaultWorkspace.java	14 Feb 2002 02:12:23 -0000	1.22
  +++ DefaultWorkspace.java	14 Feb 2002 10:26:36 -0000	1.23
  @@ -37,7 +37,6 @@
   import org.apache.myrmidon.interfaces.model.Project;
   import org.apache.myrmidon.interfaces.model.Target;
   import org.apache.myrmidon.interfaces.model.TypeLib;
  -import org.apache.myrmidon.interfaces.service.ComponentManagerAdaptor;
   import org.apache.myrmidon.interfaces.service.MultiSourceServiceManager;
   import org.apache.myrmidon.interfaces.service.ServiceManager;
   import org.apache.myrmidon.interfaces.type.TypeManager;
  @@ -48,7 +47,7 @@
    * This is the default implementation of Workspace.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.22 $ $Date: 2002/02/14 02:12:23 $
  + * @version $Revision: 1.23 $ $Date: 2002/02/14 10:26:36 $
    */
   public class DefaultWorkspace
       extends AbstractLogEnabled
  
  
  
  1.1                  jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/workspace/ComponentManagerAdaptor.java
  
  Index: ComponentManagerAdaptor.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.components.workspace;
  
  import org.apache.avalon.framework.component.ComponentException;
  import org.apache.avalon.framework.component.ComponentManager;
  import org.apache.myrmidon.interfaces.service.ServiceException;
  import org.apache.myrmidon.interfaces.service.ServiceManager;
  
  /**
   * An adaptor from {@link ComponentManager} to {@link ServiceManager}.
   *
   * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
   * @version $Revision: 1.1 $ $Date: 2002/02/14 10:26:36 $
   */
  class ComponentManagerAdaptor
      implements ServiceManager
  {
      private final ComponentManager m_componentManager;
  
      public ComponentManagerAdaptor( final ComponentManager componentManager )
      {
          m_componentManager = componentManager;
      }
  
      /**
       * Determines if this service manager contains a particular service.
       */
      public boolean hasService( Class serviceType )
      {
          return m_componentManager.hasComponent( serviceType.getName() );
      }
  
      /**
       * Locates a service instance.
       */
      public Object getService( Class serviceType )
          throws ServiceException
      {
          try
          {
              return m_componentManager.lookup( serviceType.getName() );
          }
          catch( ComponentException e )
          {
              throw new ServiceException( e.getMessage(), e );
          }
      }
  }
  
  
  

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