remm        01/09/08 12:52:04

  Modified:    src/wrappers/jndi SlideDirContext.java
  Log:
  - Allow setting the NAT, instead of using the static domain to retrieve it. The
    static domain will be used if the NAT has't been set.
  - Pass around the NAT instead of using more accesses to the domain when
    accessing subcontexts.
  
  Revision  Changes    Path
  1.4       +20 -8     jakarta-slide/src/wrappers/jndi/SlideDirContext.java
  
  Index: SlideDirContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/wrappers/jndi/SlideDirContext.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SlideDirContext.java      2001/06/19 04:22:43     1.3
  +++ SlideDirContext.java      2001/09/08 19:52:03     1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-slide/src/wrappers/jndi/SlideDirContext.java,v 1.3 
2001/06/19 04:22:43 remm Exp $
  - * $Revision: 1.3 $
  - * $Date: 2001/06/19 04:22:43 $
  + * $Header: /home/cvs/jakarta-slide/src/wrappers/jndi/SlideDirContext.java,v 1.4 
2001/09/08 19:52:03 remm Exp $
  + * $Revision: 1.4 $
  + * $Date: 2001/09/08 19:52:03 $
    *
    * ====================================================================
    *
  @@ -107,7 +107,7 @@
    * Slide Directory Context implementation helper class.
    *
    * @author Remy Maucherat
  - * @version $Revision: 1.3 $ $Date: 2001/06/19 04:22:43 $
  + * @version $Revision: 1.4 $ $Date: 2001/09/08 19:52:03 $
    */
   
   public class SlideDirContext extends BaseDirContext {
  @@ -145,9 +145,10 @@
        * Builds a file directory context using the given environment.
        */
       protected SlideDirContext(Hashtable env, String namespaceName, 
  -                              String vPath) {
  +                              NamespaceAccessToken token, String vPath) {
           super(env);
           
  +        setAccessToken(token);
           setNamespaceName(namespaceName);
           this.vPath = vPath;
       }
  @@ -203,13 +204,23 @@
   
   
       /**
  +     * Set the namespace access token used by this realm.
  +     */
  +    public void setAccessToken(NamespaceAccessToken accessToken) {
  +        this.token = accessToken;
  +    }
  +
  +
  +    /**
        * Set namespace name.
        */
       public void setNamespaceName(String namespaceName) {
   
           this.namespaceName = namespaceName;
   
  -        token = Domain.accessNamespace(new SecurityToken(this), namespaceName);
  +        if (token == null)
  +            token = Domain.accessNamespace
  +                (new SecurityToken(this), namespaceName);
   
           if (token == null)
               throw new IllegalArgumentException
  @@ -283,7 +294,8 @@
                   (sm.getString("resources.notFound", name));
           }
           
  -        return new SlideDirContext(env, getNamespaceName(), getUri(name));
  +        return new SlideDirContext(env, getNamespaceName(), token,
  +                                   getUri(name));
           
       }
   
  @@ -874,7 +886,7 @@
   
                   if (object == null) {
                       object = new SlideDirContext(env, getNamespaceName(), 
  -                                                 childName);
  +                                                 token, childName);
                   }
                   
               } catch (SlideException e) {
  
  
  

Reply via email to