Author: ffang
Date: Wed Aug 4 08:13:27 2010
New Revision: 982152
URL: http://svn.apache.org/viewvc?rev=982152&view=rev
Log:
[SMXCOMP-785]expose soLingerTime on the jetty connector so that we can
configure it
Modified:
servicemix/components/bindings/servicemix-http/trunk/src/main/java/org/apache/servicemix/http/HttpConfiguration.java
servicemix/components/bindings/servicemix-http/trunk/src/main/java/org/apache/servicemix/http/HttpConfigurationMBean.java
servicemix/components/bindings/servicemix-http/trunk/src/main/java/org/apache/servicemix/http/jetty/JettyContextManager.java
servicemix/components/bindings/servicemix-http/trunk/src/main/resources/OSGI-INF/blueprint/servicemix-http.xml
Modified:
servicemix/components/bindings/servicemix-http/trunk/src/main/java/org/apache/servicemix/http/HttpConfiguration.java
URL:
http://svn.apache.org/viewvc/servicemix/components/bindings/servicemix-http/trunk/src/main/java/org/apache/servicemix/http/HttpConfiguration.java?rev=982152&r1=982151&r2=982152&view=diff
==============================================================================
---
servicemix/components/bindings/servicemix-http/trunk/src/main/java/org/apache/servicemix/http/HttpConfiguration.java
(original)
+++
servicemix/components/bindings/servicemix-http/trunk/src/main/java/org/apache/servicemix/http/HttpConfiguration.java
Wed Aug 4 08:13:27 2010
@@ -107,6 +107,11 @@ public class HttpConfiguration implement
* Jetty connector max idle time (default value in jetty is 30000msec)
**/
private int connectorMaxIdleTime = 30000;
+
+ /*
+ * Jetty connector soLingerTime in ms(default value in jetty is -1 which
means disable it)
+ */
+ private int soLingerTime = -1;
/**
* HttpConsumerProcessor continuation suspend time (default value in
@@ -500,6 +505,29 @@ public class HttpConfiguration implement
save();
}
+
+ /**
+ * Gets the amount of connector soLingerTime, in milliseconds.
+ *
+ * @return an int representing the connector soLingerTime in milliseconds
+ */
+ public int getSoLingerTime() {
+ return this.soLingerTime;
+ }
+
+
+ /**
+ * Sets the amount of connector soLinger time, in milliseconds.
+ * The default is -1 which means disable it.
+ *
+ * @param soLingerTime an int specifying the connector soLingerTime in
milliseconds
+ * @org.apache.xbean.Property description="the connector soLingerTime in
milliseconds. The default is -1."
+ */
+ public void setSoLingerTime(int soLingerTime) {
+ this.soLingerTime = soLingerTime;
+ save();
+ }
+
/**
* Gets the number of milliseconds passed to the <code>susspend</code>
* method of the Jetty <code>Continuation</code> object used to process
@@ -548,6 +576,7 @@ public class HttpConfiguration implement
*/
public void setProviderExpirationTime(int providerExpirationTime) {
this.providerExpirationTime = providerExpirationTime;
+ save();
}
@@ -646,6 +675,7 @@ public class HttpConfiguration implement
setProperty(componentName + ".authenticationServiceName",
authenticationServiceName);
setProperty(componentName + ".jettyManagement",
Boolean.toString(jettyManagement));
setProperty(componentName + ".connectorMaxIdleTime",
Integer.toString(connectorMaxIdleTime));
+ setProperty(componentName + ".soLingerTime",
Integer.toString(soLingerTime));
setProperty(componentName + ".consumerProcessorSuspendTime", Integer
.toString(consumerProcessorSuspendTime));
setProperty(componentName + ".providerExpirationTime",
Integer.toString(providerExpirationTime));
@@ -743,6 +773,10 @@ public class HttpConfiguration implement
connectorMaxIdleTime =
Integer.parseInt(properties.getProperty(componentName
+
".connectorMaxIdleTime"));
}
+ if (properties.getProperty(componentName + ".soLingerTime") != null) {
+ soLingerTime =
Integer.parseInt(properties.getProperty(componentName
+ +
".soLingerTime"));
+ }
if (properties.getProperty(componentName +
".consumerProcessorSuspendTime") != null) {
consumerProcessorSuspendTime = Integer.parseInt(properties
.getProperty(componentName + ".consumerProcessorSuspendTime"));
Modified:
servicemix/components/bindings/servicemix-http/trunk/src/main/java/org/apache/servicemix/http/HttpConfigurationMBean.java
URL:
http://svn.apache.org/viewvc/servicemix/components/bindings/servicemix-http/trunk/src/main/java/org/apache/servicemix/http/HttpConfigurationMBean.java?rev=982152&r1=982151&r2=982152&view=diff
==============================================================================
---
servicemix/components/bindings/servicemix-http/trunk/src/main/java/org/apache/servicemix/http/HttpConfigurationMBean.java
(original)
+++
servicemix/components/bindings/servicemix-http/trunk/src/main/java/org/apache/servicemix/http/HttpConfigurationMBean.java
Wed Aug 4 08:13:27 2010
@@ -61,6 +61,11 @@ public interface HttpConfigurationMBean
int getConnectorMaxIdleTime();
void setConnectorMaxIdleTime(int connectorMaxIdleTime);
+
+ int getSoLingerTime();
+
+ void setSoLingerTime(int soLingerTime);
+
int getConsumerProcessorSuspendTime();
Modified:
servicemix/components/bindings/servicemix-http/trunk/src/main/java/org/apache/servicemix/http/jetty/JettyContextManager.java
URL:
http://svn.apache.org/viewvc/servicemix/components/bindings/servicemix-http/trunk/src/main/java/org/apache/servicemix/http/jetty/JettyContextManager.java?rev=982152&r1=982151&r2=982152&view=diff
==============================================================================
---
servicemix/components/bindings/servicemix-http/trunk/src/main/java/org/apache/servicemix/http/jetty/JettyContextManager.java
(original)
+++
servicemix/components/bindings/servicemix-http/trunk/src/main/java/org/apache/servicemix/http/jetty/JettyContextManager.java
Wed Aug 4 08:13:27 2010
@@ -280,6 +280,7 @@ public class JettyContextManager impleme
connector.setHost(url.getHost());
connector.setPort(url.getPort());
connector.setMaxIdleTime(this.configuration.getConnectorMaxIdleTime());
+
((AbstractConnector)connector).setSoLingerTime(this.configuration.getSoLingerTime());
Server server = new Server();
server.setThreadPool(new ThreadPoolWrapper());
server.setConnectors(new Connector[] {connector});
Modified:
servicemix/components/bindings/servicemix-http/trunk/src/main/resources/OSGI-INF/blueprint/servicemix-http.xml
URL:
http://svn.apache.org/viewvc/servicemix/components/bindings/servicemix-http/trunk/src/main/resources/OSGI-INF/blueprint/servicemix-http.xml?rev=982152&r1=982151&r2=982152&view=diff
==============================================================================
---
servicemix/components/bindings/servicemix-http/trunk/src/main/resources/OSGI-INF/blueprint/servicemix-http.xml
(original)
+++
servicemix/components/bindings/servicemix-http/trunk/src/main/resources/OSGI-INF/blueprint/servicemix-http.xml
Wed Aug 4 08:13:27 2010
@@ -30,6 +30,7 @@
<bean id="servicemix-http-configuration"
class="org.apache.servicemix.http.HttpConfiguration">
<property name="connectorMaxIdleTime" value="${connectorMaxIdleTime}"
/>
+ <property name="soLingerTime" value="${soLingerTime}" />
<property name="consumerProcessorSuspendTime"
value="${consumerProcessorSuspendTime}" />
<property name="providerExpirationTime"
value="${providerExpirationTime}" />
<property name="jettyClientThreadPoolSize"
value="${jettyClientThreadPoolSize}" />
@@ -91,6 +92,7 @@
<cm:property-placeholder
persistent-id="org.apache.servicemix.components.http">
<cm:default-properties>
<cm:property name="connectorMaxIdleTime" value="30000"/>
+ <cm:property name="soLingerTime" value="-1"/>
<cm:property name="consumerProcessorSuspendTime"
value="60000"/>
<cm:property name="providerExpirationTime"
value="300000"/>
<cm:property name="jettyClientThreadPoolSize"
value="16"/>