You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by la...@locus.apache.org on 2000/08/27 02:40:04 UTC
cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core Handler.java ServletWrapper.java
larryi 00/08/26 17:40:04
Modified: src/share/org/apache/tomcat/context Tag: tomcat_32
LoadOnStartupInterceptor.java
src/share/org/apache/tomcat/core Tag: tomcat_32 Handler.java
ServletWrapper.java
Log:
Fix <load-on-startup></load-on-startup> and <load-on-startup>0</load-on-startup>
so they load on startup.
Fix permanently unavailable servlets so they are permanently unavailable.
Revision Changes Path
No revision
No revision
1.15.2.1 +2 -3 jakarta-tomcat/src/share/org/apache/tomcat/context/LoadOnStartupInterceptor.java
Index: LoadOnStartupInterceptor.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/context/LoadOnStartupInterceptor.java,v
retrieving revision 1.15
retrieving revision 1.15.2.1
diff -u -r1.15 -r1.15.2.1
--- LoadOnStartupInterceptor.java 2000/06/23 15:14:33 1.15
+++ LoadOnStartupInterceptor.java 2000/08/27 00:40:03 1.15.2.1
@@ -181,9 +181,8 @@
while(enum.hasMoreElements()) {
String name=(String)enum.nextElement();
ServletWrapper sw=ctx.getServletByName( name );
- int i=sw.getLoadOnStartUp();
- Integer level=new Integer(i);
- if( i!= 0) {
+ if(sw.getLoadOnStartUp()) {
+ Integer level=new Integer(sw.getLoadOnStartUpLevel());
Vector v;
if( loadableServlets.get(level) != null )
v=(Vector)loadableServlets.get(level);
No revision
No revision
1.7.2.1 +5 -3 jakarta-tomcat/src/share/org/apache/tomcat/core/Handler.java
Index: Handler.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Handler.java,v
retrieving revision 1.7
retrieving revision 1.7.2.1
diff -u -r1.7 -r1.7.2.1
--- Handler.java 2000/06/28 15:42:54 1.7
+++ Handler.java 2000/08/27 00:40:04 1.7.2.1
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Handler.java,v 1.7 2000/06/28 15:42:54 costin Exp $
- * $Revision: 1.7 $
- * $Date: 2000/06/28 15:42:54 $
+ * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Handler.java,v 1.7.2.1 2000/08/27 00:40:04 larryi Exp $
+ * $Revision: 1.7.2.1 $
+ * $Date: 2000/08/27 00:40:04 $
*
* ====================================================================
*
@@ -241,6 +241,8 @@
if( ! initialized ) {
try {
init();
+ if ( ! initialized )
+ return; // return if still not initialied
} catch( Exception ex ) {
initialized=false;
if( ex instanceof ClassNotFoundException ) {
1.60.2.2 +25 -6 jakarta-tomcat/src/share/org/apache/tomcat/core/Attic/ServletWrapper.java
Index: ServletWrapper.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Attic/ServletWrapper.java,v
retrieving revision 1.60.2.1
retrieving revision 1.60.2.2
diff -u -r1.60.2.1 -r1.60.2.2
--- ServletWrapper.java 2000/07/25 21:00:25 1.60.2.1
+++ ServletWrapper.java 2000/08/27 00:40:04 1.60.2.2
@@ -106,7 +106,8 @@
protected long lastAccessed;
protected int serviceCount = 0;
- int loadOnStartup=0;
+ boolean loadOnStartup=false;
+ int loadOnStartupLevel=-1;
Hashtable securityRoleRefs=new Hashtable();
@@ -125,17 +126,24 @@
// -------------------- Servlet specific properties
public void setLoadOnStartUp( int level ) {
- loadOnStartup=level;
+ loadOnStartupLevel=level;
+ loadOnStartup=true;
}
public void setLoadOnStartUp( String level ) {
- loadOnStartup=new Integer(level).intValue();
+ if (level.length() > 0)
+ loadOnStartupLevel=new Integer(level).intValue();
+ loadOnStartup=true;
}
- public int getLoadOnStartUp() {
+ public boolean getLoadOnStartUp() {
return loadOnStartup;
}
-
+
+ public int getLoadOnStartUpLevel() {
+ return loadOnStartupLevel;
+ }
+
void setReloadable(boolean reloadable) {
isReloadable = reloadable;
}
@@ -342,7 +350,14 @@
}
if( unavailable!=null ) {
- // Don't load if Unavailable timer is in place
+ // Don't load at all if permanently unavailable
+ if (((UnavailableException) unavailable).getUnavailableSeconds() == -1) {
+ handleUnavailable( req, res );
+ initialized = false;
+ return;
+ }
+
+ // Don't load if Unavailable timer is in place
if( stillUnavailable() ) {
handleUnavailable( req, res );
initialized=false;
@@ -354,6 +369,10 @@
// called only if unavailable==null or timer expired.
// will do an init
super.service( req, res );
+
+ // if unavailable set, assume problem in init()
+ if (unavailable!=null)
+ handleUnavailable( req, res);
}
protected void doService(Request req, Response res)