ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@apache.org
Subject cvs commit: jakarta-ant/proposal/embed/src/java/org/apache/tools/ant PropertyInterceptor.java
Date Fri, 11 Oct 2002 18:05:37 GMT
costin      2002/10/11 11:05:37

  Modified:    proposal/embed/src/java/org/apache/tools/ant
                        PropertyInterceptor.java
  Log:
  Added a callback for setProperty. This would allow different property
  stores to implement their own policy.
  
  This feature will not work in ant15 ( for now ).
  
  Also changed Project to Object - and use it as a context. This makes
  the callback more generic and the hooks less dependent of ant.
  
  The only major issue on dynamic properties for me is the JNDI stuff.
  I think the Context interface could be a better abstraction, but
  on the other side it is much more complex. I also want to finalize
  the JNDI property source and abstract the properties via JNDI
  so tasks can be created without any dep on ant, but still accessing
  properties and refs.
  
  Revision  Changes    Path
  1.2       +9 -12     jakarta-ant/proposal/embed/src/java/org/apache/tools/ant/PropertyInterceptor.java
  
  Index: PropertyInterceptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/embed/src/java/org/apache/tools/ant/PropertyInterceptor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PropertyInterceptor.java	26 Jul 2002 16:46:14 -0000	1.1
  +++ PropertyInterceptor.java	11 Oct 2002 18:05:37 -0000	1.2
  @@ -65,15 +65,7 @@
   import org.xml.sax.helpers.AttributesImpl;
   
   /**
  - * The new XML processor will use this interface to support
  - * dynamic properties.
  - *
  - * Any task/type that implements this interface will be registered
  - * and will receive notification of each property get operations
  - * executed by the processor.
  - *
  - * XXX In ant1.6+, tasks implementing the interface will also
  - * receive notification when a property is set. 
  + * Support for dynamic properties. 
    *
    * @author Costin Manolache
    */
  @@ -83,13 +75,18 @@
        * Called for each ${} property. If the result is null the
        * next PropertyInterceptor will be called. If all interceptors
        * return null, the properties stored in Project are used.
  +     *
  +     * @param context Execution context. ( for example the project ). 
  +     * @praam ns Namespace of the property
  +     * @param name name of the property
  +     * @return Value of the property or null if this interceptor can't find the property.
        */
  -    public Object getProperty( Project p, String ns, String name );
  +    public Object getProperty( Object context, String ns, String name );
   
       /**
        *  Called when a property/reference is recorded.
  -     *  XXX Not implemented yet.
  +     *
        */
  -    //    public boolean setProperty( String ns, String name, Object value );
  +    public boolean setProperty( Object context, String ns, String name, Object value );
   
   }
  
  
  

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