remm        01/02/15 16:05:57

  Modified:    catalina/src/share/org/apache/naming NamingContext.java
  Log:
  - Call NamingManager.getStateToBind before binding the object.
  
  Revision  Changes    Path
  1.3       +17 -15    
jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/NamingContext.java
  
  Index: NamingContext.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/NamingContext.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- NamingContext.java        2000/12/15 19:48:25     1.2
  +++ NamingContext.java        2001/02/16 00:05:54     1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/NamingContext.java,v 
1.2 2000/12/15 19:48:25 remm Exp $
  - * $Revision: 1.2 $
  - * $Date: 2000/12/15 19:48:25 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/naming/NamingContext.java,v 
1.3 2001/02/16 00:05:54 remm Exp $
  + * $Revision: 1.3 $
  + * $Date: 2001/02/16 00:05:54 $
    *
    * ====================================================================
    *
  @@ -85,7 +85,7 @@
    * Catalina JNDI Context implementation.
    *
    * @author Remy Maucherat
  - * @version $Revision: 1.2 $ $Date: 2000/12/15 19:48:25 $
  + * @version $Revision: 1.3 $ $Date: 2001/02/16 00:05:54 $
    */
   
   public class NamingContext implements Context {
  @@ -850,7 +850,7 @@
        * must already exist.
        * 
        * @param name the name to bind; may not be empty
  -     * @param obj the object to bind; possibly null
  +     * @param object the object to bind; possibly null
        * @param rebind if true, then perform a rebind (ie, overwrite)
        * @exception NameAlreadyBoundException if name is already bound
        * @exception InvalidAttributesException if object did not supply all 
  @@ -892,21 +892,23 @@
               } else {
                   // Getting the type of the object and wrapping it within a new
                   // NamingEntry
  -                if (obj instanceof Context) {
  -                    entry = new NamingEntry(name.get(0), obj, 
  +                Object toBind = 
  +                    NamingManager.getStateToBind(obj, name, this, env);
  +                if (toBind instanceof Context) {
  +                    entry = new NamingEntry(name.get(0), toBind, 
                                               NamingEntry.CONTEXT);
  -                } else if (obj instanceof LinkRef) {
  -                    entry = new NamingEntry(name.get(0), obj, 
  +                } else if (toBind instanceof LinkRef) {
  +                    entry = new NamingEntry(name.get(0), toBind, 
                                               NamingEntry.LINK_REF);
  -                } else if (obj instanceof Reference) {
  -                    entry = new NamingEntry(name.get(0), obj, 
  +                } else if (toBind instanceof Reference) {
  +                    entry = new NamingEntry(name.get(0), toBind, 
                                               NamingEntry.REFERENCE);
  -                } else if (obj instanceof Referenceable) {
  -                    obj = ((Referenceable) obj).getReference();
  -                    entry = new NamingEntry(name.get(0), obj, 
  +                } else if (toBind instanceof Referenceable) {
  +                    toBind = ((Referenceable) toBind).getReference();
  +                    entry = new NamingEntry(name.get(0), toBind, 
                                               NamingEntry.REFERENCE);
                   } else {
  -                    entry = new NamingEntry(name.get(0), obj, 
  +                    entry = new NamingEntry(name.get(0), toBind, 
                                               NamingEntry.ENTRY);
                   }
                   bindings.put(name.get(0), entry);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to