Author: markt
Date: Tue Jan 21 20:15:06 2014
New Revision: 1560165
URL: http://svn.apache.org/r1560165
Log:
Simplify bind and unbind on start
Modified:
tomcat/trunk/java/org/apache/catalina/core/StandardContext.java
Modified: tomcat/trunk/java/org/apache/catalina/core/StandardContext.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardContext.java?rev=1560165&r1=1560164&r2=1560165&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardContext.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardContext.java Tue Jan 21
20:15:06 2014
@@ -5015,9 +5015,7 @@ public class StandardContext extends Con
ClassLoader oldCCL = bindThread();
try {
-
if (ok) {
-
// Start our subordinate components, if any
Loader loader = getLoader();
if ((loader != null) && (loader instanceof Lifecycle))
@@ -5104,40 +5102,31 @@ public class StandardContext extends Con
}
}
- } finally {
- // Unbinding thread
- unbindThread(oldCCL);
- }
-
- if (!getConfigured()) {
- log.error( "Error getConfigured");
- ok = false;
- }
-
- // We put the resources into the servlet context
- if (ok)
- getServletContext().setAttribute
- (Globals.RESOURCES_ATTR, getResources());
-
- // Binding thread
- oldCCL = bindThread();
+ if (!getConfigured()) {
+ log.error( "Error getConfigured");
+ ok = false;
+ }
- if (ok ) {
- if (getInstanceManager() == null) {
- javax.naming.Context context = null;
- if (isUseNaming() && getNamingContextListener() != null) {
- context = getNamingContextListener().getEnvContext();
+ // We put the resources into the servlet context
+ if (ok)
+ getServletContext().setAttribute
+ (Globals.RESOURCES_ATTR, getResources());
+
+ if (ok ) {
+ if (getInstanceManager() == null) {
+ javax.naming.Context context = null;
+ if (isUseNaming() && getNamingContextListener() != null) {
+ context = getNamingContextListener().getEnvContext();
+ }
+ Map<String, Map<String, String>> injectionMap =
buildInjectionMap(
+ getIgnoreAnnotations() ? new
NamingResourcesImpl(): getNamingResources());
+ setInstanceManager(new DefaultInstanceManager(context,
+ injectionMap, this,
this.getClass().getClassLoader()));
+ getServletContext().setAttribute(
+ InstanceManager.class.getName(),
getInstanceManager());
}
- Map<String, Map<String, String>> injectionMap =
buildInjectionMap(
- getIgnoreAnnotations() ? new NamingResourcesImpl():
getNamingResources());
- setInstanceManager(new DefaultInstanceManager(context,
- injectionMap, this, this.getClass().getClassLoader()));
- getServletContext().setAttribute(
- InstanceManager.class.getName(), getInstanceManager());
}
- }
- try {
// Create context attributes that will be required
if (ok) {
getServletContext().setAttribute(
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]