avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground BasicContextInterface.java BasicContext.java
Date Thu, 18 Jul 2002 17:35:06 GMT
mcconnell    2002/07/18 10:35:05

  Added:       assembly/demo/src/java/org/apache/excalibur/playground
                        BasicContextInterface.java BasicContext.java
  Log:
  updated to include debugging of nested context parameter
  
  Revision  Changes    Path
  1.1                  jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground/BasicContextInterface.java
  
  Index: BasicContextInterface.java
  ===================================================================
  
  
  package org.apache.excalibur.playground;
  
  import java.io.File;
  
  import org.apache.avalon.framework.context.Context;
  
  /**
   * @author <a href="mailto:mcconnell@osm.net">Stephen McConnell</a>
   */
  public interface BasicContextInterface extends Context
  {
      public String getLocation();
      public File getWorkingDirectory();
  
  }
  
  
  
  1.1                  jakarta-avalon-excalibur/assembly/demo/src/java/org/apache/excalibur/playground/BasicContext.java
  
  Index: BasicContext.java
  ===================================================================
  
  
  package org.apache.excalibur.playground;
  
  import java.util.Map;
  import java.io.File;
  
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  import org.apache.avalon.framework.context.Context;
  import org.apache.avalon.framework.context.DefaultContext;
  import org.apache.avalon.framework.context.Contextualizable;
  import org.apache.avalon.framework.context.ContextException;
  import org.apache.avalon.framework.activity.Initializable;
  import org.apache.avalon.framework.activity.Startable;
  
  /**
   * This is example of a custom context class.
   *
   * @author <a href="mailto:mcconnell@osm.net">Stephen McConnell</a>
   */
  public class BasicContext extends DefaultContext implements BasicContextInterface
  {
  
      public BasicContext( Map map, Context parent )
      {
          super( map, parent );
      }
  
      public String getLocation()
      {
          try
          {
              return (String) super.get( "location" );
          }
          catch( Throwable e )
          {
              return "Unknown";
          }
      }
  
      public File getWorkingDirectory()
      {
          try
          {
              return (File) super.get( "home" );
          }
          catch( Throwable e )
          {
              throw new RuntimeException("context object does not provide required home entry.");
          }
      }
  
  }
  
  
  

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


Mime
View raw message