Browse Source

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.


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@273434 13f79535-47bb-0310-9956-ffa450edef68
master
Costin Manolache 22 years ago
parent
commit
589ffa2488
1 changed files with 9 additions and 12 deletions
  1. +9
    -12
      proposal/embed/src/java/org/apache/tools/ant/PropertyInterceptor.java

+ 9
- 12
proposal/embed/src/java/org/apache/tools/ant/PropertyInterceptor.java View File

@@ -65,15 +65,7 @@ import org.xml.sax.helpers.AttributeListImpl;
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 @@ public interface PropertyInterceptor {
* 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 );

}

Loading…
Cancel
Save