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/configurer TaskContextAdapter.java
Date Thu, 21 Feb 2002 09:35:51 GMT
donaldp     02/02/21 01:35:51

  Added:       proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/configurer
                        TaskContextAdapter.java
  Log:
  Add an adaptor so that the TaskContext will still apear as an Avalon COntext to the Configurer
  
  Revision  Changes    Path
  1.1                  jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/interfaces/configurer/TaskContextAdapter.java
  
  Index: TaskContextAdapter.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.configurer;
  
  import org.apache.avalon.framework.context.Context;
  import org.apache.avalon.framework.context.ContextException;
  import org.apache.myrmidon.api.TaskContext;
  
  /**
   * This class adpats the TaskContext API to the Avalon Context API.
   *
   * @author <a href="mailto:peter@apache.org">Peter Donald</a>
   * @version $Revision: 1.1 $ $Date: 2002/02/21 09:35:51 $
   */
  public class TaskContextAdapter
      implements Context
  {
      private final TaskContext m_context;
  
      public TaskContextAdapter( final TaskContext context )
      {
          m_context = context;
      }
  
      public Object get( Object key )
          throws ContextException
      {
          final Object value = m_context.getProperty( key.toString() );
          if( null != value )
          {
              return value;
          }
          else
          {
              throw new ContextException( "Missing key " + key );
          }
      }
  }
  
  
  

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