costin 2003/02/26 10:52:12
Modified:naming build.xml
naming/src/org/apache/naming/ant JndiProperties.java
naming/src/org/apache/naming/core BaseContext.java
BaseDirContext.java BaseNaming.java
NamingContextEnumeration.java ServerAttribute.java
ServerAttributes.java
naming/src/org/apache/naming/modules/fs FileDirContext.java
Log:
Various updates and improvments.
It requires ant1.6 ( i.e. HEAD or recent build ) - since it uses and implements
dynamic
properties.
Revision ChangesPath
1.3 +18 -9 jakarta-tomcat-connectors/naming/build.xml
Index: build.xml
===
RCS file: /home/cvs/jakarta-tomcat-connectors/naming/build.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- build.xml 8 Oct 2002 18:46:42 - 1.2
+++ build.xml 26 Feb 2003 18:52:11 - 1.3
@@ -51,36 +51,45 @@
/target
target name=test
-systemPath pathRef=build-main.classpath /
+classloader classpathRef=build-main.classpath /
+
taskdef name=jndiSet classname=org.apache.naming.ant.JndiSet/
taskdef name=jndiProperties
classname=org.apache.naming.ant.JndiProperties/
taskdef name=jndiFileCtx
classname=org.apache.naming.modules.fs.FileDirContext/
+!-- Enable ${jndi:...} dynamic properties --
jndiProperties/
+
+!-- memory context --
jndiSet context=/foo value=bar /
+echo message=Value: ${jndi:/foo}/
-jndiFileCtx docBase=/tmp id=docBaseId /
-jndiSet context=/test refId=docBaseId /
+property name=dirname location=. /
-echo message=Value: ${jndi:/foo}/
-echo message=Value: ${jndi:/test/test}/
-echo message=Value: ${jndi:fs:/tmp/test}/
+!-- Create a JNDI context for the current dir --
+jndiFileCtx docBase=${dirname} id=docBaseId /
+
+!-- Bind the file context to /currentDir --
+jndiSet context=/currentDir refId=docBaseId /
+
+echo message=Value: ${jndi:/currentDir/build.xml}/
+echo message=Value: ${jndi:fs:/tmp}/
/target
target name=browser
java classpathref=build-main.classpath
classname=examples.browser.Browser fork=true
- sysproperty key=java.naming.dns.url value=dns://129.150.254.2/wyn.org/
+ sysproperty key=java.naming.dns.url value=dns://10.0.0.1/covalent.net/
!-- LABEL|java.naming.factory.initial|java.naming.provider.url|root|auth(
none, simple, etc ) |princ|pass --
arg
value=LDAP|com.sun.jndi.ldap.LdapCtxFactory|ldap://localhost:389|dc=wyn,dc=org|simple|cn=Manager,dc=wyn,dc=org|secret
/
!-- arg value=File|com.sun.jndi.fscontext.RefFSContextFactory|file:/ /--
arg value=DSML|com.sun.jndi.dsml.DsmlCtxFactory|file:/tmp/test.dsml.xml /
arg value=DNS|com.sun.jndi.dns.DnsContextFactory|dns://127.0.0.1/localhost
/
- arg value=FS|org.apache.naming.fs.fsURLContextFactory|fs:/ /
- arg value=Mem|org.apache.naming.memory.memoryURLContextFactory|memory:/ /
+ arg value=FS|org.apache.naming.modules.fs.fsURLContextFactory|fs:/ /
+ arg
value=Mem|org.apache.naming.modules.memory.memoryURLContextFactory|memory:/ /
/java
/target
1.3 +43 -23
jakarta-tomcat-connectors/naming/src/org/apache/naming/ant/JndiProperties.java
Index: JndiProperties.java
===
RCS file:
/home/cvs/jakarta-tomcat-connectors/naming/src/org/apache/naming/ant/JndiProperties.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- JndiProperties.java 8 Oct 2002 18:46:42 - 1.2
+++ JndiProperties.java 26 Feb 2003 18:52:12 - 1.3
@@ -70,11 +70,12 @@
*
* @author Costin Manolache
*/
-public class JndiProperties extends Task implements PropertyInterceptor {
+public class JndiProperties extends Task {
public static String PREFIX=jndi:;
private static org.apache.commons.logging.Log log=
org.apache.commons.logging.LogFactory.getLog( JndiProperties.class );
-
+private JndiHelper helper=new JndiHelper();
+
public JndiProperties() {
initNaming();
}
@@ -87,32 +88,51 @@
// System.setProperty( java.naming.factory.initial,
org.apache.naming.memory.MemoryInitialContextFactory );
}
-public boolean setProperty( Object p, String ns, String name, Object value ) {
-return false;
-}
+class JndiHelper extends PropertyHelper {
+public boolean setPropertyHook( String ns, String name, Object v, boolean
inh,
+boolean user, boolean isNew)
+{
+if( !