Author: remy.maucherat(a)jboss.com
Date: 2011-10-12 10:52:10 -0400 (Wed, 12 Oct 2011)
New Revision: 1850
Modified:
trunk/java/org/apache/catalina/Service.java
trunk/java/org/apache/catalina/core/StandardService.java
Log:
- With delay connector startup, don't do any connector startup.
Modified: trunk/java/org/apache/catalina/Service.java
===================================================================
--- trunk/java/org/apache/catalina/Service.java 2011-10-12 14:29:54 UTC (rev 1849)
+++ trunk/java/org/apache/catalina/Service.java 2011-10-12 14:52:10 UTC (rev 1850)
@@ -115,7 +115,7 @@
*
* @param connector The Connector to be added
*/
- public void addConnector(Connector connector) throws LifecycleException;
+ public void addConnector(Connector connector);
/**
* Find and return the set of Connectors associated with this Service.
Modified: trunk/java/org/apache/catalina/core/StandardService.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardService.java 2011-10-12 14:29:54 UTC (rev
1849)
+++ trunk/java/org/apache/catalina/core/StandardService.java 2011-10-12 14:52:10 UTC (rev
1850)
@@ -336,7 +336,7 @@
*
* @param connector The Connector to be added
*/
- public void addConnector(Connector connector) throws LifecycleException {
+ public void addConnector(Connector connector) {
synchronized (connectors) {
connector.setContainer(this.container);
@@ -346,21 +346,21 @@
results[connectors.length] = connector;
connectors = results;
- if (initialized) {
- try {
- connector.init();
- } catch (LifecycleException e) {
- log.error("Connector.initialize", e);
- throw new LifecycleException("Can't initialize
Connector");
+ if (!DELAY_CONNECTOR_STARTUP) {
+ if (initialized) {
+ try {
+ connector.init();
+ } catch (LifecycleException e) {
+ log.error("Connector.initialize", e);
+ }
}
- }
- if (started && (connector instanceof Lifecycle)) {
- try {
- ((Lifecycle) connector).start();
- } catch (LifecycleException e) {
- log.error("Connector.start", e);
- throw new LifecycleException("Can't start Connector");
+ if (started && (connector instanceof Lifecycle)) {
+ try {
+ ((Lifecycle) connector).start();
+ } catch (LifecycleException e) {
+ log.error("Connector.start", e);
+ }
}
}
@@ -757,9 +757,11 @@
addLifecycleListener(mapperListener);
// Initialize our defined Connectors
- synchronized (connectors) {
- for (int i = 0; i < connectors.length; i++) {
- connectors[i].init();
+ if (!DELAY_CONNECTOR_STARTUP) {
+ synchronized (connectors) {
+ for (int i = 0; i < connectors.length; i++) {
+ connectors[i].init();
+ }
}
}
Show replies by date