Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@apache.org Received: (qmail 81883 invoked from network); 9 Nov 2001 01:14:08 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 9 Nov 2001 01:14:08 -0000 Received: (qmail 2837 invoked by uid 97); 8 Nov 2001 21:25:52 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-dev@jakarta.apache.org Received: (qmail 2820 invoked by uid 97); 8 Nov 2001 21:25:51 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 2809 invoked by uid 97); 8 Nov 2001 21:25:50 -0000 Date: 8 Nov 2001 21:13:56 -0000 Message-ID: <20011108211356.280.qmail@icarus.apache.org> From: remm@apache.org To: jakarta-tomcat-4.0-cvs@apache.org Subject: cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core StandardServer.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N remm 01/11/08 13:13:56 Modified: catalina/src/share/org/apache/catalina/core StandardServer.java Log: - Add getter / setter for the global NamingResources. - Automatically initialize the listener when naming support is enabled. Revision Changes Path 1.13 +63 -4 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardServer.java Index: StandardServer.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardServer.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- StandardServer.java 2001/09/04 19:19:48 1.12 +++ StandardServer.java 2001/11/08 21:13:56 1.13 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardServer.java,v 1.12 2001/09/04 19:19:48 craigmcc Exp $ - * $Revision: 1.12 $ - * $Date: 2001/09/04 19:19:48 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardServer.java,v 1.13 2001/11/08 21:13:56 remm Exp $ + * $Revision: 1.13 $ + * $Date: 2001/11/08 21:13:56 $ * * ==================================================================== * @@ -79,6 +79,7 @@ import org.apache.catalina.Server; import org.apache.catalina.ServerFactory; import org.apache.catalina.Service; +import org.apache.catalina.deploy.NamingResources; import org.apache.catalina.util.LifecycleSupport; import org.apache.catalina.util.StringManager; @@ -89,7 +90,7 @@ * (but not required) when deploying and starting Catalina. * * @author Craig R. McClanahan - * @version $Revision: 1.12 $ $Date: 2001/09/04 19:19:48 $ + * @version $Revision: 1.13 $ $Date: 2001/11/08 21:13:56 $ */ public final class StandardServer @@ -114,6 +115,12 @@ /** + * Global naming resources. + */ + private NamingResources globalNamingResources = null; + + + /** * Descriptive information about this Server implementation. */ private static final String info = @@ -127,6 +134,12 @@ /** + * The naming context listener for this web application. + */ + private NamingContextListener namingContextListener = null; + + + /** * The port number on which we wait for shutdown commands. */ private int port = 8005; @@ -174,6 +187,29 @@ /** + * Return the global naming resources. + */ + public NamingResources getGlobalNamingResources() { + + return (this.globalNamingResources); + + } + + + /** + * Set the global naming resources. + * + * @param namingResources The new global naming resources + */ + public void setGlobalNamingResources + (NamingResources globalNamingResources) { + + this.globalNamingResources = globalNamingResources; + + } + + + /** * Return descriptive information about this Server implementation and * the corresponding version number, in the format * <description>/<version>. @@ -450,6 +486,21 @@ } + /** + * Return true if naming should be used. + */ + private boolean isUseNaming() { + boolean useNaming = true; + // Reading the "catalina.useNaming" environment variable + String useNamingProperty = System.getProperty("catalina.useNaming"); + if ((useNamingProperty != null) + && (useNamingProperty.equals("false"))) { + useNaming = false; + } + return useNaming; + } + + // ------------------------------------------------------ Lifecycle Methods @@ -494,6 +545,14 @@ if (started) throw new LifecycleException (sm.getString("standardServer.start.started")); + + if (isUseNaming()) { + if ((globalNamingResources != null) + && (namingContextListener == null)) { + namingContextListener = new NamingContextListener(); + addLifecycleListener(namingContextListener); + } + } lifecycle.fireLifecycleEvent(START_EVENT, null); started = true; -- To unsubscribe, e-mail: For additional commands, e-mail: