tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core NamingContextListener.java StandardDefaultContext.java
Date Tue, 25 Jun 2002 22:29:23 GMT
remm        2002/06/25 15:29:23

  Modified:    catalina/src/share/org/apache/catalina/core
                        NamingContextListener.java
                        StandardDefaultContext.java
  Log:
  - Fix problems modifying the naming resources from the default context.
  
  Revision  Changes    Path
  1.19      +15 -4     jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/NamingContextListener.java
  
  Index: NamingContextListener.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/NamingContextListener.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- NamingContextListener.java	11 Jun 2002 19:41:23 -0000	1.18
  +++ NamingContextListener.java	25 Jun 2002 22:29:23 -0000	1.19
  @@ -523,11 +523,22 @@
        */
       public void propertyChange(PropertyChangeEvent event) {
   
  +        if (!initialized)
  +            return;
  +
           Object source = event.getSource();
           if (source == namingResources) {
  +
  +            // Setting the context in read/write mode
  +            ContextAccessController.setWritable(getName(), container);
  +
               processGlobalResourcesChange(event.getPropertyName(),
                                            event.getOldValue(),
                                            event.getNewValue());
  +
  +            // Setting the context in read only mode
  +            ContextAccessController.setReadOnly(getName());
  +
           }
   
       }
  
  
  
  1.6       +11 -5     jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardDefaultContext.java
  
  Index: StandardDefaultContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardDefaultContext.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- StandardDefaultContext.java	11 Jun 2002 19:41:23 -0000	1.5
  +++ StandardDefaultContext.java	25 Jun 2002 22:29:23 -0000	1.6
  @@ -71,6 +71,7 @@
   import java.util.Hashtable;
   import java.util.Iterator;
   import javax.naming.directory.DirContext;
  +import org.apache.naming.ContextAccessController;
   import org.apache.catalina.Container;
   import org.apache.catalina.ContainerListener;
   import org.apache.catalina.Context;
  @@ -1212,7 +1213,6 @@
           }
   
           if (listener == null) {
  -            System.out.println("Not found");
               return;
           }
   
  @@ -1223,6 +1223,9 @@
   
               NamingResources contextResources = context.getNamingResources();
   
  +            // Setting the context in read/write mode
  +            ContextAccessController.setWritable(listener.getName(), context);
  +
               // Send notifications to the listener to add the appropriate 
               // resources
               ContextEjb [] contextEjb = findEjbs();
  @@ -1257,6 +1260,9 @@
                   listener.addResourceEnvRef
                       (envRefs[i], findResourceEnvRef(envRefs[i]));
               }
  +
  +            // Setting the context in read only mode
  +            ContextAccessController.setReadOnly(listener.getName());
   
               // Add listener to the NamingResources listener list
               namingResources.addPropertyChangeListener(listener);
  
  
  

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


Mime
View raw message