[jboss-svn-commits] JBL Code SVN: r25302 - in labs/jbossesb/branches/JBESB_4_4_GA_FP/product: rosetta/src/org/jboss/soa/esb/listeners/gateway and 2 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Feb 17 07:06:47 EST 2009
Author: tfennelly
Date: 2009-02-17 07:06:46 -0500 (Tue, 17 Feb 2009)
New Revision: 25302
Modified:
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerTagNames.java
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListener.java
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListenerUnitTest.java
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/https_2way_ssl/jboss-esb-template.xml
Log:
https://jira.jboss.org/jira/browse/JBESB-2408
Modified: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerTagNames.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerTagNames.java 2009-02-17 09:22:39 UTC (rev 25301)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerTagNames.java 2009-02-17 12:06:46 UTC (rev 25302)
@@ -58,6 +58,7 @@
public static final String TARGET_SERVICE_NAME_TAG = "target-service-name";
public static final String GATEWAY_CLASS_TAG = "gatewayClass";
public static final String IS_GATEWAY_TAG = "is-gateway";
+ public static final String SERVICE_INVOKER_TIMEOUT = "serviceInvokerTimeout";
/** Listeners */
public static final String LISTENER_CLASS_TAG = "listenerClass";
@@ -161,4 +162,5 @@
public static final String SCHEDULE_SIMPLE_EXEC = "scheduleSimpleExec" ;
public static final String SCHEDULE_CRON_EXPRESSION = "scheduleCronExpression" ;
public static final String SCHEDULE_PROPERTIES = "ScheduleProperties" ;
+
}
Modified: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListener.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListener.java 2009-02-17 09:22:39 UTC (rev 25301)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListener.java 2009-02-17 12:06:46 UTC (rev 25302)
@@ -110,7 +110,6 @@
* Server port config attribute name.
*/
public static final String JBR_SERVER_PORT = JBR_PREFIX + ServerInvoker.SERVER_BIND_PORT_KEY;
-
/**
* Class Logger instance.
*/
@@ -155,6 +154,10 @@
* Asynchronous response.
*/
private final String asyncResponse;
+ /**
+ * ServiceInvoker timeout if the ServiceInvoker is configured to be synchronous.
+ */
+ private long serviceInvokerTimeout;
/**
* Install our own marshaller/unmarshaller for HTTP.
@@ -177,6 +180,10 @@
serviceCategory = config.getAttribute(ListenerTagNames.TARGET_SERVICE_CATEGORY_TAG);
serviceName = config.getAttribute(ListenerTagNames.TARGET_SERVICE_NAME_TAG);
synchronous = !config.getAttribute("synchronous", "true").equalsIgnoreCase("false");
+ if (synchronous)
+ {
+ serviceInvokerTimeout = config.getLongAttribute(ListenerTagNames.SERVICE_INVOKER_TIMEOUT, 20000);
+ }
asyncResponse = config.getAttribute("asyncResponse");
if(asyncResponse != null) {
@@ -342,7 +349,7 @@
public Object invoke(InvocationRequest invocationRequest) throws Throwable {
try {
if (synchronous) {
- Object response = messageDeliveryAdapter.deliverSync(invocationRequest, 20000); // TODO Fix magic number
+ Object response = messageDeliveryAdapter.deliverSync(invocationRequest, serviceInvokerTimeout);
if(logger.isDebugEnabled()) {
logger.debug("Returning response [" + response + "].");
}
Modified: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListenerUnitTest.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListenerUnitTest.java 2009-02-17 09:22:39 UTC (rev 25301)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListenerUnitTest.java 2009-02-17 12:06:46 UTC (rev 25302)
@@ -89,7 +89,7 @@
}
@Test
public void test_lifecycle() throws SAXException, ConfigurationException, ManagedLifecycleException {
- ConfigTree config = getConfig("cat", "servicex", "http", "8887");
+ ConfigTree config = getConfig("cat", "servicex", "http", "8887", -1L);
listener = new JBossRemotingGatewayListener(config);
@@ -155,7 +155,7 @@
@SuppressWarnings("serial")
private void startServer(String protocol, boolean synchronous, final String port) throws SAXException, ConfigurationException, ManagedLifecycleException {
- ConfigTree config = getConfig("cat", "servicex", protocol, port);
+ ConfigTree config = getConfig("cat", "servicex", protocol, port, -1L);
if(synchronous) {
listener = new JBossRemotingGatewayListener(config) {
@@ -221,19 +221,20 @@
}
}
- private ConfigTree getConfig(String category, String service, String protocol, String port) throws SAXException {
+ private ConfigTree getConfig(String category, String service, String protocol, String port, long timeout) throws SAXException {
ConfigTree config = ConfigTree.fromXml("<listener/>");
config.setAttribute(ListenerTagNames.TARGET_SERVICE_CATEGORY_TAG, category);
config.setAttribute(ListenerTagNames.TARGET_SERVICE_NAME_TAG, service);
config.setAttribute(JBossRemotingGatewayListener.JBR_SERVER_PROTOCOL, protocol);
config.setAttribute(JBossRemotingGatewayListener.JBR_SERVER_PORT, port);
+ config.setAttribute(ListenerTagNames.SERVICE_INVOKER_TIMEOUT, String.valueOf(timeout));
return config;
}
private void test_config(String category, String service, String protocol, String port, String exception) throws SAXException {
- ConfigTree config = getConfig(category, service, protocol, port);
+ ConfigTree config = getConfig(category, service, protocol, port, -1L);
try {
listener = new JBossRemotingGatewayListener(config);
Modified: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/https_2way_ssl/jboss-esb-template.xml
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/https_2way_ssl/jboss-esb-template.xml 2009-02-17 09:22:39 UTC (rev 25301)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/https_2way_ssl/jboss-esb-template.xml 2009-02-17 12:06:46 UTC (rev 25302)
@@ -17,6 +17,7 @@
<property name="jbr-TrustStoreURL" value="@keystore@" />
<property name="jbr-TrustStorePassword" value="https_2way_ssl_pass" />
<property name="jbr-ClientAuthMode" value="need" />
+ <property name="serviceInvokerTimeout" value="20000" />
<jbr-bus busid="https_2way" port="9433"/>
</jbr-provider>
More information about the jboss-svn-commits
mailing list