[jboss-svn-commits] JBL Code SVN: r29122 - in labs/jbossesb/workspace/tfennelly/httpg2/product: etc/schemas/xml and 4 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Mon Aug 31 10:15:35 EDT 2009
Author: tfennelly
Date: 2009-08-31 10:15:35 -0400 (Mon, 31 Aug 2009)
New Revision: 29122
Modified:
labs/jbossesb/workspace/tfennelly/httpg2/product/docs/ProgrammersGuide.odt
labs/jbossesb/workspace/tfennelly/httpg2/product/etc/schemas/xml/jbossesb-1.2.0.xsd
labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers120/HttpGatewayMapper.java
labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/http/HttpGatewayServlet.java
labs/jbossesb/workspace/tfennelly/httpg2/product/samples/quickstarts/http_gateway/jboss-esb.xml
labs/jbossesb/workspace/tfennelly/httpg2/product/samples/quickstarts/http_gateway/readme.txt
labs/jbossesb/workspace/tfennelly/httpg2/product/samples/quickstarts/webservice_proxy_basic/jboss-esb.xml
Log:
The sync flag on the <http-gateway>
Modified: labs/jbossesb/workspace/tfennelly/httpg2/product/docs/ProgrammersGuide.odt
===================================================================
(Binary files differ)
Modified: labs/jbossesb/workspace/tfennelly/httpg2/product/etc/schemas/xml/jbossesb-1.2.0.xsd
===================================================================
--- labs/jbossesb/workspace/tfennelly/httpg2/product/etc/schemas/xml/jbossesb-1.2.0.xsd 2009-08-31 14:04:41 UTC (rev 29121)
+++ labs/jbossesb/workspace/tfennelly/httpg2/product/etc/schemas/xml/jbossesb-1.2.0.xsd 2009-08-31 14:15:35 UTC (rev 29122)
@@ -1830,6 +1830,13 @@
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
+ <xsd:attribute name="sync" type="xsd:boolean" use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Should the HTTP Gateway make a Synchronous invocation on the Service Endpoint.
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
Modified: labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers120/HttpGatewayMapper.java
===================================================================
--- labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers120/HttpGatewayMapper.java 2009-08-31 14:04:41 UTC (rev 29121)
+++ labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers120/HttpGatewayMapper.java 2009-08-31 14:15:35 UTC (rev 29122)
@@ -55,6 +55,8 @@
String urlPattern = listener.getUrlPattern();
PayloadAs.Enum payloadAs = listener.getPayloadAs();
+ listenerNode.setAttribute(HttpGatewayServlet.SYNC_SERVICE_INVOKE, Boolean.toString(listener.getSync()));
+
if(bus != null) {
try {
provider = (HttpProvider) model.getProvider(bus);
Modified: labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/http/HttpGatewayServlet.java
===================================================================
--- labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/http/HttpGatewayServlet.java 2009-08-31 14:04:41 UTC (rev 29121)
+++ labs/jbossesb/workspace/tfennelly/httpg2/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/http/HttpGatewayServlet.java 2009-08-31 14:15:35 UTC (rev 29122)
@@ -28,7 +28,6 @@
import org.jboss.soa.esb.listeners.message.MessageDeliverException;
import org.jboss.soa.esb.listeners.message.MessageComposer;
import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.listeners.config.Configuration;
import org.jboss.soa.esb.listeners.config.mappers120.HttpGatewayMapper;
import org.jboss.soa.esb.client.ServiceInvoker;
@@ -51,13 +50,15 @@
*/
public class HttpGatewayServlet extends HttpServlet {
+ public static final String PAYLOAD_AS = "payloadAs";
+ public static final String EXCEPTION_MAPPINGS = "httpExceptionMappings";
+ public static final String SYNC_SERVICE_INVOKE = "syncServiceInvoke";
+
private Service service;
private ServiceInvoker serviceInvoker;
+ private boolean syncInvoke;
private MessageComposer<HttpRequestWrapper> messageComposer;
- private String mep;
private long blockingTimeout;
- public static final String PAYLOAD_AS = "payloadAs";
- public static final String EXCEPTION_MAPPINGS = "httpExceptionMappings";
private Map<String, Integer> exceptionMappings;
public void init(ServletConfig config) throws ServletException {
@@ -78,7 +79,7 @@
}
blockingTimeout = configTree.getLongAttribute("synchronousTimeout", 30000);
- mep = Configuration.getMep(configTree);
+ syncInvoke = configTree.getBooleanAttribute(SYNC_SERVICE_INVOKE, true);
String exceptionMappingsCSV = configTree.getAttribute(EXCEPTION_MAPPINGS);
if(exceptionMappingsCSV != null) {
@@ -102,20 +103,20 @@
Message outMessage;
try {
- // Dispatch the message to the action pipeline, using the service mep to decide
+ // Dispatch the message to the action pipeline, using the service sync flag on the gateway to decide
// whether to invoke sync or async...
- if(mep.equals(ListenerTagNames.MEP_REQUEST_RESPONSE)) {
+ if(syncInvoke) {
outMessage = serviceInvoker.deliverSync(inMessage, blockingTimeout);
// Set the mep as a header on the response...
- resp.setHeader("mep", mep);
+ resp.setHeader(SYNC_SERVICE_INVOKE, "true");
} else {
serviceInvoker.deliverAsync(inMessage);
resp.setContentLength(0);
- resp.setStatus(HttpServletResponse.SC_OK);
+ resp.setStatus(HttpServletResponse.SC_ACCEPTED);
// Set the mep as a header on the response...
- resp.setHeader("mep", mep);
+ resp.setHeader(SYNC_SERVICE_INVOKE, "false");
return;
}
Modified: labs/jbossesb/workspace/tfennelly/httpg2/product/samples/quickstarts/http_gateway/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/tfennelly/httpg2/product/samples/quickstarts/http_gateway/jboss-esb.xml 2009-08-31 14:04:41 UTC (rev 29121)
+++ labs/jbossesb/workspace/tfennelly/httpg2/product/samples/quickstarts/http_gateway/jboss-esb.xml 2009-08-31 14:15:35 UTC (rev 29122)
@@ -29,7 +29,7 @@
<listeners>
<!-- Receives: http://<host>:<port>/Quickstart_http_gateway/http/sales/* but will be forced to
authenticate because the "sales" bus has basic auth configured (above)... -->
- <http-gateway name="sales" busidref="secureFriends" urlPattern="sales/*" />
+ <http-gateway name="sales" busidref="secureFriends" urlPattern="sales/*" sync="true" />
</listeners>
<actions mep="RequestResponse">
<action name="print" class="org.jboss.soa.esb.samples.quickstart.httpgateway.MyAction"/>
@@ -40,7 +40,7 @@
<listeners>
<!-- Receives: http://<host>:<port>/Quickstart_http_gateway/http/index/*
Uses the default http bus configuration... -->
- <http-gateway name="Index" urlPattern="index/*" />
+ <http-gateway name="Index" urlPattern="index/*" sync="true" />
</listeners>
<actions mep="RequestResponse">
<action name="print" class="org.jboss.soa.esb.samples.quickstart.httpgateway.MyAction"/>
@@ -49,7 +49,7 @@
<service category="Exceptions" name="Exception1" description="" invmScope="GLOBAL">
<listeners>
- <http-gateway name="Exception2" />
+ <http-gateway name="Exception2" sync="true" />
</listeners>
<actions mep="RequestResponse">
<!-- Uses the globally defined exception mappings defined on the <http-provider>... -->
@@ -59,7 +59,7 @@
<service category="Exceptions" name="Exception2" description="" invmScope="GLOBAL">
<listeners>
- <http-gateway name="Exception1">
+ <http-gateway name="Exception1" sync="true">
<!-- Override the exception mappings defined on the <http-provider>... -->
<exception>
<mapping class="org.jboss.soa.esb.samples.quickstart.httpgateway.MyActionException" status="503" />
Modified: labs/jbossesb/workspace/tfennelly/httpg2/product/samples/quickstarts/http_gateway/readme.txt
===================================================================
--- labs/jbossesb/workspace/tfennelly/httpg2/product/samples/quickstarts/http_gateway/readme.txt 2009-08-31 14:04:41 UTC (rev 29121)
+++ labs/jbossesb/workspace/tfennelly/httpg2/product/samples/quickstarts/http_gateway/readme.txt 2009-08-31 14:15:35 UTC (rev 29122)
@@ -16,7 +16,9 @@
check the Server console after executing each request:
a) http://localhost:8080/Quickstart_http_gateway/http/sales/a/b/c - Will be routed to the Sales:List
service. Will return some details about the request. This Service's <http-gateway> references a
- "secureFriends" bus, which contains login configurations.
+ "secureFriends" bus, which contains login configurations. The login username is "kermit" and the
+ password is "thefrog". It usee the "java:/jaas/JBossWS" security domain, which is already installed
+ in your JBoss ESB/App Server.
b) http://localhost:8080/Quickstart_http_gateway/http/index/XXXX/yyy?a=1,b=2 - Will be routed to the Index:List
service. Will return some details about the request. This Service's <http-listener> does not refer
to any bus and so simply uses the "default" http bus.
Modified: labs/jbossesb/workspace/tfennelly/httpg2/product/samples/quickstarts/webservice_proxy_basic/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/tfennelly/httpg2/product/samples/quickstarts/webservice_proxy_basic/jboss-esb.xml 2009-08-31 14:04:41 UTC (rev 29121)
+++ labs/jbossesb/workspace/tfennelly/httpg2/product/samples/quickstarts/webservice_proxy_basic/jboss-esb.xml 2009-08-31 14:15:35 UTC (rev 29122)
@@ -6,7 +6,7 @@
description="Basic WebService Proxy"
invmScope="GLOBAL" >
<listeners>
- <http-gateway name="basicProxy" />
+ <http-gateway name="basicProxy" sync="true" />
</listeners>
<actions mep="RequestResponse">
<action name="echo-request"
More information about the jboss-svn-commits
mailing list