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
Date Wed, 13 Nov 2002 09:19:32 GMT
remm        2002/11/13 01:19:31

  Modified:    catalina/src/share/org/apache/catalina/core
                        NamingContextListener.java
  Log:
  - Revert patch (see explanation).
  
  Revision  Changes    Path
  1.21      +14 -39    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.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- NamingContextListener.java	13 Nov 2002 02:23:10 -0000	1.20
  +++ NamingContextListener.java	13 Nov 2002 09:19:31 -0000	1.21
  @@ -293,62 +293,37 @@
                   log(sm.getString("naming.namingContextCreationFailed", e));
               }
   
  -            if (container instanceof Server) {
  -                namingResources.addPropertyChangeListener(this);
  -                org.apache.naming.factory.ResourceLinkFactory.setGlobalContext
  -                    (namingContext);
  -                try {
  -                    ContextBindings.bindClassLoader
  -                        (container, container,
  -                         this.getClass().getClassLoader());
  -                } catch (NamingException e) {
  -                    log(sm.getString("naming.bindFailed", e));
  -                }
  -                if (container instanceof StandardServer) {
  -                    ((StandardServer) container).setGlobalNamingContext
  -                        (namingContext);
  -                }
  -            } else if (container instanceof Context) {
  +            // Binding the naming context to the class loader
  +            if (container instanceof Context) {
                   // Setting the context in read only mode
                   ContextAccessController.setReadOnly(getName());
                   try {
                       ContextBindings.bindClassLoader
  -                        (container, container,
  +                        (container, container, 
                            ((Container) container).getLoader().getClassLoader());
                   } catch (NamingException e) {
                       log(sm.getString("naming.bindFailed", e));
                   }
               }
   
  -            initialized = true;
  -
  -        } else if (event.getType() == Lifecycle.AFTER_START_EVENT ) {
  -            // Used at end of a Web Application Context reload
  -            if (container instanceof Context) {
  -                // Setting the context in read only mode
  -                ContextAccessController.setReadOnly(getName());
  +            if (container instanceof Server) {
  +                namingResources.addPropertyChangeListener(this);
  +                org.apache.naming.factory.ResourceLinkFactory.setGlobalContext
  +                    (namingContext);
                   try {
                       ContextBindings.bindClassLoader
  -                        (container, container,
  -                         ((Container) container).getLoader().getClassLoader());
  +                        (container, container, 
  +                         this.getClass().getClassLoader());
                   } catch (NamingException e) {
                       log(sm.getString("naming.bindFailed", e));
                   }
  +                if (container instanceof StandardServer) {
  +                    ((StandardServer) container).setGlobalNamingContext
  +                        (namingContext);
  +                }
               }
   
  -        } else if (event.getType() == Lifecycle.BEFORE_STOP_EVENT) {
  -            // Used when starting a Web Application Context reload
  -            if (!initialized)
  -                return;
  -
  -            // Setting the context in read/write mode
  -            ContextAccessController.setWritable(getName(), container);
  -
  -            if (container instanceof Context) {
  -                ContextBindings.unbindClassLoader
  -                    (container, container,
  -                     ((Container) container).getLoader().getClassLoader());
  -            }
  +            initialized = true;
   
           } else if (event.getType() == Lifecycle.STOP_EVENT) {
   
  
  
  

--
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