From 589ffa248854725829e0abf16f94bcaef0cdb22d Mon Sep 17 00:00:00 2001 From: Costin Manolache Date: Fri, 11 Oct 2002 18:05:37 +0000 Subject: [PATCH] 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 --- .../apache/tools/ant/PropertyInterceptor.java | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/proposal/embed/src/java/org/apache/tools/ant/PropertyInterceptor.java b/proposal/embed/src/java/org/apache/tools/ant/PropertyInterceptor.java index 725280935..2b0bf55ff 100644 --- a/proposal/embed/src/java/org/apache/tools/ant/PropertyInterceptor.java +++ b/proposal/embed/src/java/org/apache/tools/ant/PropertyInterceptor.java @@ -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 ); }