Author: remy.maucherat(a)jboss.com
Date: 2011-03-12 12:58:07 -0500 (Sat, 12 Mar 2011)
New Revision: 1673
Added:
trunk/java/org/apache/tomcat/util/Constants.java
Modified:
trunk/java/org/apache/catalina/connector/Connector.java
trunk/java/org/apache/catalina/core/ApplicationFilterConfig.java
trunk/java/org/apache/catalina/core/ContainerBase.java
trunk/java/org/apache/catalina/core/StandardContext.java
trunk/java/org/apache/catalina/core/StandardEngine.java
trunk/java/org/apache/catalina/core/StandardHost.java
trunk/java/org/apache/catalina/core/StandardPipeline.java
trunk/java/org/apache/catalina/core/StandardServer.java
trunk/java/org/apache/catalina/core/StandardService.java
trunk/java/org/apache/catalina/core/StandardWrapper.java
trunk/java/org/apache/catalina/realm/RealmBase.java
trunk/java/org/apache/catalina/session/ManagerBase.java
trunk/java/org/apache/catalina/startup/Embedded.java
trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java
trunk/java/org/apache/coyote/ajp/AjpProtocol.java
trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
trunk/java/org/apache/coyote/http11/Http11Protocol.java
Log:
- Add a system property to disable the legacy model MBeans. Removing this completely is
probably not an option.
Modified: trunk/java/org/apache/catalina/connector/Connector.java
===================================================================
--- trunk/java/org/apache/catalina/connector/Connector.java 2011-03-04 00:39:31 UTC (rev
1672)
+++ trunk/java/org/apache/catalina/connector/Connector.java 2011-03-12 17:58:07 UTC (rev
1673)
@@ -409,10 +409,6 @@
* Connector.
*/
public Container getContainer() {
- if( container==null ) {
- // Lazy - maybe it was added later
- findContainer();
- }
return (container);
}
@@ -982,7 +978,7 @@
/**
* Initialize this connector (create ServerSocket here!)
*/
- public void initialize()
+ public void init()
throws LifecycleException
{
if (initialized) {
@@ -993,18 +989,20 @@
this.initialized = true;
- if (oname == null) {
- try {
- // we are loaded directly, via API - and no name was given to us
- oname = createObjectName(container.getName(), "Connector");
- Registry.getRegistry(null, null)
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
+ if (oname == null) {
+ try {
+ // we are loaded directly, via API - and no name was given to us
+ oname = createObjectName(container.getName(),
"Connector");
+ Registry.getRegistry(null, null)
.registerComponent(this, oname, null);
- controller=oname;
- } catch (Exception e) {
- log.error( "Error registering connector ", e);
+ controller=oname;
+ } catch (Exception e) {
+ log.error( "Error registering connector ", e);
+ }
+ if(log.isDebugEnabled())
+ log.debug("Creating name for connector " + oname);
}
- if(log.isDebugEnabled())
- log.debug("Creating name for connector " + oname);
}
// Initializa adapter
@@ -1059,7 +1057,7 @@
*/
public void start() throws LifecycleException {
if( !initialized )
- initialize();
+ init();
// Validate and update our current state
if (started ) {
@@ -1072,19 +1070,21 @@
// We can't register earlier - the JMX registration of this happens
// in Server.start callback
- if ( this.oname != null ) {
- // We are registred - register the adapter as well.
- try {
- Registry.getRegistry(null, null).registerComponent
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
+ if ( this.oname != null ) {
+ // We are registred - register the adapter as well.
+ try {
+ Registry.getRegistry(null, null).registerComponent
(protocolHandler,
createObjectName(this.domain,"ProtocolHandler"), null);
- } catch (Exception ex) {
- log.error(sm.getString
- ("coyoteConnector.protocolRegistrationFailed"), ex);
+ } catch (Exception ex) {
+ log.error(sm.getString
+ ("coyoteConnector.protocolRegistrationFailed"),
ex);
+ }
+ } else {
+ if(log.isInfoEnabled())
+ log.info(sm.getString
+ ("coyoteConnector.cannotRegisterProtocol"));
}
- } else {
- if(log.isInfoEnabled())
- log.info(sm.getString
- ("coyoteConnector.cannotRegisterProtocol"));
}
try {
@@ -1119,12 +1119,14 @@
lifecycle.fireLifecycleEvent(STOP_EVENT, null);
started = false;
- try {
- Registry.getRegistry(null, null).unregisterComponent
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
+ try {
+ Registry.getRegistry(null, null).unregisterComponent
(createObjectName(this.domain,"ProtocolHandler"));
- } catch (MalformedObjectNameException e) {
- log.error( sm.getString
- ("coyoteConnector.protocolUnregistrationFailed"), e);
+ } catch (MalformedObjectNameException e) {
+ log.error( sm.getString
+ ("coyoteConnector.protocolUnregistrationFailed"), e);
+ }
}
try {
protocolHandler.destroy();
@@ -1183,62 +1185,14 @@
}
}
- protected void findContainer() {
- try {
- // Register to the service
- ObjectName parentName=new ObjectName( domain + ":" +
- "type=Service");
-
- if(log.isDebugEnabled())
- log.debug("Adding to " + parentName );
- if( mserver.isRegistered(parentName )) {
- mserver.invoke(parentName, "addConnector", new Object[] { this
},
- new String[]
{"org.apache.catalina.connector.Connector"});
- // As a side effect we'll get the container field set
- // Also initialize will be called
- //return;
- }
- // XXX Go directly to the Engine
- // initialize(); - is called by addConnector
- ObjectName engName=new ObjectName( domain + ":" +
"type=Engine");
- if( mserver.isRegistered(engName )) {
- Object obj=mserver.getAttribute(engName, "managedResource");
+ public void destroy() throws Exception {
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
+ if( oname!=null && controller==oname ) {
if(log.isDebugEnabled())
- log.debug("Found engine " + obj + " " +
obj.getClass());
- container=(Container)obj;
-
- // Internal initialize - we now have the Engine
- initialize();
-
- if(log.isDebugEnabled())
- log.debug("Initialized");
- // As a side effect we'll get the container field set
- // Also initialize will be called
- return;
+ log.debug("Unregister itself " + oname );
+ Registry.getRegistry(null, null).unregisterComponent(oname);
}
- } catch( Exception ex ) {
- log.error( "Error finding container " + ex);
}
- }
-
- public void init() throws Exception {
-
- if( this.getService() != null ) {
- if(log.isDebugEnabled())
- log.debug( "Already configured" );
- return;
- }
- if( container==null ) {
- findContainer();
- }
- }
-
- public void destroy() throws Exception {
- if( oname!=null && controller==oname ) {
- if(log.isDebugEnabled())
- log.debug("Unregister itself " + oname );
- Registry.getRegistry(null, null).unregisterComponent(oname);
- }
if( getService() == null)
return;
getService().removeConnector(this);
Modified: trunk/java/org/apache/catalina/core/ApplicationFilterConfig.java
===================================================================
--- trunk/java/org/apache/catalina/core/ApplicationFilterConfig.java 2011-03-04 00:39:31
UTC (rev 1672)
+++ trunk/java/org/apache/catalina/core/ApplicationFilterConfig.java 2011-03-12 17:58:07
UTC (rev 1673)
@@ -447,7 +447,9 @@
filter.init(this);
// Expose filter via JMX
- registerJMX();
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
+ registerJMX();
+ }
return (this.filter);
@@ -485,7 +487,9 @@
*/
void release() {
- unregsiterJMX();
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
+ unregsiterJMX();
+ }
if (this.filter != null)
{
Modified: trunk/java/org/apache/catalina/core/ContainerBase.java
===================================================================
--- trunk/java/org/apache/catalina/core/ContainerBase.java 2011-03-04 00:39:31 UTC (rev
1672)
+++ trunk/java/org/apache/catalina/core/ContainerBase.java 2011-03-12 17:58:07 UTC (rev
1673)
@@ -1164,16 +1164,18 @@
initialized=false;
// unregister this component
- if ( oname != null ) {
- try {
- if( controller == oname ) {
- Registry.getRegistry(null, null)
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
+ if ( oname != null ) {
+ try {
+ if( controller == oname ) {
+ Registry.getRegistry(null, null)
.unregisterComponent(oname);
- if(log.isDebugEnabled())
- log.debug("unregistering " + oname);
+ if(log.isDebugEnabled())
+ log.debug("unregistering " + oname);
+ }
+ } catch( Throwable t ) {
+ log.error("Error unregistering ", t );
}
- } catch( Throwable t ) {
- log.error("Error unregistering ", t );
}
}
Modified: trunk/java/org/apache/catalina/core/StandardContext.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardContext.java 2011-03-04 00:39:31 UTC (rev
1672)
+++ trunk/java/org/apache/catalina/core/StandardContext.java 2011-03-12 17:58:07 UTC (rev
1673)
@@ -3536,13 +3536,15 @@
((BaseDirContext) webappResources).allocate();
}
// Register the cache in JMX
- if (isCachingAllowed()) {
- ObjectName resourcesName =
- new ObjectName(this.getDomain() + ":type=Cache,host="
- + getHostname() + ",path="
- +
(("".equals(getPath()))?"/":getPath()));
- Registry.getRegistry(null, null).registerComponent
- (proxyDirContext.getCache(), resourcesName, null);
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
+ if (isCachingAllowed()) {
+ ObjectName resourcesName =
+ new ObjectName(this.getDomain() + ":type=Cache,host="
+ + getHostname() + ",path="
+ +
(("".equals(getPath()))?"/":getPath()));
+ Registry.getRegistry(null, null).registerComponent
+ (proxyDirContext.getCache(), resourcesName, null);
+ }
}
this.resources = proxyDirContext;
} catch (Throwable t) {
@@ -3571,15 +3573,17 @@
((BaseDirContext) webappResources).release();
}
// Unregister the cache in JMX
- if (isCachingAllowed()) {
- ObjectName resourcesName =
- new ObjectName(this.getDomain()
- + ":type=Cache,host="
- + getHostname() + ",path="
- + (("".equals(getPath()))?"/"
- :getPath()));
- Registry.getRegistry(null, null)
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
+ if (isCachingAllowed()) {
+ ObjectName resourcesName =
+ new ObjectName(this.getDomain()
+ + ":type=Cache,host="
+ + getHostname() + ",path="
+ + (("".equals(getPath()))?"/"
+ :getPath()));
+ Registry.getRegistry(null, null)
.unregisterComponent(resourcesName);
+ }
}
}
} catch (Throwable t) {
@@ -3657,14 +3661,16 @@
if(log.isDebugEnabled())
log.debug("Starting " + ("".equals(getName()) ?
"ROOT" : getName()));
- // Set JMX object name for proper pipeline registration
- preRegisterJMX();
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
+ // Set JMX object name for proper pipeline registration
+ preRegisterJMX();
- if ((oname != null) &&
- (Registry.getRegistry(null, null).getMBeanServer().isRegistered(oname))) {
- // As things depend on the JMX registration, the context
- // must be reregistered again once properly initialized
- Registry.getRegistry(null, null).unregisterComponent(oname);
+ if ((oname != null) &&
+ (Registry.getRegistry(null,
null).getMBeanServer().isRegistered(oname))) {
+ // As things depend on the JMX registration, the context
+ // must be reregistered again once properly initialized
+ Registry.getRegistry(null, null).unregisterComponent(oname);
+ }
}
// Notify our interested LifecycleListeners
@@ -3884,7 +3890,9 @@
setStarting(false);
// JMX registration
- registerJMX();
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
+ registerJMX();
+ }
startTime=System.currentTimeMillis();
@@ -4676,60 +4684,6 @@
public synchronized void init() throws Exception {
- if( this.getParent() == null ) {
- ObjectName parentName=getParentName();
-
- if( ! mserver.isRegistered(parentName)) {
- if(log.isDebugEnabled())
- log.debug("No host, creating one " + parentName);
- StandardHost host=new StandardHost();
- host.setName(hostName);
- Registry.getRegistry(null, null)
- .registerComponent(host, parentName, null);
- // We could do it the hard way...
- //mserver.invoke(parentName, "init", new Object[] {}, new
String[] {} );
- // or same thing easier:
- host.init();
- }
-
- // Add the main configuration listener
- LifecycleListener config = null;
- try {
- String configClassName = getConfigClass();
- if (configClassName == null) {
- try {
- configClassName = String.valueOf(mserver.getAttribute(parentName,
"configClass"));
- } catch (AttributeNotFoundException e) {
- // Ignore, it's normal a host may not have this optional
attribute
- }
- }
- if (configClassName != null) {
- Class clazz = Class.forName(configClassName);
- config = (LifecycleListener) clazz.newInstance();
- }
- } catch (Exception e) {
- log.warn("Error creating ContextConfig for " + parentName, e);
- throw e;
- }
- if (config != null) {
- this.addLifecycleListener(config);
- }
-
- if (log.isDebugEnabled()) {
- log.debug("AddChild " + parentName + " " + this);
- }
- try {
- mserver.invoke(parentName, "addChild", new Object[] { this },
- new String[] {"org.apache.catalina.Container"});
- } catch (Exception e) {
- destroy();
- throw e;
- }
- // It's possible that addChild may have started us
- if( initialized ) {
- return;
- }
- }
super.init();
// Notify our interested LifecycleListeners
Modified: trunk/java/org/apache/catalina/core/StandardEngine.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardEngine.java 2011-03-04 00:39:31 UTC (rev
1672)
+++ trunk/java/org/apache/catalina/core/StandardEngine.java 2011-03-12 17:58:07 UTC (rev
1673)
@@ -276,37 +276,39 @@
if( initialized ) return;
initialized=true;
- if( oname==null ) {
- // not registered in JMX yet - standalone mode
- try {
- if (domain==null) {
- domain=getName();
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
+ if( oname==null ) {
+ // not registered in JMX yet - standalone mode
+ try {
+ if (domain==null) {
+ domain=getName();
+ }
+ if(log.isDebugEnabled())
+ log.debug( "Register " + domain );
+ oname=new ObjectName(domain + ":type=Engine");
+ controller=oname;
+ Registry.getRegistry(null, null)
+ .registerComponent(this, oname, null);
+ } catch( Throwable t ) {
+ log.info("Error registering ", t );
}
- if(log.isDebugEnabled())
- log.debug( "Register " + domain );
- oname=new ObjectName(domain + ":type=Engine");
- controller=oname;
- Registry.getRegistry(null, null)
- .registerComponent(this, oname, null);
- } catch( Throwable t ) {
- log.info("Error registering ", t );
}
- }
- if( mbeansFile == null ) {
- String defaultMBeansFile=getBaseDir() +
"/conf/tomcat5-mbeans.xml";
- File f=new File( defaultMBeansFile );
- if( f.exists() ) mbeansFile=f.getAbsolutePath();
- }
- if( mbeansFile != null ) {
- readEngineMbeans();
- }
- if( mbeans != null ) {
- try {
- Registry.getRegistry(null, null).invoke(mbeans, "init",
false);
- } catch (Exception e) {
- log.error("Error in init() for " + mbeansFile, e);
+ if( mbeansFile == null ) {
+ String defaultMBeansFile=getBaseDir() +
"/conf/tomcat5-mbeans.xml";
+ File f=new File( defaultMBeansFile );
+ if( f.exists() ) mbeansFile=f.getAbsolutePath();
}
+ if( mbeansFile != null ) {
+ readEngineMbeans();
+ }
+ if( mbeans != null ) {
+ try {
+ Registry.getRegistry(null, null).invoke(mbeans, "init",
false);
+ } catch (Exception e) {
+ log.error("Error in init() for " + mbeansFile, e);
+ }
+ }
}
// not needed since the following if statement does the same thing the right way
@@ -350,31 +352,32 @@
// this call implizit this.stop()
((StandardService)service).destroy();
- if( mbeans != null ) {
- try {
- Registry.getRegistry(null, null)
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
+ if( mbeans != null ) {
+ try {
+ Registry.getRegistry(null, null)
.invoke(mbeans, "destroy", false);
- } catch (Exception e) {
-
log.error(sm.getString("standardEngine.unregister.mbeans.failed" ,mbeansFile),
e);
+ } catch (Exception e) {
+
log.error(sm.getString("standardEngine.unregister.mbeans.failed" ,mbeansFile),
e);
+ }
}
- }
- //
- if( mbeans != null ) {
- try {
- for( int i=0; i<mbeans.size() ; i++ ) {
- Registry.getRegistry(null, null)
+ //
+ if( mbeans != null ) {
+ try {
+ for( int i=0; i<mbeans.size() ; i++ ) {
+ Registry.getRegistry(null, null)
.unregisterComponent((ObjectName)mbeans.get(i));
+ }
+ } catch (Exception e) {
+
log.error(sm.getString("standardEngine.unregister.mbeans.failed", mbeansFile),
e);
}
- } catch (Exception e) {
-
log.error(sm.getString("standardEngine.unregister.mbeans.failed", mbeansFile),
e);
}
- }
-
- // force all metadata to be reloaded.
- // That doesn't affect existing beans. We should make it per
- // registry - and stop using the static.
- Registry.getRegistry(null, null).resetMetadata();
-
+
+ // force all metadata to be reloaded.
+ // That doesn't affect existing beans. We should make it per
+ // registry - and stop using the static.
+ Registry.getRegistry(null, null).resetMetadata();
+ }
}
/**
@@ -390,29 +393,31 @@
init();
}
- // Look for a realm - that may have been configured earlier.
- // If the realm is added after context - it'll set itself.
- if( realm == null ) {
- ObjectName realmName=null;
- try {
- realmName=new ObjectName( domain + ":type=Realm");
- if( mserver.isRegistered(realmName ) ) {
- mserver.invoke(realmName, "init",
- new Object[] {},
- new String[] {}
- );
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
+ // Look for a realm - that may have been configured earlier.
+ // If the realm is added after context - it'll set itself.
+ if( realm == null ) {
+ ObjectName realmName=null;
+ try {
+ realmName=new ObjectName( domain + ":type=Realm");
+ if( mserver.isRegistered(realmName ) ) {
+ mserver.invoke(realmName, "init",
+ new Object[] {},
+ new String[] {}
+ );
+ }
+ } catch( Throwable t ) {
+ log.debug("No realm for this engine " + realmName);
}
- } catch( Throwable t ) {
- log.debug("No realm for this engine " + realmName);
}
- }
-
- if( mbeans != null ) {
- try {
- Registry.getRegistry(null, null)
+
+ if( mbeans != null ) {
+ try {
+ Registry.getRegistry(null, null)
.invoke(mbeans, "start", false);
- } catch (Exception e) {
- log.error("Error in start() for " + mbeansFile, e);
+ } catch (Exception e) {
+ log.error("Error in start() for " + mbeansFile, e);
+ }
}
}
@@ -423,11 +428,13 @@
public void stop() throws LifecycleException {
super.stop();
- if( mbeans != null ) {
- try {
- Registry.getRegistry(null, null).invoke(mbeans, "stop",
false);
- } catch (Exception e) {
- log.error("Error in stop() for " + mbeansFile, e);
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
+ if( mbeans != null ) {
+ try {
+ Registry.getRegistry(null, null).invoke(mbeans, "stop",
false);
+ } catch (Exception e) {
+ log.error("Error in stop() for " + mbeansFile, e);
+ }
}
}
}
Modified: trunk/java/org/apache/catalina/core/StandardHost.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardHost.java 2011-03-04 00:39:31 UTC (rev
1672)
+++ trunk/java/org/apache/catalina/core/StandardHost.java 2011-03-12 17:58:07 UTC (rev
1673)
@@ -524,20 +524,22 @@
}
}
- if( oname==null ) {
- // not registered in JMX yet - standalone mode
- try {
- StandardEngine engine=(StandardEngine)parent;
- domain=engine.getName();
- if(log.isDebugEnabled())
- log.debug( "Register host " + getName() + " with
domain "+ domain );
- oname=new ObjectName(domain + ":type=Host,host=" +
- this.getName());
- controller = oname;
- Registry.getRegistry(null, null)
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
+ if( oname==null ) {
+ // not registered in JMX yet - standalone mode
+ try {
+ StandardEngine engine=(StandardEngine)parent;
+ domain=engine.getName();
+ if(log.isDebugEnabled())
+ log.debug( "Register host " + getName() + " with
domain "+ domain );
+ oname=new ObjectName(domain + ":type=Host,host=" +
+ this.getName());
+ controller = oname;
+ Registry.getRegistry(null, null)
.registerComponent(this, oname, null);
- } catch( Throwable t ) {
- log.error("Host registering failed!", t );
+ } catch( Throwable t ) {
+ log.error("Host registering failed!", t );
+ }
}
}
}
Modified: trunk/java/org/apache/catalina/core/StandardPipeline.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardPipeline.java 2011-03-04 00:39:31 UTC (rev
1672)
+++ trunk/java/org/apache/catalina/core/StandardPipeline.java 2011-03-12 17:58:07 UTC (rev
1673)
@@ -233,7 +233,9 @@
while (current != null) {
if (current instanceof Lifecycle)
((Lifecycle) current).start();
- registerValve(current);
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
+ registerValve(current);
+ }
current = current.getNext();
}
@@ -315,20 +317,22 @@
}
private void unregisterValve(Valve valve) {
- if( valve instanceof ValveBase ) {
- try {
- ValveBase vb=(ValveBase)valve;
- if( vb.getController()!=null &&
- vb.getController() ==
- ((ContainerBase)container).getJmxName() ) {
-
- ObjectName vname=vb.getObjectName();
- Registry.getRegistry(null, null).getMBeanServer()
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
+ if( valve instanceof ValveBase ) {
+ try {
+ ValveBase vb=(ValveBase)valve;
+ if( vb.getController()!=null &&
+ vb.getController() ==
+ ((ContainerBase)container).getJmxName() ) {
+
+ ObjectName vname=vb.getObjectName();
+ Registry.getRegistry(null, null).getMBeanServer()
.unregisterMBean(vname);
- ((ValveBase)valve).setObjectName(null);
+ ((ValveBase)valve).setObjectName(null);
+ }
+ } catch( Throwable t ) {
+ log.info( "Can't unregister valve " + valve , t );
}
- } catch( Throwable t ) {
- log.info( "Can't unregister valve " + valve , t );
}
}
}
@@ -449,7 +453,9 @@
}
}
// Register the newly added valve
- registerValve(valve);
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
+ registerValve(valve);
+ }
}
// Add this Valve to the set associated with this Pipeline
Modified: trunk/java/org/apache/catalina/core/StandardServer.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardServer.java 2011-03-04 00:39:31 UTC (rev
1672)
+++ trunk/java/org/apache/catalina/core/StandardServer.java 2011-03-12 17:58:07 UTC (rev
1673)
@@ -418,25 +418,27 @@
lifecycle.fireLifecycleEvent(INIT_EVENT, null);
initialized = true;
- if( oname==null ) {
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
+ if( oname==null ) {
+ try {
+ oname=new ObjectName( "Catalina:type=Server");
+ Registry.getRegistry(null, null)
+ .registerComponent(this, oname, null );
+ } catch (Exception e) {
+ log.error("Error registering ",e);
+ }
+ }
+
+ // Register global String cache
try {
- oname=new ObjectName( "Catalina:type=Server");
+ ObjectName oname2 =
+ new ObjectName(oname.getDomain() + ":type=StringCache");
Registry.getRegistry(null, null)
- .registerComponent(this, oname, null );
+ .registerComponent(new StringCache(), oname2, null );
} catch (Exception e) {
log.error("Error registering ",e);
}
}
-
- // Register global String cache
- try {
- ObjectName oname2 =
- new ObjectName(oname.getDomain() + ":type=StringCache");
- Registry.getRegistry(null, null)
- .registerComponent(new StringCache(), oname2, null );
- } catch (Exception e) {
- log.error("Error registering ",e);
- }
// Initialize our defined Services
for (int i = 0; i < services.length; i++) {
Modified: trunk/java/org/apache/catalina/core/StandardService.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardService.java 2011-03-04 00:39:31 UTC (rev
1672)
+++ trunk/java/org/apache/catalina/core/StandardService.java 2011-03-12 17:58:07 UTC (rev
1673)
@@ -348,7 +348,7 @@
if (initialized) {
try {
- connector.initialize();
+ connector.init();
} catch (LifecycleException e) {
log.error("Connector.initialize", e);
}
@@ -682,23 +682,24 @@
}
}
- if( oname==controller ) {
- // we registered ourself on init().
- // That should be the typical case - this object is just for
- // backward compat, nobody should bother to load it explicitely
- Registry.getRegistry(null, null).unregisterComponent(oname);
- Executor[] executors = findExecutors();
- for (int i = 0; i < executors.length; i++) {
- try {
- ObjectName executorObjectName =
- new ObjectName(domain + ":type=Executor,name=" +
executors[i].getName());
- Registry.getRegistry(null,
null).unregisterComponent(executorObjectName);
- } catch (Exception e) {
- // Ignore (invalid ON, which cannot happen)
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
+ if( oname==controller ) {
+ // we registered ourself on init().
+ // That should be the typical case - this object is just for
+ // backward compat, nobody should bother to load it explicitely
+ Registry.getRegistry(null, null).unregisterComponent(oname);
+ Executor[] executors = findExecutors();
+ for (int i = 0; i < executors.length; i++) {
+ try {
+ ObjectName executorObjectName =
+ new ObjectName(domain + ":type=Executor,name=" +
executors[i].getName());
+ Registry.getRegistry(null,
null).unregisterComponent(executorObjectName);
+ } catch (Exception e) {
+ // Ignore (invalid ON, which cannot happen)
+ }
}
}
- }
-
+ }
// Notify our interested LifecycleListeners
lifecycle.fireLifecycleEvent(AFTER_STOP_EVENT, null);
@@ -721,29 +722,29 @@
}
initialized = true;
- if( oname==null ) {
- try {
- // Hack - Server should be deprecated...
- Container engine=this.getContainer();
- domain=engine.getName();
- oname=new ObjectName(domain +
":type=Service,serviceName="+name);
- this.controller=oname;
- Registry.getRegistry(null, null)
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
+ if( oname==null ) {
+ try {
+ // Hack - Server should be deprecated...
+ Container engine=this.getContainer();
+ domain=engine.getName();
+ oname=new ObjectName(domain +
":type=Service,serviceName="+name);
+ this.controller=oname;
+ Registry.getRegistry(null, null)
.registerComponent(this, oname, null);
-
- Executor[] executors = findExecutors();
- for (int i = 0; i < executors.length; i++) {
- ObjectName executorObjectName =
- new ObjectName(domain + ":type=Executor,name=" +
executors[i].getName());
- Registry.getRegistry(null, null)
+
+ Executor[] executors = findExecutors();
+ for (int i = 0; i < executors.length; i++) {
+ ObjectName executorObjectName =
+ new ObjectName(domain + ":type=Executor,name=" +
executors[i].getName());
+ Registry.getRegistry(null, null)
.registerComponent(executors[i], executorObjectName, null);
+ }
+
+ } catch (Exception e) {
+
log.error(sm.getString("standardService.register.failed",domain),e);
}
-
- } catch (Exception e) {
-
log.error(sm.getString("standardService.register.failed",domain),e);
}
-
-
}
if( server==null ) {
// If no server was defined - create one
@@ -756,7 +757,7 @@
// Initialize our defined Connectors
synchronized (connectors) {
for (int i = 0; i < connectors.length; i++) {
- connectors[i].initialize();
+ connectors[i].init();
}
}
Modified: trunk/java/org/apache/catalina/core/StandardWrapper.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardWrapper.java 2011-03-04 00:39:31 UTC (rev
1672)
+++ trunk/java/org/apache/catalina/core/StandardWrapper.java 2011-03-12 17:58:07 UTC (rev
1673)
@@ -1644,8 +1644,10 @@
// Start up this component
super.start();
- if( oname != null )
- registerJMX((StandardContext)getParent());
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
+ if( oname != null )
+ registerJMX((StandardContext)getParent());
+ }
// Load and initialize an instance of this servlet if requested
// MOVED TO StandardContext START() METHOD
@@ -1700,18 +1702,20 @@
broadcaster.sendNotification(notification);
}
- if( oname != null ) {
- Registry.getRegistry(null, null).unregisterComponent(oname);
-
- // Send j2ee.object.deleted notification
- Notification notification =
- new Notification("j2ee.object.deleted", this.getObjectName(),
- sequenceNumber++);
- broadcaster.sendNotification(notification);
- }
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
+ if( oname != null ) {
+ Registry.getRegistry(null, null).unregisterComponent(oname);
- if (isJspServlet && jspMonitorON != null ) {
- Registry.getRegistry(null, null).unregisterComponent(jspMonitorON);
+ // Send j2ee.object.deleted notification
+ Notification notification =
+ new Notification("j2ee.object.deleted",
this.getObjectName(),
+ sequenceNumber++);
+ broadcaster.sendNotification(notification);
+ }
+
+ if (isJspServlet && jspMonitorON != null ) {
+ Registry.getRegistry(null, null).unregisterComponent(jspMonitorON);
+ }
}
}
Modified: trunk/java/org/apache/catalina/realm/RealmBase.java
===================================================================
--- trunk/java/org/apache/catalina/realm/RealmBase.java 2011-03-04 00:39:31 UTC (rev
1672)
+++ trunk/java/org/apache/catalina/realm/RealmBase.java 2011-03-12 17:58:07 UTC (rev
1673)
@@ -1091,15 +1091,17 @@
public void destroy() {
- // unregister this realm
- if ( oname!=null ) {
- try {
- Registry.getRegistry(null, null).unregisterComponent(oname);
- if(log.isDebugEnabled())
- log.debug( "unregistering realm " + oname );
- } catch( Exception ex ) {
- log.error( "Can't unregister realm " + oname, ex);
- }
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
+ // unregister this realm
+ if ( oname!=null ) {
+ try {
+ Registry.getRegistry(null, null).unregisterComponent(oname);
+ if(log.isDebugEnabled())
+ log.debug( "unregistering realm " + oname );
+ } catch( Exception ex ) {
+ log.error( "Can't unregister realm " + oname, ex);
+ }
+ }
}
}
@@ -1380,44 +1382,46 @@
if( initialized && container != null ) return;
initialized=true;
- if( container== null ) {
- ObjectName parent=null;
- // Register with the parent
- try {
- if( host == null ) {
- // global
- parent=new ObjectName(domain +":type=Engine");
- } else if( path==null ) {
- parent=new ObjectName(domain +
- ":type=Host,host=" + host);
- } else {
- parent=new ObjectName(domain +":j2eeType=WebModule,name=//"
+
- host + path);
+
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
+ if( container== null ) {
+ ObjectName parent=null;
+ // Register with the parent
+ try {
+ if( host == null ) {
+ // global
+ parent=new ObjectName(domain +":type=Engine");
+ } else if( path==null ) {
+ parent=new ObjectName(domain +
+ ":type=Host,host=" + host);
+ } else {
+ parent=new ObjectName(domain
+":j2eeType=WebModule,name=//" +
+ host + path);
+ }
+ if( mserver.isRegistered(parent )) {
+ if(log.isDebugEnabled())
+ log.debug("Register with " + parent);
+ mserver.setAttribute(parent, new Attribute("realm",
this));
+ }
+ } catch (Exception e) {
+ log.error("Parent not available yet: " + parent);
}
- if( mserver.isRegistered(parent )) {
+ }
+
+ if( oname==null ) {
+ // register
+ try {
+ ContainerBase cb=(ContainerBase)container;
+ oname=new ObjectName(cb.getDomain()+":type=Realm" +
+ getRealmSuffix() + cb.getContainerSuffix());
+ Registry.getRegistry(null, null).registerComponent(this, oname, null
);
if(log.isDebugEnabled())
- log.debug("Register with " + parent);
- mserver.setAttribute(parent, new Attribute("realm",
this));
+ log.debug("Register Realm "+oname);
+ } catch (Throwable e) {
+ log.error( "Can't register " + oname, e);
}
- } catch (Exception e) {
- log.error("Parent not available yet: " + parent);
}
}
-
- if( oname==null ) {
- // register
- try {
- ContainerBase cb=(ContainerBase)container;
- oname=new ObjectName(cb.getDomain()+":type=Realm" +
- getRealmSuffix() + cb.getContainerSuffix());
- Registry.getRegistry(null, null).registerComponent(this, oname, null );
- if(log.isDebugEnabled())
- log.debug("Register Realm "+oname);
- } catch (Throwable e) {
- log.error( "Can't register " + oname, e);
- }
- }
-
}
protected String getRealmSuffix() {
Modified: trunk/java/org/apache/catalina/session/ManagerBase.java
===================================================================
--- trunk/java/org/apache/catalina/session/ManagerBase.java 2011-03-04 00:39:31 UTC (rev
1672)
+++ trunk/java/org/apache/catalina/session/ManagerBase.java 2011-03-12 17:58:07 UTC (rev
1673)
@@ -399,8 +399,10 @@
}
public void destroy() {
- if( oname != null )
- Registry.getRegistry(null, null).unregisterComponent(oname);
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
+ if( oname != null )
+ Registry.getRegistry(null, null).unregisterComponent(oname);
+ }
initialized=false;
oname = null;
}
@@ -411,22 +413,24 @@
log = Logger.getLogger(ManagerBase.class);
- if( oname==null ) {
- try {
- StandardContext ctx=(StandardContext)this.getContainer();
- Engine eng=(Engine)ctx.getParent().getParent();
- domain=ctx.getEngineName();
- distributable = ctx.getDistributable();
- StandardHost hst=(StandardHost)ctx.getParent();
- String path = ctx.getPath();
- if (path.equals("")) {
- path = "/";
- }
- oname=new ObjectName(domain + ":type=Manager,path="
- + path + ",host=" + hst.getName());
- Registry.getRegistry(null, null).registerComponent(this, oname, null );
- } catch (Exception e) {
- log.error("Error registering ",e);
+ StandardContext ctx=(StandardContext)this.getContainer();
+ distributable = ctx.getDistributable();
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
+ if( oname==null ) {
+ try {
+ Engine eng=(Engine)ctx.getParent().getParent();
+ domain=ctx.getEngineName();
+ StandardHost hst=(StandardHost)ctx.getParent();
+ String path = ctx.getPath();
+ if (path.equals("")) {
+ path = "/";
+ }
+ oname=new ObjectName(domain + ":type=Manager,path="
+ + path + ",host=" + hst.getName());
+ Registry.getRegistry(null, null).registerComponent(this, oname, null
);
+ } catch (Exception e) {
+ log.error("Error registering ",e);
+ }
}
}
Modified: trunk/java/org/apache/catalina/startup/Embedded.java
===================================================================
--- trunk/java/org/apache/catalina/startup/Embedded.java 2011-03-04 00:39:31 UTC (rev
1672)
+++ trunk/java/org/apache/catalina/startup/Embedded.java 2011-03-12 17:58:07 UTC (rev
1673)
@@ -724,7 +724,7 @@
// Start our defined Connectors second
for (int i = 0; i < connectors.length; i++) {
- connectors[i].initialize();
+ connectors[i].init();
if (connectors[i] instanceof Lifecycle)
((Lifecycle) connectors[i]).start();
}
Modified: trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java
===================================================================
--- trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java 2011-03-04 00:39:31 UTC (rev
1672)
+++ trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java 2011-03-12 17:58:07 UTC (rev
1673)
@@ -181,19 +181,21 @@
public void start() throws Exception {
- if (this.domain != null ) {
- try {
- tpOname = new ObjectName
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
+ if (this.domain != null ) {
+ try {
+ tpOname = new ObjectName
(domain + ":" + "type=ThreadPool,name=" +
getName());
- Registry.getRegistry(null, null)
+ Registry.getRegistry(null, null)
.registerComponent(endpoint, tpOname, null );
- } catch (Exception e) {
- log.error("Can't register threadpool" );
- }
- rgOname = new ObjectName
+ } catch (Exception e) {
+ log.error("Can't register threadpool" );
+ }
+ rgOname = new ObjectName
(domain + ":type=GlobalRequestProcessor,name=" + getName());
- Registry.getRegistry(null, null).registerComponent
+ Registry.getRegistry(null, null).registerComponent
(cHandler.global, rgOname, null);
+ }
}
try {
@@ -270,10 +272,12 @@
throw ex;
}
}
- if (tpOname!=null)
- Registry.getRegistry(null, null).unregisterComponent(tpOname);
- if (rgOname != null)
- Registry.getRegistry(null, null).unregisterComponent(rgOname);
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
+ if (tpOname!=null)
+ Registry.getRegistry(null, null).unregisterComponent(tpOname);
+ if (rgOname != null)
+ Registry.getRegistry(null, null).unregisterComponent(rgOname);
+ }
}
// *
@@ -519,7 +523,7 @@
}
protected void register(AjpAprProcessor processor) {
- if (proto.getDomain() != null) {
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER &&
proto.getDomain() != null) {
synchronized (this) {
try {
long count = registerCount.incrementAndGet();
@@ -541,7 +545,7 @@
}
protected void unregister(AjpAprProcessor processor) {
- if (proto.getDomain() != null) {
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER &&
proto.getDomain() != null) {
synchronized (this) {
try {
RequestInfo rp = processor.getRequest().getRequestProcessor();
Modified: trunk/java/org/apache/coyote/ajp/AjpProtocol.java
===================================================================
--- trunk/java/org/apache/coyote/ajp/AjpProtocol.java 2011-03-04 00:39:31 UTC (rev 1672)
+++ trunk/java/org/apache/coyote/ajp/AjpProtocol.java 2011-03-12 17:58:07 UTC (rev 1673)
@@ -178,21 +178,22 @@
public void start() throws Exception {
- if (this.domain != null ) {
- try {
- tpOname = new ObjectName
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
+ if (this.domain != null ) {
+ try {
+ tpOname = new ObjectName
(domain + ":" + "type=ThreadPool,name=" +
getName());
- Registry.getRegistry(null, null)
+ Registry.getRegistry(null, null)
.registerComponent(endpoint, tpOname, null );
- } catch (Exception e) {
- log.error("Can't register threadpool" );
- }
- rgOname = new ObjectName
+ } catch (Exception e) {
+ log.error("Can't register threadpool" );
+ }
+ rgOname = new ObjectName
(domain + ":type=GlobalRequestProcessor,name=" + getName());
- Registry.getRegistry(null, null).registerComponent
+ Registry.getRegistry(null, null).registerComponent
(cHandler.global, rgOname, null);
+ }
}
-
try {
endpoint.start();
} catch (Exception ex) {
@@ -248,10 +249,12 @@
if (log.isInfoEnabled())
log.info(sm.getString("ajpprotocol.stop", getName()));
endpoint.destroy();
- if (tpOname!=null)
- Registry.getRegistry(null, null).unregisterComponent(tpOname);
- if (rgOname != null)
- Registry.getRegistry(null, null).unregisterComponent(rgOname);
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
+ if (tpOname!=null)
+ Registry.getRegistry(null, null).unregisterComponent(tpOname);
+ if (rgOname != null)
+ Registry.getRegistry(null, null).unregisterComponent(rgOname);
+ }
}
// *
@@ -483,7 +486,7 @@
}
protected void register(AjpProcessor processor) {
- if (proto.getDomain() != null) {
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER &&
proto.getDomain() != null) {
synchronized (this) {
try {
long count = registerCount.incrementAndGet();
@@ -505,7 +508,7 @@
}
protected void unregister(AjpProcessor processor) {
- if (proto.getDomain() != null) {
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER &&
proto.getDomain() != null) {
synchronized (this) {
try {
RequestInfo rp = processor.getRequest().getRequestProcessor();
Modified: trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
===================================================================
--- trunk/java/org/apache/coyote/http11/Http11AprProtocol.java 2011-03-04 00:39:31 UTC
(rev 1672)
+++ trunk/java/org/apache/coyote/http11/Http11AprProtocol.java 2011-03-12 17:58:07 UTC
(rev 1673)
@@ -128,21 +128,22 @@
ObjectName rgOname;
public void start() throws Exception {
- if( this.domain != null ) {
- try {
- tpOname=new ObjectName
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
+ if( this.domain != null ) {
+ try {
+ tpOname=new ObjectName
(domain + ":" + "type=ThreadPool,name=" +
getName());
- Registry.getRegistry(null, null)
- .registerComponent(endpoint, tpOname, null );
- } catch (Exception e) {
- log.error("Can't register threadpool" );
- }
- rgOname=new ObjectName
+ Registry.getRegistry(null, null)
+ .registerComponent(endpoint, tpOname, null );
+ } catch (Exception e) {
+ log.error("Can't register threadpool" );
+ }
+ rgOname=new ObjectName
(domain + ":type=GlobalRequestProcessor,name=" + getName());
- Registry.getRegistry(null, null).registerComponent
+ Registry.getRegistry(null, null).registerComponent
( cHandler.global, rgOname, null );
+ }
}
-
try {
endpoint.start();
} catch (Exception ex) {
@@ -217,10 +218,12 @@
throw ex;
}
}
- if( tpOname!=null )
- Registry.getRegistry(null, null).unregisterComponent(tpOname);
- if( rgOname != null )
- Registry.getRegistry(null, null).unregisterComponent(rgOname);
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
+ if( tpOname!=null )
+ Registry.getRegistry(null, null).unregisterComponent(tpOname);
+ if( rgOname != null )
+ Registry.getRegistry(null, null).unregisterComponent(rgOname);
+ }
}
public String getName() {
@@ -681,7 +684,7 @@
}
protected void register(Http11AprProcessor processor) {
- if (proto.getDomain() != null) {
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER &&
proto.getDomain() != null) {
synchronized (this) {
try {
long count = registerCount.incrementAndGet();
@@ -703,7 +706,7 @@
}
protected void unregister(Http11AprProcessor processor) {
- if (proto.getDomain() != null) {
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER &&
proto.getDomain() != null) {
synchronized (this) {
try {
RequestInfo rp = processor.getRequest().getRequestProcessor();
Modified: trunk/java/org/apache/coyote/http11/Http11Protocol.java
===================================================================
--- trunk/java/org/apache/coyote/http11/Http11Protocol.java 2011-03-04 00:39:31 UTC (rev
1672)
+++ trunk/java/org/apache/coyote/http11/Http11Protocol.java 2011-03-12 17:58:07 UTC (rev
1673)
@@ -194,21 +194,22 @@
}
public void start() throws Exception {
- if (this.domain != null) {
- try {
- tpOname = new ObjectName
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
+ if (this.domain != null) {
+ try {
+ tpOname = new ObjectName
(domain + ":" + "type=ThreadPool,name=" +
getName());
- Registry.getRegistry(null, null)
+ Registry.getRegistry(null, null)
.registerComponent(endpoint, tpOname, null );
- } catch (Exception e) {
- log.error("Can't register endpoint");
- }
- rgOname=new ObjectName
+ } catch (Exception e) {
+ log.error("Can't register endpoint");
+ }
+ rgOname=new ObjectName
(domain + ":type=GlobalRequestProcessor,name=" + getName());
- Registry.getRegistry(null, null).registerComponent
+ Registry.getRegistry(null, null).registerComponent
( cHandler.global, rgOname, null );
+ }
}
-
try {
endpoint.start();
} catch (Exception ex) {
@@ -264,10 +265,12 @@
if (log.isInfoEnabled())
log.info(sm.getString("http11protocol.stop", getName()));
endpoint.destroy();
- if (tpOname!=null)
- Registry.getRegistry(null, null).unregisterComponent(tpOname);
- if (rgOname != null)
- Registry.getRegistry(null, null).unregisterComponent(rgOname);
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
+ if (tpOname!=null)
+ Registry.getRegistry(null, null).unregisterComponent(tpOname);
+ if (rgOname != null)
+ Registry.getRegistry(null, null).unregisterComponent(rgOname);
+ }
}
public String getName() {
@@ -710,7 +713,7 @@
}
protected void register(Http11Processor processor) {
- if (proto.getDomain() != null) {
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER &&
proto.getDomain() != null) {
synchronized (this) {
try {
long count = registerCount.incrementAndGet();
@@ -732,7 +735,7 @@
}
protected void unregister(Http11Processor processor) {
- if (proto.getDomain() != null) {
+ if (org.apache.tomcat.util.Constants.ENABLE_MODELER &&
proto.getDomain() != null) {
synchronized (this) {
try {
RequestInfo rp = processor.getRequest().getRequestProcessor();
Added: trunk/java/org/apache/tomcat/util/Constants.java
===================================================================
--- trunk/java/org/apache/tomcat/util/Constants.java (rev 0)
+++ trunk/java/org/apache/tomcat/util/Constants.java 2011-03-12 17:58:07 UTC (rev 1673)
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.tomcat.util;
+
+/**
+ * Constants.
+ *
+ * @author Remy Maucherat
+ */
+public final class Constants {
+
+ public static final boolean ENABLE_MODELER = Boolean.valueOf(System.getProperty(
+ "org.apache.tomcat.util.ENABLE_MODELER",
"false")).booleanValue();
+ public static final boolean LOW_MEMORY = Boolean.valueOf(System.getProperty(
+ "org.apache.tomcat.util.LOW_MEMORY",
"false")).booleanValue();
+
+}