cvs commit: jakarta-tomcat-connectors/naming/src/org/apache/naming/modules/fs FileDirContext.java

2003-02-26 Thread costin
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( ! 

cvs commit: jakarta-tomcat-connectors/naming/src/org/apache/naming/modules/fs FileDirContext.java

2002-10-18 Thread costin
costin  2002/10/17 09:49:03

  Modified:naming/src/org/apache/naming/modules/fs FileDirContext.java
  Log:
  Fix broken licence comment.
  
  Fix the lookup signature.
  
  Revision  ChangesPath
  1.3   +1 -16 
jakarta-tomcat-connectors/naming/src/org/apache/naming/modules/fs/FileDirContext.java
  
  Index: FileDirContext.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/naming/src/org/apache/naming/modules/fs/FileDirContext.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FileDirContext.java   8 Oct 2002 18:46:43 -   1.2
  +++ FileDirContext.java   17 Oct 2002 16:49:03 -  1.3
   -13,21 +13,6 
* 1. Redistributions of source code must retain the above copyright
*notice, this list of conditions and the following disclaimer. 
*
  - * 2. Re/*
  - * 
  - *
  - * The Apache Software License, Version 1.1
  - *
  - * Copyright (c) 1999 The Apache Software Foundation.  All rights 
  - * reserved.
  - *
  - * Redistribution and use in source and binary forms, with or without
  - * modification, are permitted provided that the following conditions
  - * are met:
  - *
  - * 1. Redistributions of source code must retain the above copyright
  - *notice, this list of conditions and the following disclaimer. 
  - *
* 2. Rey appear in the software itself,
*if and wherever such third-party acknowlegements normally appear.
*
   -257,7 +242,7 
* return the object bound to name
* exception NamingException if a naming exception is encountered
*/
  -public Object lookup(Name nameObj, boolean resolveLinkx, Object o)
  +public Object lookup(Name nameObj, boolean resolveLinkx)
   throws NamingException
   {
   if( log.isDebugEnabled() ) log.debug( lookup  + nameObj );
  
  
  

--
To unsubscribe, e-mail:   mailto:tomcat-dev-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org