jmcnally 02/04/29 13:41:45
Modified: src/java/org/apache/turbine Turbine.java
Log:
patch by Ben Peter <[EMAIL PROTECTED]> to remove method invocation
for small performance improvement. Also removes unused object instantiation.
Revision Changes Path
1.17 +22 -27 jakarta-turbine-2/src/java/org/apache/turbine/Turbine.java
Index: Turbine.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/Turbine.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- Turbine.java 22 Apr 2002 21:54:35 -0000 1.16
+++ Turbine.java 29 Apr 2002 20:41:45 -0000 1.17
@@ -117,7 +117,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Sean Legassick</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Martin Poeschl</a>
- * @version $Id: Turbine.java,v 1.16 2002/04/22 21:54:35 dlr Exp $
+ * @version $Id: Turbine.java,v 1.17 2002/04/29 20:41:45 jmcnally Exp $
*/
public class Turbine
extends HttpServlet
@@ -284,28 +284,25 @@
*/
public final void init(RunData data)
{
- if (firstDoGet)
+ synchronized (Turbine.class)
{
- synchronized (Turbine.class)
+ if (firstDoGet)
{
- if (firstDoGet)
- {
- serverName = data.getRequest().getServerName();
- serverPort =
Integer.toString(data.getRequest().getServerPort());
- serverScheme = data.getRequest().getScheme();
-
- // Store the context path for tools like ContentURI and
- // the UIManager that use webapp context path information
- // for constructing URLs.
- contextPath = data.getRequest().getContextPath();
-
- log("Turbine: Starting HTTP initialization of services");
- TurbineServices.getInstance().initServices(data);
- log("Turbine: Completed HTTP initialization of services");
-
- // Mark that we're done.
- firstDoGet = false;
- }
+ serverName = data.getRequest().getServerName();
+ serverPort = Integer.toString(data.getRequest().getServerPort());
+ serverScheme = data.getRequest().getScheme();
+
+ // Store the context path for tools like ContentURI and
+ // the UIManager that use webapp context path information
+ // for constructing URLs.
+ contextPath = data.getRequest().getContextPath();
+
+ log("Turbine: Starting HTTP initialization of services");
+ TurbineServices.getInstance().initServices(data);
+ log("Turbine: Completed HTTP initialization of services");
+
+ // Mark that we're done.
+ firstDoGet = false;
}
}
}
@@ -397,7 +394,10 @@
// If this is the first invocation, perform some
// initialization. Certain services need RunData to initialize
// themselves.
- init(data);
+ if (firstDoGet)
+ {
+ init(data);
+ }
// set the session timeout if specified in turbine's properties
// file if this is a new session
@@ -413,11 +413,6 @@
// Fill in the screen and action variables.
data.setScreen ( data.getParameters().getString("screen") );
data.setAction ( data.getParameters().getString("action") );
-
- // Get the instance of the Session Validator.
- SessionValidator sessionValidator = (SessionValidator)ActionLoader
- .getInstance().getInstance(TurbineResources.getString(
- "action.sessionvalidator"));
// Special case for login and logout, this must happen before the
// session validator is executed in order either to allow a user to
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>