geirm       01/04/22 11:29:38

  Modified:    src/java/org/apache/velocity/context
                        InternalContextAdapterImpl.java
                        InternalContextBase.java VMContext.java
  Log:
  small fixups. whoops.  forgot a few and did 1 wrong :)
  
  Revision  Changes    Path
  1.7       +3 -4      
jakarta-velocity/src/java/org/apache/velocity/context/InternalContextAdapterImpl.java
  
  Index: InternalContextAdapterImpl.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/context/InternalContextAdapterImpl.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- InternalContextAdapterImpl.java   2001/04/22 18:18:44     1.6
  +++ InternalContextAdapterImpl.java   2001/04/22 18:29:37     1.7
  @@ -88,7 +88,7 @@
    * 
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Geir Magnusson Jr.</a>
  - * @version $Id: InternalContextAdapterImpl.java,v 1.6 2001/04/22 18:18:44 geirm 
Exp $
  + * @version $Id: InternalContextAdapterImpl.java,v 1.7 2001/04/22 18:29:37 geirm 
Exp $
    */
   public final class InternalContextAdapterImpl implements InternalContextAdapter
   {
  @@ -98,7 +98,6 @@
       /** the ICB we are wrapping.  We may need to make one */
       InternalHousekeepingContext icb = null;
   
  -    Resource currentResource = null;
   
       /**
        *  CTOR takes a Context and wraps it, delegating all 'data' calls 
  @@ -145,12 +144,12 @@
   
       public void setCurrentResource( Resource r )
       {
  -        currentResource = r;
  +        icb.setCurrentResource(r);
       }
   
       public Resource getCurrentResource()
       {
  -        return currentResource;
  +        return icb.getCurrentResource();
       }
   
       /* --- InternalContext interface methods --- */
  
  
  
  1.7       +13 -2     
jakarta-velocity/src/java/org/apache/velocity/context/InternalContextBase.java
  
  Index: InternalContextBase.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/context/InternalContextBase.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- InternalContextBase.java  2001/04/20 04:31:29     1.6
  +++ InternalContextBase.java  2001/04/22 18:29:37     1.7
  @@ -61,6 +61,7 @@
   import org.apache.velocity.util.introspection.IntrospectionCacheData;
   
   import org.apache.velocity.context.EventCartridge;
  +import org.apache.velocity.runtime.resource.Resource;
   
   /**
    *  class to encapsulate the 'stuff' for internal operation of velocity.  
  @@ -75,7 +76,7 @@
    *  is derived from this.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Geir Magnusson Jr.</a>
  - * @version $Id: InternalContextBase.java,v 1.6 2001/04/20 04:31:29 geirm Exp $
  + * @version $Id: InternalContextBase.java,v 1.7 2001/04/22 18:29:37 geirm Exp $
    */
   class InternalContextBase implements InternalHousekeepingContext,Serializable
   {
  @@ -89,8 +90,8 @@
        */
       private Stack templateNameStack = new Stack();
   
  -
       private EventCartridge eventCartridge = null;
  +    private Resource currentResource = null;
   
       /**
        *  set the current template name on top of stack
  @@ -173,4 +174,14 @@
           return eventCartridge;
       }
   
  +    public void setCurrentResource( Resource r )
  +    {
  +        currentResource = r;
  +    }
  +
  +    public Resource getCurrentResource()
  +    {
  +        return currentResource;
  +    }
   }
  +
  
  
  
  1.6       +14 -2     
jakarta-velocity/src/java/org/apache/velocity/context/VMContext.java
  
  Index: VMContext.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/context/VMContext.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- VMContext.java    2001/04/20 04:31:30     1.5
  +++ VMContext.java    2001/04/22 18:29:37     1.6
  @@ -59,6 +59,7 @@
   import org.apache.velocity.runtime.Runtime;
   import org.apache.velocity.runtime.directive.VMProxyArg;
   import org.apache.velocity.util.introspection.IntrospectionCacheData;
  +import org.apache.velocity.runtime.resource.Resource;
   
   /**
    *  This is a special, internal-use-only context implementation to be
  @@ -68,11 +69,11 @@
    *  in the put() and get() methods.
    *
    *  Further, this context also supports the 'VM local context' mode, where
  - *  any get() or put() of references taht aren't args to the VM are considered
  + *  any get() or put() of references that aren't args to the VM are considered
    *  local to the vm, protecting the global context.
    *  
    *  @author <a href="mailto:[EMAIL PROTECTED]">Geir Magnusson Jr.</a>
  - *  @version $Id: VMContext.java,v 1.5 2001/04/20 04:31:30 geirm Exp $ 
  + *  @version $Id: VMContext.java,v 1.6 2001/04/22 18:29:37 geirm Exp $ 
    */
   public class VMContext implements InternalContextAdapter
   {
  @@ -309,6 +310,17 @@
       public EventCartridge getEventCartridge()
       {
           return innerContext.getEventCartridge();
  +    }
  +
  +
  +    public void setCurrentResource( Resource r )
  +    {
  +        innerContext.setCurrentResource( r );
  +    }
  +
  +    public Resource getCurrentResource()
  +    {
  +        return innerContext.getCurrentResource();
       }
   }
   
  
  
  

Reply via email to