[jboss-svn-commits] JBL Code SVN: r25342 - in labs/jbossesb/branches/JBESB_4_4_GA_FP: product and 15 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu Feb 19 08:08:39 EST 2009
Author: tfennelly
Date: 2009-02-19 08:08:39 -0500 (Thu, 19 Feb 2009)
New Revision: 25342
Added:
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/lib/ext/jbossweb-service.jar
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/lib/ext/jbossweb.jar
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers110/HttpListenerMapper.java
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpDispatchServlet.java
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpGatewayListener.java
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpMessageComposer.java
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpRequestWrapper.java
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpServerDelegate.java
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/build.xml
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/deployment.xml
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/jbm-queue-service.xml
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/jbmq-queue-service.xml
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/jboss-esb.xml
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/jndi.properties
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/juddi.properties
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/lib/
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/log4j.xml
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/readme.txt
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/src/
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/src/org/
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/src/org/jboss/
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/src/org/jboss/soa/
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples/
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples/quickstart/
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples/quickstart/httpgateway/
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples/quickstart/httpgateway/MyAction.java
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples/quickstart/httpgateway/MyAction2.java
Removed:
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/build.xml
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/deployment.xml
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/jbm-queue-service.xml
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/jbmq-queue-service.xml
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/jboss-esb.xml
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/jbossesb-properties.xml
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/jndi.properties
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/juddi.properties
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/lib/
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/log4j.xml
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/readme.txt
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/src/
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/src/org/
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/src/org/jboss/
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/src/org/jboss/soa/
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples/
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples/quickstart/
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples/quickstart/httpgateway/
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples/quickstart/httpgateway/MyAction.java
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples/quickstart/httpgateway/MyAction2.java
Modified:
labs/jbossesb/branches/JBESB_4_4_GA_FP/IDE/JBossIDE/product/.classpath
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/.classpath
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/etc/schemas/xml/jbossesb-1.1.0.xsd
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/internal/soa/esb/remoting/HttpUnmarshaller.java
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers110/ESBAwareGenerator.java
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers110/GatewayGenerator.java
labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListener.java
Log:
https://jira.jboss.org/jira/browse/JBESB-2429
Modified: labs/jbossesb/branches/JBESB_4_4_GA_FP/IDE/JBossIDE/product/.classpath
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/IDE/JBossIDE/product/.classpath 2009-02-19 13:04:21 UTC (rev 25341)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/IDE/JBossIDE/product/.classpath 2009-02-19 13:08:39 UTC (rev 25342)
@@ -76,5 +76,7 @@
<classpathentry kind="lib" path="lib/ext/juddi-client-20071022.191630-6.jar"/>
<classpathentry kind="lib" path="lib/ext/xstream-1.2.2.jar"/>
<classpathentry kind="lib" path="lib/ext/jsr173_1.0_ri.jar"/>
+ <classpathentry kind="lib" path="lib/ext/jbossweb.jar"/>
+ <classpathentry kind="lib" path="lib/ext/jbossweb-service.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/.classpath
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/.classpath 2009-02-19 13:04:21 UTC (rev 25341)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/.classpath 2009-02-19 13:08:39 UTC (rev 25342)
@@ -87,6 +87,8 @@
<classpathentry kind="lib" path="lib/ext/jaxr-api-1.0rc1.jar"/>
<classpathentry kind="lib" path="lib/ext/jboss-jaxb-intros.jar"/>
<classpathentry kind="lib" path="lib/ext/scout-1.0rc1.jar"/>
+ <classpathentry kind="lib" path="lib/ext/jbossweb.jar"/>
+ <classpathentry kind="lib" path="lib/ext/jbossweb-service.jar"/>
<classpathentry kind="lib" path="services/soap/lib/ext/wise-core.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/etc/schemas/xml/jbossesb-1.1.0.xsd
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/etc/schemas/xml/jbossesb-1.1.0.xsd 2009-02-19 13:04:21 UTC (rev 25341)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/etc/schemas/xml/jbossesb-1.1.0.xsd 2009-02-19 13:08:39 UTC (rev 25342)
@@ -1683,6 +1683,77 @@
</xsd:complexType>
</xsd:element>
+
+ <!-- 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
+ Http Type Implementations.
+ 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888-->
+ <xsd:element name="http-bus" substitutionGroup="jesb:bus">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Http Bus
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:bus">
+ <xsd:attribute name="context" type="xsd:string"
+ use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Http server startup context
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="http-provider"
+ substitutionGroup="jesb:provider">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Http Provider.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:bus-provider">
+ <xsd:attribute name="host" type="xsd:string" use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en" >
+ Http Server based on JbossWeb bind address. When
+ not specified, defaults to
+ InetAddress.getLocalHost().getHostName().
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+
+ <xsd:attribute name="port" type="xsd:int" use="required">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ Http server listening port
+ </xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="http-listener"
+ substitutionGroup="jesb:listener">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ http Listener.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:listener" />
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+
<!-- 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
Groovy Gateway Type Implementations.
88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888-->
Copied: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/lib/ext/jbossweb-service.jar (from rev 25163, labs/jbossesb/trunk/product/lib/ext/jbossweb-service.jar)
===================================================================
(Binary files differ)
Copied: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/lib/ext/jbossweb.jar (from rev 25163, labs/jbossesb/trunk/product/lib/ext/jbossweb.jar)
===================================================================
(Binary files differ)
Modified: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/internal/soa/esb/remoting/HttpUnmarshaller.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/internal/soa/esb/remoting/HttpUnmarshaller.java 2009-02-19 13:04:21 UTC (rev 25341)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/internal/soa/esb/remoting/HttpUnmarshaller.java 2009-02-19 13:08:39 UTC (rev 25342)
@@ -133,6 +133,16 @@
{
return totalByteArray ;
}
+ /*
+ * Requests reaching this code might still have a binary content. For instance
+ * "binary/octet-stream" mime type. This will make sure we return a byte array for theses
+ * cases. The isBinaryData method called at the beginning of this method only filters
+ * "application/octet-stream" it also assumes that binary==java serializable which is not
+ * always a valid assumption.
+ */
+ if (contentType.endsWith("octet-stream")) {
+ return totalByteArray;
+ }
}
}
Modified: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers110/ESBAwareGenerator.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers110/ESBAwareGenerator.java 2009-02-19 13:04:21 UTC (rev 25341)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers110/ESBAwareGenerator.java 2009-02-19 13:08:39 UTC (rev 25342)
@@ -36,6 +36,7 @@
import org.jboss.soa.esb.listeners.config.xbeanmodel110.FtpListenerDocument.FtpListener;
import org.jboss.soa.esb.listeners.config.xbeanmodel110.GroovyListenerDocument.GroovyListener;
import org.jboss.soa.esb.listeners.config.xbeanmodel110.JbrListenerDocument.JbrListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel110.HttpListenerDocument.HttpListener;
import org.jboss.soa.esb.listeners.config.xbeanmodel110.JmsBusDocument.JmsBus;
import org.jboss.soa.esb.listeners.config.xbeanmodel110.JmsJcaProviderDocument.JmsJcaProvider;
import org.jboss.soa.esb.listeners.config.xbeanmodel110.JmsListenerDocument.JmsListener;
@@ -206,6 +207,9 @@
} else if (listener instanceof JbrListener) {
logger.error("JbossRemoting listener only supported in Gateway mode.");
return;
+ } else if (listener instanceof HttpListener) {
+ logger.error("Http listener only supported in Gateway mode.");
+ return;
} else if (listener instanceof GroovyListener) {
listenerConfigTree = GroovyListenerMapper.map(root, (GroovyListener)listener, model);
} else {
Modified: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers110/GatewayGenerator.java
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers110/GatewayGenerator.java 2009-02-19 13:04:21 UTC (rev 25341)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers110/GatewayGenerator.java 2009-02-19 13:08:39 UTC (rev 25342)
@@ -32,6 +32,7 @@
import org.jboss.soa.esb.listeners.config.xbeanmodel110.GroovyListenerDocument.GroovyListener;
import org.jboss.soa.esb.listeners.config.xbeanmodel110.HibernateListenerDocument.HibernateListener;
import org.jboss.soa.esb.listeners.config.xbeanmodel110.JbrListenerDocument.JbrListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel110.HttpListenerDocument.HttpListener;
import org.jboss.soa.esb.listeners.config.xbeanmodel110.JmsListenerDocument.JmsListener;
import org.jboss.soa.esb.listeners.config.xbeanmodel110.ServiceDocument.Service;
import org.jboss.soa.esb.listeners.config.xbeanmodel110.SqlListenerDocument.SqlListener;
@@ -133,6 +134,8 @@
listenerConfig = SqlListenerMapper.map(root, (SqlListener) gateway, model);
} else if (gateway instanceof JbrListener) {
listenerConfig = JbrListenerMapper.map(root, (JbrListener) gateway, model);
+ } else if (gateway instanceof HttpListener) {
+ listenerConfig = HttpListenerMapper.map(root, (HttpListener) gateway, model);
} else if (gateway instanceof GroovyListener) {
listenerConfig = GroovyListenerMapper.map(root, (GroovyListener) gateway, model);
} else if (gateway instanceof HibernateListener) {
Copied: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers110/HttpListenerMapper.java (from rev 25163, labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers110/HttpListenerMapper.java)
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers110/HttpListenerMapper.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers110/HttpListenerMapper.java 2009-02-19 13:08:39 UTC (rev 25342)
@@ -0,0 +1,80 @@
+package org.jboss.soa.esb.listeners.config.mappers110;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.eprs.JMSEpr;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.config.xbeanmodel110.PropertyDocument.Property;
+import org.jboss.soa.esb.listeners.config.xbeanmodel110.HttpBusDocument.HttpBus;
+import org.jboss.soa.esb.listeners.config.xbeanmodel110.HttpListenerDocument.HttpListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel110.HttpProviderDocument.HttpProvider;
+import org.jboss.soa.esb.listeners.gateway.HttpGatewayListener;
+import org.w3c.dom.Element;
+
+/**
+ * Http listener mapper.
+ * @author <a href="mailto:ema at redhat.com">Jim Ma</a>
+ */
+public class HttpListenerMapper {
+ /**
+ * Perform the Http listener mapping.
+ * @param root The "ConfigTree" configuration root node.
+ * @param listener http listener config.
+ * @param model The configuration model from which the mapping is being performed.
+ * @return The ConfigTree listener configuration node.
+ * @throws org.jboss.soa.esb.ConfigurationException Invalid listener configuration.
+ */
+ public static Element map(Element root, HttpListener listener, XMLBeansModel model) throws ConfigurationException {
+ Element listenerNode = YADOMUtil.addElement(root, "listener");
+ HttpBus bus;
+ HttpProvider provider;
+
+ listenerNode.setAttribute("name", listener.getName());
+
+ try {
+ bus = (HttpBus) model.getBus(listener.getBusidref());
+ } catch (ClassCastException e) {
+ throw new ConfigurationException("Invalid busid reference [" + listener.getBusidref() + "] on listener [" + listener.getName() + "]. A <http-listener> must reference a <http-bus>.");
+ }
+ try {
+ provider = (HttpProvider) model.getProvider(bus);
+
+ } catch (ClassCastException e) {
+ throw new ConfigurationException("Invalid bus config [" + listener.getBusidref() + "]. Should be contained within a <http-provider> instance. Unexpected exception - this should have caused a validation error!");
+ }
+
+ // Map the standard listener attributes - common across all listener types...
+ MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
+ // Map the <property> elements targeted at the listener - from the listener itself.
+ //MapperUtil.mapProperties(provider.getPropertyList(), listenerNode);
+ for(Property property : provider.getPropertyList()) {
+ Element propertyElement = listenerNode.getOwnerDocument().createElement("property");
+ MapperUtil.serialize(property, propertyElement);
+ listenerNode.appendChild(propertyElement);
+ }
+
+
+
+
+ MapperUtil.mapProperties(bus.getPropertyList(), listenerNode);
+ MapperUtil.mapProperties(listener.getPropertyList(), listenerNode);
+
+ if(listener.getIsGateway()) {
+ String host = provider.getHost();
+ int port = provider.getPort();
+
+ listenerNode.setAttribute("gatewayClass", HttpGatewayListener.class.getName());
+ listenerNode.setAttribute(ListenerTagNames.IS_GATEWAY_TAG, Boolean.toString(listener.getIsGateway()));
+
+ if(host != null) {
+ listenerNode.setAttribute(HttpGatewayListener.SERVER_HOST_TAG, host);
+ }
+ listenerNode.setAttribute(HttpGatewayListener.REQUEST_CONTEXT_TAG, bus.getContext());
+ listenerNode.setAttribute(HttpGatewayListener.SERVER_PORT_TAG, Integer.toString(port));
+ } else {
+ throw new ConfigurationException("Invalid <http-listener> config [" + listener.getName() +"]. <http-listener> is currently only supported as a gateway listener.");
+ }
+
+ return listenerNode;
+ }
+}
Copied: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpDispatchServlet.java (from rev 25163, labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpDispatchServlet.java)
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpDispatchServlet.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpDispatchServlet.java 2009-02-19 13:08:39 UTC (rev 25342)
@@ -0,0 +1,237 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.listeners.gateway;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.jboss.internal.soa.esb.util.StreamUtils;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.couriers.FaultMessageException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.message.UncomposedMessageDeliveryAdapter;
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * This class is for dispatching the http request to ESB action process pipe
+ * line.By default, this servlet will be used to set to default servlet mapping
+ * in the created StandardContext.
+ * This class will also return the esb error message and error stack trace to client
+ *
+ * @author <a href="mailto:ema at redhat.com">Jim Ma</a>
+ */
+public class HttpDispatchServlet extends HttpServlet {
+ private static final long serialVersionUID = 1L;
+
+ private static final String METHOD_DELETE = "DELETE";
+ private static final String METHOD_HEAD = "HEAD";
+ private static final String METHOD_GET = "GET";
+ private static final String METHOD_OPTIONS = "OPTIONS";
+ private static final String METHOD_POST = "POST";
+ private static final String METHOD_PUT = "PUT";
+ private static final String METHOD_TRACE = "TRACE";
+
+ /** If this a synchronous invocation * */
+ private boolean synchronous = true;
+
+ /** asyncResponse file location */
+ private String asyncResponse = null;
+
+ private int serviceTimeout = 20000;
+
+ /** Default allow http method list */
+ private String allowHttpMethods = "POST,GET";
+
+ /** ESB message delivery adapter */
+ public UncomposedMessageDeliveryAdapter messageDeliveryAdapter = null;
+
+ /**
+ * Initilize method
+ *
+ * @throws ServletException
+ * If error occured
+ */
+ public void init() throws ServletException {
+ ConfigTree config = (ConfigTree) getServletContext().getAttribute(
+ "config");
+ synchronous = !config.getAttribute("synchronous", "true").equalsIgnoreCase("false");
+
+ serviceTimeout = Integer.parseInt(config.getAttribute("serviceTimeout", "20000"));
+
+ asyncResponse = config.getAttribute("asyncResponse");
+
+ try {
+ messageDeliveryAdapter = UncomposedMessageDeliveryAdapter
+ .getGatewayDeliveryAdapter(config,
+ new HttpMessageComposer<HttpRequestWrapper>());
+ } catch (ConfigurationException e) {
+ throw new ServletException(e);
+ }
+
+ if (config.getAttribute(HttpGatewayListener.ALLOW_HTTP_METHOD) != null) {
+ allowHttpMethods = config.getAttribute(HttpGatewayListener.ALLOW_HTTP_METHOD).toUpperCase();
+ }
+
+ }
+
+ /**
+ * Service method to process the inboud servlet request and reply the http
+ * servlet response
+ *
+ * @param request
+ * HttpServlet request
+ * @param response
+ * HttpServlet response
+ * @param content
+ * @throws ServletException
+ * For error occured during process
+ */
+ protected void serveRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+
+ String servletPath = request.getServletPath();
+
+ //block the invalid request
+ if (!"/".equals(servletPath)) {
+ response.setStatus(404);
+ return;
+ }
+
+ HttpRequestWrapper wrapper = new HttpRequestWrapper(request, response);
+
+ try {
+ if (synchronous) {
+ messageDeliveryAdapter.deliverSync(wrapper, serviceTimeout);
+ } else {
+ messageDeliveryAdapter.deliverAsync(wrapper);
+ if (asyncResponse != null) {
+ response.getOutputStream().write(StreamUtils.readStream(getClass().getResourceAsStream(asyncResponse)));
+ }
+ }
+ } catch (FaultMessageException fme) {
+ Message faultMessage = fme.getReturnedMessage();
+ if (faultMessage != null) {
+ Object obj = faultMessage.getProperties().getProperty(HttpMessageComposer.HTTP_RESPONSE_STATUS);
+ if (obj != null && obj instanceof Integer) {
+ response.setStatus((Integer)obj);
+ } else {
+ response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ }
+
+ fme.printStackTrace(response.getWriter());
+ }
+
+ } catch (Exception ex) {
+ response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ ex.printStackTrace(response.getWriter());
+ }
+
+ }
+
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+ if (isSupportMethod(METHOD_GET)) {
+ serveRequest(request, response);
+ } else {
+ super.doGet(request, response);
+ }
+ }
+
+ @Override
+ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+ if (isSupportMethod(METHOD_POST)) {
+ serveRequest(request, response);
+ } else {
+ super.doPost(request, response);
+ }
+ }
+
+ @Override
+ protected void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+ if (isSupportMethod(METHOD_PUT)) {
+ serveRequest(request, response);
+ } else {
+ super.doPut(request, response);
+ }
+ }
+ @Override
+ protected void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+ if (isSupportMethod(METHOD_DELETE)) {
+ serveRequest(request, response);
+ } else {
+ super.doDelete(request, response);
+ }
+ }
+
+ protected void doOptions(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+
+ boolean ALLOW_GET = isSupportMethod(METHOD_GET);
+ boolean ALLOW_HEAD = ALLOW_GET;
+ boolean ALLOW_POST = isSupportMethod(METHOD_POST);
+ boolean ALLOW_PUT = isSupportMethod(METHOD_PUT);
+ boolean ALLOW_DELETE = isSupportMethod(METHOD_DELETE);
+ boolean ALLOW_TRACE = true;
+ boolean ALLOW_OPTIONS = true;
+
+ String allow = null;
+ if (ALLOW_GET)
+ if (allow == null) allow = METHOD_GET;
+ if (ALLOW_HEAD)
+ if (allow == null) allow = METHOD_HEAD;
+ else
+ allow += ", " + METHOD_HEAD;
+ if (ALLOW_POST)
+ if (allow == null) allow = METHOD_POST;
+ else
+ allow += ", " + METHOD_POST;
+ if (ALLOW_PUT)
+ if (allow == null) allow = METHOD_PUT;
+ else
+ allow += ", " + METHOD_PUT;
+ if (ALLOW_DELETE)
+ if (allow == null) allow = METHOD_DELETE;
+ else
+ allow += ", " + METHOD_DELETE;
+ if (ALLOW_TRACE)
+ if (allow == null) allow = METHOD_TRACE;
+ else
+ allow += ", " + METHOD_TRACE;
+ if (ALLOW_OPTIONS)
+ if (allow == null) allow = METHOD_OPTIONS;
+ else
+ allow += ", " + METHOD_OPTIONS;
+
+ resp.setHeader("Allow", allow);
+ }
+
+
+ /**
+ * Check if support this http method
+ * @param http method name
+ * @return true if supported or false if not supported
+ */
+ private boolean isSupportMethod(String name) {
+ return allowHttpMethods.indexOf(name) >= 0;
+ }
+}
Copied: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpGatewayListener.java (from rev 25163, labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpGatewayListener.java)
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpGatewayListener.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpGatewayListener.java 2009-02-19 13:08:39 UTC (rev 25342)
@@ -0,0 +1,489 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.listeners.gateway;
+
+import java.net.InetAddress;
+import java.net.URI;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import javax.management.InstanceNotFoundException;
+import javax.management.ObjectName;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.LinkRef;
+import javax.naming.NamingException;
+
+import org.apache.catalina.LifecycleException;
+import org.apache.catalina.core.StandardContext;
+import org.apache.catalina.core.StandardWrapper;
+import org.apache.catalina.deploy.LoginConfig;
+import org.apache.catalina.deploy.SecurityCollection;
+import org.apache.catalina.deploy.SecurityConstraint;
+import org.apache.catalina.loader.WebappLoader;
+import org.apache.catalina.startup.ContextConfig;
+import org.apache.log4j.Logger;
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.naming.Util;
+import org.jboss.remoting.ServerInvoker;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.eprs.HTTPEpr;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.helpers.KeyValuePair;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
+import org.jboss.soa.esb.listeners.message.UncomposedMessageDeliveryAdapter;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.services.registry.RegistryFactory;
+import org.jboss.soa.esb.util.ClassUtil;
+
+/**
+ * Tomcat Listener provids the functionality to pass the http request
+ * to ESB service .
+ * <p> This class will generate {@link org.apache.catalina.connector.Connector},
+ * {@link org.apache.catalina.core.StandardHost} and {@link org.apache.catalina.core.StandardContext}
+ * for user defined http port, host and context. These generated tomcat components will be
+ * attached to jboss embeded tomcat(aka jboss web). You can monitor and control these new generated
+ * components through jboss JMX console. When this listener is stoped, these components will be
+ * destoried automatically.
+ *
+ * <p>The different tomcat listner can be started in same port with different context.for example:
+ * <code> http://localhost:8765/jbossesb/servicecategory/servicename </code>
+ *
+ * <p>This class uses the {@link org.jboss.soa.esb.listeners.gateway.HttpMessageComposer}
+ * by default.
+ * @see org.jboss.soa.esb.listeners.gateway.HttpMessageComposer
+ * @see Torg.jboss.soa.esb.listeners.gateway.HttpDispatchServlet
+ * @author <a href="mailto:ema at redhat.com">Jim Ma</a>
+ */
+public class HttpGatewayListener extends AbstractManagedLifecycle {
+
+ private static final long serialVersionUID = 1L;
+
+
+ private static Logger logger = Logger.getLogger(HttpGatewayListener.class);
+
+
+ /**The tag used to read the host value from configuration */
+ public static String SERVER_HOST_TAG = "http_host";
+
+ /**The tag used to read the port value from configuration */
+ public static String SERVER_PORT_TAG = "http_port";
+
+ /**The tag used to read the context value from configuration */
+ public static String REQUEST_CONTEXT_TAG = "http_context";
+
+ /**The tag used to read the dispatch servlet class name value from configuration */
+ public static String DISPATCH_SERVLET_CLASS = "dispatch_servlet";
+
+ /**Allow http method config attribute name*/
+ public static final String ALLOW_HTTP_METHOD = "allowHttpMethod";
+
+ /**Auth method config attribute name */
+ public static final String AUTH_METHOD = "authMethod";
+
+ /**Security domain config attribute name */
+ public static final String SECURITY_DOMAIN = "securityDomain";
+
+ /**Security role config attribute name */
+ public static final String SECURITY_ROLE = "securityRole";
+
+ /**Http host value*/
+ public String host = null;
+
+ /**Http address value*/
+ public String address = null;
+
+ /**Http port value*/
+ public String port = null;
+
+ /** Default max threads */
+
+ public String maxThreads = "5";
+
+ /**listener contenxt */
+ public String httpContext = null;
+
+ /** Endpoint reference that presents this listener */
+ private EPR endpointReference = null;
+
+ /**Service category*/
+ private String serviceCategory = null;
+
+ /**Service name*/
+ private String serviceName = null;
+
+ /**The new created tomcat standard context, it reprents a web app*/
+ private StandardContext ctx = null;
+
+ /** The default servlet used to dispatch the http request to ESB service*/
+ private String dispatchServletClassName = HttpDispatchServlet.class.getName();
+
+ /** Protocol value */
+ private Object protocol = "http";
+
+ /** Imply if the port number is the jboss.web used, if yes , the new created context will be attched to jboss web Servlet engine */
+ private boolean useJBossWebServletEngine = false;
+
+ /**Constuct the TomcatGatewyListner
+ * @param config The listener configuration
+ * @throws ConfigurationException Exception during construction
+ */
+ @SuppressWarnings("unchecked")
+ public HttpGatewayListener(ConfigTree config) throws ConfigurationException {
+ super(config);
+ host = config.getAttribute(SERVER_HOST_TAG);
+ try {
+ address = InetAddress.getByName(host).getHostAddress();
+ }catch (Exception e) {
+ throw new ConfigurationException("Invalid host configuration");
+ }
+ port = config.getAttribute(SERVER_PORT_TAG);
+ httpContext = config.getAttribute(REQUEST_CONTEXT_TAG);
+ serviceCategory = config.getAttribute(ListenerTagNames.TARGET_SERVICE_CATEGORY_TAG);
+ serviceName = config.getAttribute(ListenerTagNames.TARGET_SERVICE_NAME_TAG);
+
+ if (config.getAttribute(DISPATCH_SERVLET_CLASS) != null) {
+ dispatchServletClassName = config.getAttribute(DISPATCH_SERVLET_CLASS);
+ }
+
+ boolean synchronous = !config.getAttribute("synchronous", "true").equalsIgnoreCase("false");
+ if (!synchronous) {
+ String asyncResponse = config.getAttribute("asyncResponse");
+ if (asyncResponse != null) {
+ if (ClassUtil.getResourceAsStream(asyncResponse, getClass()) == null) {
+ throw new ConfigurationException("Asynchronous response resource file '" + asyncResponse
+ + "' not found on classpath.");
+ }
+ }
+ }
+
+ //validate allow http method configuration
+ if (config.getAttribute(ALLOW_HTTP_METHOD) != null) {
+ String allowMethods = config.getAttribute(ALLOW_HTTP_METHOD);
+ String[] methods = allowMethods.split(",");
+ List<String> standardMesthods = new ArrayList<String>();
+ standardMesthods.add("GET");
+ standardMesthods.add("POST");
+ standardMesthods.add("DELETE");
+ standardMesthods.add("PUT");
+ standardMesthods.add("OPTIONS");
+ standardMesthods.add("HEAD");
+ standardMesthods.add("TRACE");
+
+ for (String method : methods) {
+ if (!standardMesthods.contains(method.toUpperCase())) {
+ throw new ConfigurationException("Invalid allow http method configuration, please specify the specify method list with comma-separated(e.g. POST,GET,PUT,DELETE");
+ }
+ }
+ }
+
+ try {
+ Set ports = HttpServerDelegate.getInstance().queryObjects("jboss.web:port="+ port+",type=Connector,*");
+ if (ports.size() > 0) {
+ //When this gateway stared on JBoss default port 8080 or 80, the configured host will be ignored
+ Set contexts = HttpServerDelegate.getInstance().queryObjects("jboss.web:host=localhost" + ",path=" + httpContext + ",*");
+ if (contexts.size() > 0) {
+ throw new ConfigurationException("There is already an http context named " + httpContext + ", choose another one");
+ }
+ logger.info("This http gateway listener [" + config.getAttribute(ListenerTagNames.NAME_TAG) + "] will be started on JBoss default port " + port + " and the configured host will be ignored.");
+ //the created context will be attached jboss.web domain
+ useJBossWebServletEngine = true;
+ } else {
+ //if the port is not the jboss.web used, check if the http context name is duplicate
+ Set contexts = HttpServerDelegate.getInstance().queryObjects(HttpServerDelegate.DOMAIN_NAME + ":host=" + HttpServerDelegate.defaultVHost + ",path=" + httpContext + ",*");
+ if (contexts.size() > 0) {
+ throw new ConfigurationException("There is already an http context named " + httpContext + ", choose another one");
+ }
+ }
+ } catch (Exception e) {
+ throw new ConfigurationException(e);
+ }
+
+ //Check the http security configuration
+ if (config.getAttribute(AUTH_METHOD) != null) {
+ if (config.getAttribute(SECURITY_DOMAIN) == null) {
+ throw new ConfigurationException("Security domain configuration for this context not found for http authentication method " + config.getAttribute(AUTH_METHOD));
+ }
+
+ if (config.getAttribute(SECURITY_ROLE) == null) {
+ throw new ConfigurationException("Security role configuration for this context not found for http authentication method " + config.getAttribute(AUTH_METHOD));
+ }
+ }
+ }
+
+ /*
+ * Start the Tomcat listner
+ *
+ * @see org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle#doStart()
+ */
+ protected void doStart() throws ManagedLifecycleException {
+
+ try {
+ startHttpServer();
+ } catch (Exception e) {
+ throw new ManagedLifecycleException(
+ "Failed to start Http gateway listener", e);
+ }
+
+ try {
+ registerEndpoint();
+ } catch (Throwable t) {
+ logger.error("Unable to register service endpoint '" + endpointReference.getAddr().getAddress()
+ + "' for service '" + serviceCategory + ":" + serviceName + "'. Stopping Http Listener Server...", t);
+ try {
+ stopHttpServer();
+ } catch (Exception e) {
+ throw new ManagedLifecycleException(
+ "Failed to stop Http gateway listener", e);
+ }
+ }
+ }
+
+ /*
+ * Stop the tomcat listener
+ *
+ * @see org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle#doStop()
+ */
+ protected void doStop() throws ManagedLifecycleException {
+ unregisterEndpoint();
+ try {
+ stopHttpServer();
+ } catch (Exception e) {
+ throw new ManagedLifecycleException(
+ "Failed to stop Http gateway listener", e);
+ }
+
+
+ }
+
+ /*
+ * Initialize the tomcat listener
+ *
+ * @see org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle#doInitialise()
+ */
+ protected void doInitialise() throws ManagedLifecycleException {
+
+ }
+
+ /*
+ * Destory the tomcat listener
+ *
+ * @see org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle#doDestroy()
+ */
+ protected void doDestroy() throws ManagedLifecycleException {
+ }
+
+
+
+ /**
+ * Start the tomcat http server.It will check if it really needs to create
+ * Tomcat connector and host. Then add these new tomcat component to tomcat Engine
+ * tree through JMX server.
+ * @throws Exception For error during start tomcat context
+ */
+ @SuppressWarnings("unchecked")
+ protected void startHttpServer() throws Exception {
+
+ ctx = new StandardContext();
+ URL[] urls = new URL[]{};
+ URLClassLoader urlClassLoader = new URLClassLoader(urls, getClass().getClassLoader());
+
+ WebappLoader loader = new WebappLoader(urlClassLoader);
+ ctx.setLoader(loader);
+ ContextConfig ctxCfg = new ContextConfig();
+ ctx.addLifecycleListener(ctxCfg);
+
+ ctxCfg.setDefaultWebXml("org/apache/catalin/startup/NO_DEFAULT_XML");
+ ctx.setPath(httpContext);
+ ctx.setDocBase(".");
+
+
+ ClassLoader oldloader = Thread.currentThread().getContextClassLoader();
+ Thread.currentThread().setContextClassLoader(urlClassLoader);
+ initWebappDefaults(ctx);
+ Thread.currentThread().setContextClassLoader(oldloader);
+ String encodedAddr = URLEncoder.encode("/" + address).toString();
+ String connectorName = HttpServerDelegate.DOMAIN_NAME + ":address=" + encodedAddr + ",port=" + port + ",type=Connector";
+ if (!useJBossWebServletEngine) {
+ //Create default Tomcat standard vHost "localhost"
+ HttpServerDelegate.getInstance().createHost(HttpServerDelegate.defaultVHost);
+
+ List<KeyValuePair> properties = getConfig().childPropertyList();
+ if (getConfig().getAttribute(ListenerTagNames.MAX_THREADS_TAG) != null) {
+ maxThreads = getConfig().getAttribute(ListenerTagNames.MAX_THREADS_TAG);
+ }
+ properties.add(new KeyValuePair("maxThreads", maxThreads));
+
+ HttpServerDelegate.getInstance().createConnector(address, port, properties);
+ HttpServerDelegate.getInstance().addContext(HttpServerDelegate.defaultVHost, ctx);
+ } else {
+ //add it to jboss.web servlet engine
+ connectorName = "jboss.web:port=" + port + ",type=Connector,*";
+ HttpServerDelegate.getInstance().addContext(new ObjectName("jboss.web:host=localhost,type=Host"), ctx);
+ }
+
+ Set connectors = HttpServerDelegate.getInstance().queryObjects(connectorName);
+ if (connectors.isEmpty()) {
+ throw new javax.management.InstanceNotFoundException("ObjectName: "+ connectorName + " Not found");
+ }
+ ObjectName obj = (ObjectName)connectors.iterator().next();
+ try {
+ protocol = MBeanServerLocator.locateJBoss().getAttribute(obj, "scheme");
+ } catch (Exception e) {
+ //do nothing and use default http
+ protocol = "http";
+ }
+
+ }
+
+ /**Register this endpoint
+ * @throws ConfigurationException For configuration error
+ * @throws RegistryException For registry error when register this EPR
+ */
+ private void registerEndpoint() throws ConfigurationException, RegistryException {
+ try {
+ endpointReference = new HTTPEpr(new URI(protocol + "://"+ address + ":" + port + this.httpContext));
+ endpointReference.getAddr().addExtension("is-gateway", "true");
+ } catch (Exception e) {
+ throw new RegistryException("Tomcat gateway listener registration failed", e);
+ }
+ String serviceDescription = getConfig().getAttribute(ListenerTagNames.SERVICE_DESCRIPTION_TAG);
+ RegistryFactory.getRegistry().registerEPR(serviceCategory, serviceName, serviceDescription,
+ endpointReference, endpointReference.getAddr().getAddress());
+ }
+
+ /**Unregister this endpoint
+ */
+ private void unregisterEndpoint() {
+ try {
+ RegistryFactory.getRegistry().unRegisterEPR(serviceCategory, serviceName, endpointReference);
+ } catch (Throwable t) {
+ logger.error("Unable to unregister service endpoint '" + endpointReference.getAddr().getAddress()
+ + "' for service '" + serviceCategory + ":" + serviceName + "'.", t);
+ }
+ }
+
+ /**Stop tomcat server. It will destroy the generated tomcat connector or host .
+ * Before do it , it will check if the reference count for it is zero .When there
+ * is no tomcat listener uses the generated host or connector, it will destroy it
+ * @throws Exception For errors during stop tomcat connector or host
+ */
+ @SuppressWarnings("unchecked")
+ public void stopHttpServer() throws Exception {
+ //Destroy the created context
+ if (!useJBossWebServletEngine) {
+ HttpServerDelegate.getInstance().destroyContext(HttpServerDelegate.defaultVHost, address, port, httpContext);
+ } else {
+ Set<ObjectName> contexts = HttpServerDelegate.getInstance().queryObjects("jboss.web:j2eeType=WebModule,name=//localhost" + httpContext + ",*");
+ for (ObjectName obName : contexts) {
+ HttpServerDelegate.getInstance().destroyContext(obName);
+ }
+ }
+ }
+
+ /**Get the uncomposed message delivery dapater
+ * @return uncomposed message delivery adapter
+ * @throws ConfigurationException For configuation error
+ */
+ protected UncomposedMessageDeliveryAdapter createDeliveryAdapter()
+ throws ConfigurationException {
+ return UncomposedMessageDeliveryAdapter.getGatewayDeliveryAdapter(
+ getConfig(),
+ new HttpMessageComposer<HttpRequestWrapper>());
+ }
+
+ /**Initialize the StandardContext.By default it will uses
+ * {@link org.jboss.soa.esb.listeners.gateway.TomcatDefaultServlet} as default servlet mapping
+ * @param ctx Created tomcat standard context
+ * @throws Exception For errors during initialization
+ */
+ protected void initWebappDefaults(StandardContext ctx) throws Exception {
+ if (isHttpAuthConfiured()) {
+
+ InitialContext iniCtx = new InitialContext();
+
+ Context envCtx;
+ try {
+ envCtx = (Context) iniCtx.lookup("java:comp/env");
+ } catch (NamingException e) {
+ envCtx = (Context) iniCtx.lookup("java:comp");
+ envCtx = envCtx.createSubcontext("env");
+ }
+
+ String securityDomain = getConfig().getAttribute(SECURITY_DOMAIN);
+ Util.bind(envCtx, "security/securityMgr", new LinkRef(securityDomain));
+ Util.bind(envCtx, "security/realmMapping", new LinkRef(securityDomain));
+ Util.bind(envCtx, "security/security-domain", new LinkRef(securityDomain));
+ Util.bind(envCtx, "security/subject", new LinkRef(securityDomain));
+ }
+
+ StandardWrapper sw = (StandardWrapper) ctx.createWrapper();
+
+ sw.setServletClass(dispatchServletClassName);
+ sw.setName("default");
+ ctx.addChild(sw);
+ ctx.getServletContext().setAttribute("config", this.getConfig());
+
+ sw.addInitParameter("listings", "false");
+ sw.setLoadOnStartup(1);
+
+ try {
+ sw.start();
+ } catch (LifecycleException e) {
+ logger.error("Unexpected error when start the default servlet");
+ throw e;
+ }
+ ctx.addServletMapping("/", "default");
+
+
+ //Add security support
+ if (isHttpAuthConfiured()) {
+ String securityRole = this.getConfig().getAttribute(SECURITY_ROLE);
+ SecurityConstraint constraint = new SecurityConstraint();
+ constraint.addAuthRole(securityRole);
+ SecurityCollection collection = new SecurityCollection("all");
+ collection.addPattern("/*");
+ constraint.addCollection(collection);
+ ctx.addConstraint(constraint);
+
+ ctx.addSecurityRole(securityRole);
+
+ String authMethod = this.getConfig().getAttribute(AUTH_METHOD);
+ LoginConfig config = new LoginConfig(authMethod, securityRole,
+ null, null);
+ ctx.setLoginConfig(config);
+ }
+ }
+
+ private boolean isHttpAuthConfiured() {
+ if (getConfig().getAttribute(AUTH_METHOD) != null) {
+ return true;
+ }
+ return false;
+ }
+
+}
Copied: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpMessageComposer.java (from rev 25163, labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpMessageComposer.java)
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpMessageComposer.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpMessageComposer.java 2009-02-19 13:08:39 UTC (rev 25342)
@@ -0,0 +1,195 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.listeners.gateway;
+
+import java.io.IOException;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.servlet.ServletRequest;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.beanutils.BeanUtils;
+import org.apache.tomcat.util.IntrospectionUtils;
+import org.jboss.internal.soa.esb.util.StreamUtils;
+import org.jboss.soa.esb.actions.ActionUtils;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.message.AbstractMessageComposer;
+import org.jboss.soa.esb.listeners.message.MessageDeliverException;
+import org.jboss.soa.esb.message.Body;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.MessagePayloadProxy;
+import org.jboss.soa.esb.message.MessagePayloadProxy.NullPayloadHandling;
+import org.jboss.soa.esb.message.body.content.BytesBody;
+/**
+ * TomcatMessageComposer class is used to compose the HttpServletRquest
+ * to ESB aware message and decompse the ESB aware message to HttpServletRespones
+ * <p>
+ * This class will put the http request header and other requst information in ESB message properties with the key "RequestInfoMap".
+ * <p>If the request is the submitted from html form(with the <code>Content-Type: application/x-www-form-urlencoded</code>), HttpServletRequest.getParameterMap() result)
+ * will be put in ESB message properties. The key for it is "RequestParamterMap". It put the the byte array read from request inputstream in message payload.
+ * <p>In decompose process, the header map in message properties will be added
+ * in HttpServletResponse. The value for "ReponseStatus" store in ESB message properties will
+ * put in the http response. The message payload byte[] or String object will be wrote to HttpServletResponse.
+ * If the object in message payload is not byte[],it will throw exception when the ESB message
+ * is decomposed
+ *
+ * @author <a href="mailto:ema at redhat.com">Jim Ma</a>
+ */
+public class HttpMessageComposer<T extends HttpRequestWrapper>
+ extends AbstractMessageComposer<T> {
+
+ /** Request parameter map key in esb message properties */
+ public static final String HTTP_REQUEST_PARAMETER_MAP = "RequestParameterMap";
+
+ /** Request information map key in esb message properties */
+ public static final String HTTP_REQUEST_INFO_MAP = "RequestInfoMap";
+
+ /** Reponse header map key in esb message properties */
+ public static final String HTTP_RESPONSE_HEADER_MAP = "ResponseHeaderMap";
+
+ /** Response status key in esb message properties */
+ public static final String HTTP_RESPONSE_STATUS = "ReponseStatus";
+
+ /** Message payload proxy */
+ private MessagePayloadProxy payloadProxy;
+
+ /*
+ * Method for configue the payload proxy
+ */
+ public void setConfiguration(ConfigTree config) {
+ super.setConfiguration(config);
+ payloadProxy = new MessagePayloadProxy(config, new String[] {
+ ActionUtils.POST_ACTION_DATA, Body.DEFAULT_LOCATION,
+ BytesBody.BYTES_LOCATION },
+ new String[] { ActionUtils.POST_ACTION_DATA });
+ payloadProxy.setNullSetPayloadHandling(NullPayloadHandling.LOG);
+ }
+
+ protected MessagePayloadProxy getPayloadProxy() {
+ return payloadProxy;
+ }
+
+ /*
+ *Method for populating the ESB aware message from a HttpServletRequest
+ */
+ @SuppressWarnings("unchecked")
+ protected void populateMessage(Message message, T requestWrapper)
+ throws MessageDeliverException {
+ HttpServletRequest request = requestWrapper.getRequest();
+ Map paraMap = request.getParameterMap();;
+ byte[] bodyBytes = null;
+ try {
+ bodyBytes = StreamUtils.readStream(request.getInputStream());
+ } catch (IOException e) {
+ throw new MessageDeliverException(
+ "Failed to read body data from http request", e);
+ }
+ //Set http request info
+ message.getProperties().setProperty(HTTP_REQUEST_INFO_MAP, getRequestInfo(request));
+ if (paraMap != null && paraMap.size() > 0) {
+ message.getProperties().setProperty(this.HTTP_REQUEST_PARAMETER_MAP, paraMap);
+ }
+ payloadProxy.setPayload(message, bodyBytes);
+ }
+
+ /*
+ * Method for decompsing a esb message to a HttpServletResponse
+ */
+ @SuppressWarnings("unchecked")
+ public Object decompose(Message message, T requestWrapper) throws MessageDeliverException {
+ HttpServletResponse httpResponse = (HttpServletResponse)requestWrapper.getResponse();
+ Object header = message.getProperties().getProperty(HTTP_RESPONSE_HEADER_MAP);
+ Object status = message.getProperties().getProperty(HTTP_RESPONSE_STATUS);
+ if (header != null) {
+ Map headerMap = (Map)header;
+ Iterator ite = headerMap.keySet().iterator();
+ while (ite.hasNext()) {
+ String name = (String)ite.next();
+ String value = (String)headerMap.get(name);
+ httpResponse.setHeader(name, value);
+ }
+
+ }
+ if (status != null) {
+ int reponseStatus = (Integer)status;
+ httpResponse.setStatus(reponseStatus);
+ }
+
+ Object obj = payloadProxy.getPayload(message);
+ try {
+ if (obj instanceof String) {
+
+ requestWrapper.getResponse().getWriter().write((String) obj);
+
+ } else if (obj instanceof byte[]) {
+ requestWrapper.getResponse().getOutputStream().write(
+ (byte[]) obj);
+ } else {
+ throw new MessageDeliverException(
+ "Message payload is not byte array or String");
+ }
+ } catch (IOException e) {
+ throw new MessageDeliverException("Unexpected error when write the message to http response", e);
+ }
+ return requestWrapper.getResponse();
+ }
+
+ /**
+ * Method for get request information from a servlet request
+ * The result includes the http header and other servlet request information
+ * @param request ServletRequest
+ * @return Request information includes the http header and other information parsed by
+ * servlet container from a servlet request
+ */
+ public Map<String, Object> getRequestInfo(HttpServletRequest request) {
+ Map<String, Object> requestInfoMap = new HashMap<String, Object>();
+ requestInfoMap.put("authType", request.getAuthType());
+ requestInfoMap.put("characterEncoding", request.getCharacterEncoding());
+ requestInfoMap.put("contentType", request.getContentType());
+ requestInfoMap.put("contextPath", request.getContextPath());
+ requestInfoMap.put("localAddr", request.getLocalAddr());
+ requestInfoMap.put("localName", request.getLocalName());
+ requestInfoMap.put("method", request.getMethod());
+ requestInfoMap.put("pathInfo", request.getPathInfo());
+ requestInfoMap.put("protocol", request.getProtocol());
+ requestInfoMap.put("queryString", request.getQueryString());
+ requestInfoMap.put("remoteAddr", request.getRemoteAddr());
+ requestInfoMap.put("remoteHost", request.getRemoteHost());
+ requestInfoMap.put("remoteUser", request.getRemoteUser());
+ requestInfoMap.put("contentLength", Integer.toString(request.getContentLength()));
+ requestInfoMap.put("requestSessionId", request.getRequestedSessionId());
+ requestInfoMap.put("requestURI", request.getRequestURI());
+ requestInfoMap.put("schema", request.getScheme());
+ requestInfoMap.put("serverName", request.getServerName());
+
+ //Add http header
+ Enumeration enumeration = request.getHeaderNames();
+ while (enumeration.hasMoreElements()) {
+ String name = (String) enumeration.nextElement();
+ String value = request.getHeader(name);
+ requestInfoMap.put(name, value);
+ }
+ return requestInfoMap;
+ }
+}
Copied: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpRequestWrapper.java (from rev 25163, labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpRequestWrapper.java)
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpRequestWrapper.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpRequestWrapper.java 2009-02-19 13:08:39 UTC (rev 25342)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.listeners.gateway;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+/**
+ * This class wraps the HttpServletRequest and HttpServletResponse
+ * It will passed to TomcatMessageComposer to populate or decompose
+ * an ESB message
+ *
+ * @author <a href="mailto:ema at redhat.com">Jim Ma</a>
+ */
+public class HttpRequestWrapper {
+ private HttpServletRequest request = null;
+ private HttpServletResponse response = null;
+ public HttpRequestWrapper(HttpServletRequest req, HttpServletResponse res) {
+ request = req;
+ response = res;
+ }
+
+ public HttpServletRequest getRequest() {
+ return request;
+ }
+
+ public HttpServletResponse getResponse() {
+ return response;
+ }
+}
Copied: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpServerDelegate.java (from rev 25163, labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpServerDelegate.java)
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpServerDelegate.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpServerDelegate.java 2009-02-19 13:08:39 UTC (rev 25342)
@@ -0,0 +1,304 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.listeners.gateway;
+
+import java.net.URLEncoder;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.management.Attribute;
+import javax.management.InstanceNotFoundException;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.apache.catalina.Container;
+import org.apache.catalina.connector.Connector;
+import org.apache.catalina.core.StandardContext;
+import org.apache.catalina.core.StandardEngine;
+import org.apache.catalina.core.StandardHost;
+import org.apache.catalina.core.StandardService;
+import org.apache.tomcat.util.IntrospectionUtils;
+import org.apache.tomcat.util.modeler.Registry;
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.soa.esb.helpers.KeyValuePair;
+import org.jboss.web.tomcat.security.JBossSecurityMgrRealm;
+
+/**
+ * This class creates and starts the jboss esb tomcat engine. The tomcat Connector
+ * , Host , StandardContext are also can be created with this class.
+ * @author <a href="mailto:ema at redhat.com">Jim Ma</a>
+ *
+ */
+public class HttpServerDelegate {
+ public static final String defaultVHost = "localhost";
+
+ /**Record the count that the same host name is referenced by other Tomcat listener instance */
+ public static Map<String, Integer> hostReference= new java.util.HashMap<String, Integer>();
+
+ /**Record the count that the same connector/port is referenced by other Tomcat listener instance */
+ public static Map<String, Integer> connectorReference= new java.util.HashMap<String, Integer>();
+
+
+ /**JMX domain name for http listener*/
+ public static String DOMAIN_NAME = "jboss.esb.tomcat";
+
+ /**MBean sever*/
+ private static MBeanServer mbeanServer = null;
+
+ /**TomcatServer instance*/
+ private static HttpServerDelegate instance = null;
+
+ private HttpServerDelegate() {
+
+ }
+
+ public static HttpServerDelegate getInstance() {
+ if (instance != null) {
+ return instance;
+ }
+
+ synchronized(HttpServerDelegate.class) {
+ mbeanServer = MBeanServerLocator.locateJBoss();
+ instance = new HttpServerDelegate();
+ instance.createEngine();
+ }
+ return instance;
+
+ }
+
+
+ /**
+ * Create a tomcat engine and also register it in JMX server
+ * If there is exception , it will throw RuntimeException
+ */
+ @SuppressWarnings("unchecked")
+ private void createEngine() {
+ try {
+ Set services = mbeanServer.queryMBeans(new ObjectName(DOMAIN_NAME
+ + ":type=Service"), null);
+ if (services.size() == 0) {
+ StandardService service = new StandardService();
+ service.setName("jboss.esb.catalina");
+ Registry.getRegistry().registerComponent(service,
+ new ObjectName(DOMAIN_NAME + ":type=Service"), null);
+ }
+
+ Set engines = mbeanServer.queryMBeans(new ObjectName(DOMAIN_NAME
+ + ":type=Engine"), null);
+ if (engines.size() == 0) {
+ StandardEngine engine = new StandardEngine();
+
+ //Add JBossSecurityMgrRealm
+ JBossSecurityMgrRealm realm = new JBossSecurityMgrRealm();
+ realm.setCertificatePrincipal("org.jboss.security.auth.certs.SubjectDNMapping");
+ realm.setAllRolesMode("authOnly");
+
+ engine.setRealm(realm);
+ Registry.getRegistry().registerComponent(realm,
+ new ObjectName(DOMAIN_NAME + ":type=Realm"), null);
+
+
+ engine.setDefaultHost(defaultVHost);
+ engine.setDomain(DOMAIN_NAME);
+ engine.setName(DOMAIN_NAME + ".engine");
+ mbeanServer.setAttribute(new ObjectName(DOMAIN_NAME
+ + ":type=Service"), new Attribute("container", engine));
+ Registry.getRegistry().registerComponent(engine,
+ new ObjectName(DOMAIN_NAME + ":type=Engine"), null);
+ }
+ mbeanServer.invoke(new ObjectName(DOMAIN_NAME + ":type=Service"),
+ "start", new Object[] {}, new String[] {});
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to create tomcat engine in ESB", e);
+ }
+
+
+ }
+
+ /**
+ * Add a tomcat StandardHost to tomcat engine
+ * @param host tomcat vhost name
+ * @throws Exception If there is error occured
+ */
+ @SuppressWarnings("unchecked")
+ public void createHost(String host) throws Exception {
+ ObjectName hostName = new ObjectName(DOMAIN_NAME + ":host=" + host + ",type=Host");
+ ObjectName stardardEngineName = new ObjectName(DOMAIN_NAME + ":type=Engine");
+
+ //Check if it needs to create host
+ Set hosts = mbeanServer.queryNames(hostName, null);
+ if (hosts.size() == 0) {
+ StandardHost newHost = new StandardHost();
+ newHost.setName(host);
+ mbeanServer.invoke(stardardEngineName, "addChild", new Object[] { newHost }, new String[] { Container.class .getName() });
+ synchronized (hostReference) {
+ hostReference.put(host, 1);
+ }
+
+ } else {
+ updateReference(hostReference, host, 1);
+
+ }
+ }
+
+ /**
+ * Add a tomcat Connector to tomcat Enginer/Service
+ * @param address the connector address
+ * @param port the connector port
+ * @param properties The properties to configure this connector
+ * @throws Exception when error is occured
+ */
+ @SuppressWarnings("unchecked")
+ public void createConnector(String address, String port, List<KeyValuePair> properties) throws Exception {
+ ObjectName standardServiceName = new ObjectName(DOMAIN_NAME + ":type=Service");
+ Set connectors = queryObjects(DOMAIN_NAME + ":address=" + URLEncoder.encode("/" + address).toString() +",port="
+ + port + ",type=Connector,*");
+ if (connectors.size() == 0) {
+ Connector connector = null;
+ connector = new Connector("org.apache.coyote.http11.Http11Protocol");
+ connector.setPort(Integer.parseInt(port));
+
+ for (KeyValuePair property : properties) {
+ boolean effected = IntrospectionUtils.setProperty(connector, property.getKey(), property.getValue());
+ if (!effected) {
+ connector.setProperty(property.getKey(), property.getValue());
+ }
+ }
+
+ connector.setAttribute("address", address);
+ mbeanServer.invoke(standardServiceName, "addConnector",
+ new Object[] { connector }, new String[] { Connector.class
+ .getName() });
+ synchronized (connectorReference) {
+ connectorReference.put(port, 1);
+ }
+
+ } else {
+ updateReference(connectorReference, port, 1);
+ }
+ }
+
+
+ /**
+ * Add a StandardContext to a specific host
+ * @param host tomcat vhost name
+ * @param ctx new created StandardContext
+ * @throws Exception when error occurs
+ */
+ public void addContext(String host, StandardContext ctx) throws Exception {
+ ObjectName hostName = new ObjectName(DOMAIN_NAME + ":host=" + host + ",type=Host");
+ addContext(hostName, ctx);
+ }
+
+
+ public void addContext(ObjectName hostName, StandardContext ctx) throws Exception {
+ mbeanServer.invoke(hostName, "addChild", new Object[] { ctx }, new String[] { Container.class.getName() });
+
+ }
+
+
+ /**
+ * Destroy the created context. This method will also check if this context's parent StandardHost
+ * and Connector can be destroyed also. There are reference counters for Connector and Host
+ * @param host tomcat vhost name
+ * @param address the Connector address
+ * @param port port number
+ * @param httpContext the new created httpContext name
+ * @throws Exception if failed to destroy
+ */
+ @SuppressWarnings("unchecked")
+ public void destroyContext(String host, String address, String port, String httpContext)
+ throws Exception {
+ ObjectName contextName = new ObjectName(DOMAIN_NAME
+ + ":j2eeType=WebModule,name=//" + host + httpContext
+ + ",*");
+ Set engines = mbeanServer.queryNames(contextName, null);
+ if (engines.isEmpty()) {
+ throw new InstanceNotFoundException("HttpContext:" + httpContext + "not found");
+ }
+ contextName = (ObjectName) engines.iterator().next();
+ mbeanServer.invoke(contextName, "destroy", new Object[] {},
+ new String[] {});
+
+ // Decrese the host and connector reference
+ updateReference(hostReference, host, -1);
+ updateReference(connectorReference, port, -1);
+
+ Object obj = hostReference.get(host);
+
+ if (obj != null && (Integer) obj == 0) {
+ ObjectName standardHostName = new ObjectName(DOMAIN_NAME + ":host="
+ + host + ",type=Host");
+
+ mbeanServer.invoke(standardHostName, "destroy", new Object[] {}, new String[] {});
+ }
+
+ obj = connectorReference.get(port);
+
+ if (obj != null && (Integer) obj == 0) {
+ Set connectors = queryObjects(DOMAIN_NAME + ":address=" + URLEncoder.encode("/" + address).toString() +",port="
+ + port + ",type=Connector,*");
+ if (connectors.size() > 0) {
+ ObjectName connector = (ObjectName)connectors.iterator().next();
+ mbeanServer.invoke(connector, "destroy", new Object[] {},new String[] {});
+ }
+ }
+ }
+
+ public void destroyContext(ObjectName contextName) throws Exception {
+ mbeanServer.invoke(contextName, "destroy", new Object[] {},
+ new String[] {});
+ }
+
+
+ /**
+ * Query objects
+ * @param objectName
+ * @return Set contains ObjectName
+ * @throws Exception error occurs
+ */
+ @SuppressWarnings("unchecked")
+ public Set queryObjects(String objectName) throws Exception {
+ ObjectName name = new ObjectName(objectName);
+ Set objects = mbeanServer.queryNames(name, null);
+ return objects;
+ }
+
+ /**Update the reference value
+ * @param refrenceMap The reference map
+ * @param key Update key
+ * @param increment Update value
+ */
+ @SuppressWarnings("unchecked")
+ public void updateReference(Map refrenceMap, String key , int increment) {
+ synchronized (refrenceMap) {
+ if (refrenceMap.get(key) != null) {
+ int count = (Integer) refrenceMap.get(key);
+ if (count == 0) {
+ return;
+ }
+ refrenceMap.put(key, count + increment);
+ }
+ }
+ }
+}
+
+
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-19 13:04:21 UTC (rev 25341)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListener.java 2009-02-19 13:08:39 UTC (rev 25342)
@@ -32,9 +32,11 @@
import org.jboss.remoting.marshal.http.HTTPMarshaller;
import org.jboss.remoting.security.SSLSocketBuilder;
import org.jboss.remoting.transport.Connector;
+import org.jboss.remoting.transport.http.HTTPMetadataConstants;
import org.jboss.soa.esb.ConfigurationException;
import org.jboss.soa.esb.actions.ActionUtils;
import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.couriers.FaultMessageException;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.helpers.KeyValuePair;
import org.jboss.soa.esb.listeners.ListenerTagNames;
@@ -349,6 +351,13 @@
public Object invoke(InvocationRequest invocationRequest) throws Throwable {
try {
if (synchronous) {
+ /* This is a quick fix for clients sending HTTP OPTIONS commands
+ * as a ping. In theory we should examine the request URI and reply accordingly.
+ */
+ String method = (String) invocationRequest.getRequestPayload().get("MethodType");
+ if (method != null && method.equals("OPTIONS")) {
+ return "";
+ }
Object response = messageDeliveryAdapter.deliverSync(invocationRequest, serviceInvokerTimeout);
if(logger.isDebugEnabled()) {
logger.debug("Returning response [" + response + "].");
@@ -358,6 +367,23 @@
} else {
messageDeliveryAdapter.deliverAsync(invocationRequest);
}
+ }catch (FaultMessageException fme) {
+ logger.error("JBoss Remoting Gateway failed to " + (synchronous ? "synchronously" : "asynchronously") + " deliver message to target service ["
+ + messageDeliveryAdapter.getDeliveryAdapter().getServiceCategory() + ":"
+ + messageDeliveryAdapter.getDeliveryAdapter().getServiceName() + "].", fme);
+ if (fme.getCause() == null) {
+ throw fme;
+ }
+ /*
+ * This code should go into a MessageComposer but since the
+ * MessageComposer interface does not have a method to decompose
+ * exceptions, this will compose an http response that is easier to
+ * interpret by software and humans than the default CoyoteInvoker
+ * exception handling.
+ */
+ invocationRequest.getReturnPayload().put(HTTPMetadataConstants.RESPONSE_CODE, new Integer(500));
+ invocationRequest.getReturnPayload().put(HTTPMetadataConstants.RESPONSE_CODE_MESSAGE, "Server exception type " + fme.getCause().getClass().getSimpleName());
+ return fme.getCause().getMessage();
} catch (Throwable t) {
logger.error("JBoss Remoting Gateway failed to " + (synchronous ? "synchronously" : "asynchronously") + " deliver message to target service [" +
messageDeliveryAdapter.getDeliveryAdapter().getServiceCategory() + ":" +
Copied: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway (from rev 25163, labs/jbossesb/trunk/product/samples/quickstarts/http_gateway)
Deleted: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/http_gateway/build.xml 2009-02-09 18:20:00 UTC (rev 25163)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/build.xml 2009-02-19 13:08:39 UTC (rev 25342)
@@ -1,10 +0,0 @@
-<project name="Quickstart_http_gateway" default="run" basedir=".">
-
- <description>
- ${ant.project.name}
- ${line.separator}
- </description>
-
- <!-- Import the base Ant build script... -->
- <import file="../conf/base-build.xml"/>
-</project>
Copied: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/build.xml (from rev 25163, labs/jbossesb/trunk/product/samples/quickstarts/http_gateway/build.xml)
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/build.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/build.xml 2009-02-19 13:08:39 UTC (rev 25342)
@@ -0,0 +1,10 @@
+<project name="Quickstart_http_gateway" default="run" basedir=".">
+
+ <description>
+ ${ant.project.name}
+ ${line.separator}
+ </description>
+
+ <!-- Import the base Ant build script... -->
+ <import file="../conf/base-build.xml"/>
+</project>
Deleted: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/deployment.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/http_gateway/deployment.xml 2009-02-09 18:20:00 UTC (rev 25163)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/deployment.xml 2009-02-19 13:08:39 UTC (rev 25342)
@@ -1,6 +0,0 @@
-<jbossesb-deployment>
- <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_httpgateway_Request_esb</depends>
- <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_httpgateway_Request_esb_reply</depends>
- <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_httpgateway_Request_esb1</depends>
- <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_httpgateway_Request_esb1_reply</depends>
-</jbossesb-deployment>
Copied: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/deployment.xml (from rev 25163, labs/jbossesb/trunk/product/samples/quickstarts/http_gateway/deployment.xml)
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/deployment.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/deployment.xml 2009-02-19 13:08:39 UTC (rev 25342)
@@ -0,0 +1,6 @@
+<jbossesb-deployment>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_httpgateway_Request_esb</depends>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_httpgateway_Request_esb_reply</depends>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_httpgateway_Request_esb1</depends>
+ <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_httpgateway_Request_esb1_reply</depends>
+</jbossesb-deployment>
Deleted: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/jbm-queue-service.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/http_gateway/jbm-queue-service.xml 2009-02-09 18:20:00 UTC (rev 25163)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/jbm-queue-service.xml 2009-02-19 13:08:39 UTC (rev 25342)
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<server>
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_httpgateway_Request_esb"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- <depends>jboss.messaging:service=PostOffice</depends>
- </mbean>
-
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_httpgateway_Request_esb_reply"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- <depends>jboss.messaging:service=PostOffice</depends>
- </mbean>
-
-
-
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_httpgateway_Request_esb1"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- <depends>jboss.messaging:service=PostOffice</depends>
- </mbean>
-
- <mbean code="org.jboss.jms.server.destination.QueueService"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_httpgateway_Request_esb1_reply"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- <depends>jboss.messaging:service=PostOffice</depends>
- </mbean>
-</server>
Copied: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/jbm-queue-service.xml (from rev 25163, labs/jbossesb/trunk/product/samples/quickstarts/http_gateway/jbm-queue-service.xml)
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/jbm-queue-service.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/jbm-queue-service.xml 2009-02-19 13:08:39 UTC (rev 25342)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_httpgateway_Request_esb"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_httpgateway_Request_esb_reply"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+
+
+
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_httpgateway_Request_esb1"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_httpgateway_Request_esb1_reply"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+</server>
Deleted: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/jbmq-queue-service.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/http_gateway/jbmq-queue-service.xml 2009-02-09 18:20:00 UTC (rev 25163)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/jbmq-queue-service.xml 2009-02-19 13:08:39 UTC (rev 25342)
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<server>
- <mbean code="org.jboss.mq.server.jmx.Queue"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_httpgateway_Request_esb">
- <depends optional-attribute-name="DestinationManager">
- jboss.mq:service=DestinationManager
- </depends>
- </mbean>
-
- <mbean code="org.jboss.mq.server.jmx.Queue"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_httpgateway_Request_esb_reply">
- <depends optional-attribute-name="DestinationManager">
- jboss.mq:service=DestinationManager
- </depends>
- </mbean>
-
-
-
- <mbean code="org.jboss.mq.server.jmx.Queue"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_httpgateway_Request_esb1">
- <depends optional-attribute-name="DestinationManager">
- jboss.mq:service=DestinationManager
- </depends>
- </mbean>
-
- <mbean code="org.jboss.mq.server.jmx.Queue"
- name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_httpgateway_Request_esb1_reply">
- <depends optional-attribute-name="DestinationManager">
- jboss.mq:service=DestinationManager
- </depends>
- </mbean>
-</server>
Copied: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/jbmq-queue-service.xml (from rev 25163, labs/jbossesb/trunk/product/samples/quickstarts/http_gateway/jbmq-queue-service.xml)
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/jbmq-queue-service.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/jbmq-queue-service.xml 2009-02-19 13:08:39 UTC (rev 25342)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_httpgateway_Request_esb">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_httpgateway_Request_esb_reply">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+
+
+
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_httpgateway_Request_esb1">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_httpgateway_Request_esb1_reply">
+ <depends optional-attribute-name="DestinationManager">
+ jboss.mq:service=DestinationManager
+ </depends>
+ </mbean>
+</server>
Deleted: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/http_gateway/jboss-esb.xml 2009-02-09 18:20:00 UTC (rev 25163)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/jboss-esb.xml 2009-02-19 13:08:39 UTC (rev 25342)
@@ -1,93 +0,0 @@
-<?xml version = "1.0" encoding = "UTF-8"?>
-<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.1.0.xsd" parameterReloadSecs="5">
-
- <providers>
- <jms-provider name="JBossMQ" connection-factory="ConnectionFactory">
- <jms-bus busid="quickstartEsbChannel">
- <jms-message-filter
- dest-type="QUEUE"
- dest-name="queue/quickstart_httpgateway_Request_esb"
- />
- </jms-bus>
- <jms-bus busid="quickstartEsbChannel1">
- <jms-message-filter
- dest-type="QUEUE"
- dest-name="queue/quickstart_httpgateway_Request_esb1"
- />
- </jms-bus>
- </jms-provider>
-
- <http-provider name="HTTP" host="localhost" port="8765">
- <!--property name="maxThreads" value="150"/>
- <property name="scheme" value="https"/>
- <property name="secure" value="true"/>
- <property name="SSLEnabled" value="true"/>
- <property name="Keystore" value="./key/.keystore"/>
- <property name="Keystore" value="./key/.keystore"/>
- <property name="Keypass" value="changeit"/>
- <property name="allowTrace" value="true"/-->
- <http-bus busid="HTTP-1" context="/jbossesb/httpgateway/serviceA">
- <!--property name="authMethod" value="BASIC"/>
- <property name="securityDomain" value="java:/jaas/jmx-console"/>
- <property name="securityRole" value="JBossAdmin"/-->
- </http-bus>
- <http-bus busid="HTTP-2" context="/jbossesb/httpgateway/serviceB">
- <!--property name="authMethod" value="BASIC"/>
- <property name="securityDomain" value="java:/jaas/messaging"/>
- <property name="securityRole" value="esbrole"/-->
- </http-bus>
- </http-provider>
- </providers>
-
- <services>
- <service
- category="httpgateway"
- name="service"
- description="Hello World">
- <listeners>
- <http-listener name="A1-HTTP"
- busidref="HTTP-1"
- maxThreads="100"
- is-gateway="true">
- <!--property name="synchronous" value="false"/>
- <property name="asyncResponse" value="/response.txt"/-->
- </http-listener>
- <jms-listener name="JMS-Gateway"
- busidref="quickstartEsbChannel"
- />
- </listeners>
- <actions mep="RequestResponse">
- <action name="action1"
- class="org.jboss.soa.esb.samples.quickstart.httpgateway.MyAction"
- process="displayMessage"
- />
- </actions>
- </service>
-
-
- <service
- category="httpgateway"
- name="service2"
- description="Hello World2">
- <listeners>
- <http-listener name="A2-HTTP"
- busidref="HTTP-2"
- maxThreads="10"
- is-gateway="true">
- <!--property name="synchronous" value="false"/>
- <property name="asyncResponse" value="/response.txt"/-->
- </http-listener>
- <jms-listener name="JMS-Gateway1"
- busidref="quickstartEsbChannel1"
- />
- </listeners>
- <actions mep="RequestResponse">
- <action name="action1"
- class="org.jboss.soa.esb.samples.quickstart.httpgateway.MyAction2"
- process="displayMessage"
- />
- </actions>
- </service>
-
- </services>
-</jbossesb>
Copied: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/jboss-esb.xml (from rev 25163, labs/jbossesb/trunk/product/samples/quickstarts/http_gateway/jboss-esb.xml)
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/jboss-esb.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/jboss-esb.xml 2009-02-19 13:08:39 UTC (rev 25342)
@@ -0,0 +1,93 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.1.0.xsd" parameterReloadSecs="5">
+
+ <providers>
+ <jms-provider name="JBossMQ" connection-factory="ConnectionFactory">
+ <jms-bus busid="quickstartEsbChannel">
+ <jms-message-filter
+ dest-type="QUEUE"
+ dest-name="queue/quickstart_httpgateway_Request_esb"
+ />
+ </jms-bus>
+ <jms-bus busid="quickstartEsbChannel1">
+ <jms-message-filter
+ dest-type="QUEUE"
+ dest-name="queue/quickstart_httpgateway_Request_esb1"
+ />
+ </jms-bus>
+ </jms-provider>
+
+ <http-provider name="HTTP" host="localhost" port="8765">
+ <!--property name="maxThreads" value="150"/>
+ <property name="scheme" value="https"/>
+ <property name="secure" value="true"/>
+ <property name="SSLEnabled" value="true"/>
+ <property name="Keystore" value="./key/.keystore"/>
+ <property name="Keystore" value="./key/.keystore"/>
+ <property name="Keypass" value="changeit"/>
+ <property name="allowTrace" value="true"/-->
+ <http-bus busid="HTTP-1" context="/jbossesb/httpgateway/serviceA">
+ <!--property name="authMethod" value="BASIC"/>
+ <property name="securityDomain" value="java:/jaas/jmx-console"/>
+ <property name="securityRole" value="JBossAdmin"/-->
+ </http-bus>
+ <http-bus busid="HTTP-2" context="/jbossesb/httpgateway/serviceB">
+ <!--property name="authMethod" value="BASIC"/>
+ <property name="securityDomain" value="java:/jaas/messaging"/>
+ <property name="securityRole" value="esbrole"/-->
+ </http-bus>
+ </http-provider>
+ </providers>
+
+ <services>
+ <service
+ category="httpgateway"
+ name="service"
+ description="Hello World">
+ <listeners>
+ <http-listener name="A1-HTTP"
+ busidref="HTTP-1"
+ maxThreads="100"
+ is-gateway="true">
+ <!--property name="synchronous" value="false"/>
+ <property name="asyncResponse" value="/response.txt"/-->
+ </http-listener>
+ <jms-listener name="JMS-Gateway"
+ busidref="quickstartEsbChannel"
+ />
+ </listeners>
+ <actions mep="RequestResponse">
+ <action name="action1"
+ class="org.jboss.soa.esb.samples.quickstart.httpgateway.MyAction"
+ process="displayMessage"
+ />
+ </actions>
+ </service>
+
+
+ <service
+ category="httpgateway"
+ name="service2"
+ description="Hello World2">
+ <listeners>
+ <http-listener name="A2-HTTP"
+ busidref="HTTP-2"
+ maxThreads="10"
+ is-gateway="true">
+ <!--property name="synchronous" value="false"/>
+ <property name="asyncResponse" value="/response.txt"/-->
+ </http-listener>
+ <jms-listener name="JMS-Gateway1"
+ busidref="quickstartEsbChannel1"
+ />
+ </listeners>
+ <actions mep="RequestResponse">
+ <action name="action1"
+ class="org.jboss.soa.esb.samples.quickstart.httpgateway.MyAction2"
+ process="displayMessage"
+ />
+ </actions>
+ </service>
+
+ </services>
+</jbossesb>
Deleted: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/http_gateway/jbossesb-properties.xml 2009-02-09 18:20:00 UTC (rev 25163)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/jbossesb-properties.xml 2009-02-19 13:08:39 UTC (rev 25342)
@@ -1,86 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
- JBoss, Home of Professional Open Source
- Copyright 2006, JBoss Inc., and others contributors as indicated
- by the @authors tag. All rights reserved.
- See the copyright.txt in the distribution for a
- full listing of individual contributors.
- This copyrighted material is made available to anyone wishing to use,
- modify, copy, or redistribute it subject to the terms and conditions
- of the GNU Lesser General Public License, v. 2.1.
- This program is distributed in the hope that it will be useful, but WITHOUT A
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- You should have received a copy of the GNU Lesser General Public License,
- v.2.1 along with this distribution; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- MA 02110-1301, USA.
-
- (C) 2005-2006,
- @author JBoss Inc.
--->
-<!-- $Id: jbossesb-unittest-properties.xml $ -->
-<!--
- These options are described in the JBossESB manual.
- Defaults are provided here for convenience only.
-
- Please read through this file prior to using the system, and consider
- updating the specified entries.
--->
-<esb
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
- <properties name="core">
- <property name="org.jboss.soa.esb.jndi.server.type" value="jboss"/>
- <property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
- <property name="org.jboss.soa.esb.persistence.connection.factory" value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
- <property name="jboss.esb.invm.scope.default" value="NONE"/>
- </properties>
- <properties name="registry">
- <property name="org.jboss.soa.esb.registry.queryManagerURI"
- value="jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire"/>
- <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"
- value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish" />
- <property name="org.jboss.soa.esb.registry.implementationClass"
- value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
- <property name="org.jboss.soa.esb.registry.factoryClass"
- value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
- <property name="org.jboss.soa.esb.registry.user"
- value="jbossesb"/>
- <property name="org.jboss.soa.esb.registry.password"
- value="password"/>
- <!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
- <property name="org.jboss.soa.esb.scout.proxy.transportClass"
- value="org.apache.ws.scout.transport.RMITransport"/>
- </properties>
- <properties name="transports" depends="core">
- <property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
- <property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>
- <property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
- <property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
- </properties>
- <properties name="connection">
- <property name="min-pool-size" value="5"/>
- <property name="max-pool=size" value="10"/>
- <property name="blocking-timeout-millis" value="5000"/>
- <property name="abandoned-connection-timeout" value="10000"/>
- <property name="abandoned-connection-time-interval" value="30000"/>
- </properties>
- <properties name="dbstore">
- <property name="org.jboss.soa.esb.persistence.db.connection.url" value="jdbc:hsqldb:hsql://localhost:9001/"/>
- <property name="org.jboss.soa.esb.persistence.db.jdbc.driver" value="org.hsqldb.jdbcDriver"/>
- <property name="org.jboss.soa.esb.persistence.db.user" value="sa"/>
- <property name="org.jboss.soa.esb.persistence.db.pwd" value=""/>
- <property name="org.jboss.soa.esb.persistence.db.pool.initial.size" value="2"/>
- <property name="org.jboss.soa.esb.persistence.db.pool.min.size" value="2"/>
- <property name="org.jboss.soa.esb.persistence.db.pool.max.size" value="5"/>
- <!--table managed by pool to test for valid connections - created by pool automatically -->
- <property name="org.jboss.soa.esb.persistence.db.pool.test.table" value="pooltest"/>
- <!-- # of milliseconds to timeout waiting for a connection from pool -->
- <property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis" value="5000"/>
- <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/>
- </properties>
- <properties name="messagerouting">
- <property name="org.jboss.soa.esb.routing.cbrClass" value="org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter"/>
- </properties>
-</esb>
Copied: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/jbossesb-properties.xml (from rev 25163, labs/jbossesb/trunk/product/samples/quickstarts/http_gateway/jbossesb-properties.xml)
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/jbossesb-properties.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/jbossesb-properties.xml 2009-02-19 13:08:39 UTC (rev 25342)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright 2006, JBoss Inc., and others contributors as indicated
+ by the @authors tag. All rights reserved.
+ See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+ This copyrighted material is made available to anyone wishing to use,
+ modify, copy, or redistribute it subject to the terms and conditions
+ of the GNU Lesser General Public License, v. 2.1.
+ This program is distributed in the hope that it will be useful, but WITHOUT A
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ You should have received a copy of the GNU Lesser General Public License,
+ v.2.1 along with this distribution; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ MA 02110-1301, USA.
+
+ (C) 2005-2006,
+ @author JBoss Inc.
+-->
+<!-- $Id: jbossesb-unittest-properties.xml $ -->
+<!--
+ These options are described in the JBossESB manual.
+ Defaults are provided here for convenience only.
+
+ Please read through this file prior to using the system, and consider
+ updating the specified entries.
+-->
+<esb
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
+ <properties name="core">
+ <property name="org.jboss.soa.esb.jndi.server.type" value="jboss"/>
+ <property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
+ <property name="org.jboss.soa.esb.persistence.connection.factory" value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
+ <property name="jboss.esb.invm.scope.default" value="NONE"/>
+ </properties>
+ <properties name="registry">
+ <property name="org.jboss.soa.esb.registry.queryManagerURI"
+ value="jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire"/>
+ <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"
+ value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish" />
+ <property name="org.jboss.soa.esb.registry.implementationClass"
+ value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
+ <property name="org.jboss.soa.esb.registry.factoryClass"
+ value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
+ <property name="org.jboss.soa.esb.registry.user"
+ value="jbossesb"/>
+ <property name="org.jboss.soa.esb.registry.password"
+ value="password"/>
+ <!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
+ <property name="org.jboss.soa.esb.scout.proxy.transportClass"
+ value="org.apache.ws.scout.transport.RMITransport"/>
+ </properties>
+ <properties name="transports" depends="core">
+ <property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
+ <property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>
+ <property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
+ <property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
+ </properties>
+ <properties name="connection">
+ <property name="min-pool-size" value="5"/>
+ <property name="max-pool=size" value="10"/>
+ <property name="blocking-timeout-millis" value="5000"/>
+ <property name="abandoned-connection-timeout" value="10000"/>
+ <property name="abandoned-connection-time-interval" value="30000"/>
+ </properties>
+ <properties name="dbstore">
+ <property name="org.jboss.soa.esb.persistence.db.connection.url" value="jdbc:hsqldb:hsql://localhost:9001/"/>
+ <property name="org.jboss.soa.esb.persistence.db.jdbc.driver" value="org.hsqldb.jdbcDriver"/>
+ <property name="org.jboss.soa.esb.persistence.db.user" value="sa"/>
+ <property name="org.jboss.soa.esb.persistence.db.pwd" value=""/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.initial.size" value="2"/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.min.size" value="2"/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.max.size" value="5"/>
+ <!--table managed by pool to test for valid connections - created by pool automatically -->
+ <property name="org.jboss.soa.esb.persistence.db.pool.test.table" value="pooltest"/>
+ <!-- # of milliseconds to timeout waiting for a connection from pool -->
+ <property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis" value="5000"/>
+ <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/>
+ </properties>
+ <properties name="messagerouting">
+ <property name="org.jboss.soa.esb.routing.cbrClass" value="org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter"/>
+ </properties>
+</esb>
Deleted: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/jndi.properties
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/http_gateway/jndi.properties 2009-02-09 18:20:00 UTC (rev 25163)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/jndi.properties 2009-02-19 13:08:39 UTC (rev 25342)
@@ -1,5 +0,0 @@
-java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-java.naming.provider.url=jnp://localhost:1099
-java.naming.factory.url.pkgs=org.jboss.naming
-java.naming.factory.url.pkgs=org.jnp.interfaces
-
Copied: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/jndi.properties (from rev 25163, labs/jbossesb/trunk/product/samples/quickstarts/http_gateway/jndi.properties)
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/jndi.properties (rev 0)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/jndi.properties 2009-02-19 13:08:39 UTC (rev 25342)
@@ -0,0 +1,5 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+java.naming.factory.url.pkgs=org.jnp.interfaces
+
Deleted: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/juddi.properties
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/http_gateway/juddi.properties 2009-02-09 18:20:00 UTC (rev 25163)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/juddi.properties 2009-02-19 13:08:39 UTC (rev 25342)
@@ -1,69 +0,0 @@
-# jUDDI Registry Properties (used by RegistryServer)
-# see http://www.juddi.org for more information
-
-# The UDDI Operator Name
-juddi.operatorName = jUDDI.org
-
-# The i18n locale default codes
-juddi.i18n.languageCode = en
-juddi.i18n.countryCode = US
-
-# The UDDI DiscoveryURL Prefix
-juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
-
-# The UDDI Operator Contact Email Address
-juddi.operatorEmailAddress = admin at juddi.org
-
-# The maximum name size and maximum number
-# of name elements allows in several of the
-# FindXxxx and SaveXxxx UDDI functions.
-juddi.maxNameLength=255
-juddi.maxNameElementsAllowed=5
-
-# The maximum number of UDDI artifacts allowed
-# per publisher. A value of '-1' indicates any
-# number of artifacts is valid (These values can be
-# overridden at the individual publisher level).
-juddi.maxBusinessesPerPublisher=25
-juddi.maxServicesPerBusiness=20
-juddi.maxBindingsPerService=10
-juddi.maxTModelsPerPublisher=100
-
-# jUDDI Authentication module to use
-juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
-
-# jUDDI DataStore module currently to use
-juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
-
-# use a dataSource (if set to false a direct
-# jdbc connection will be used.
-juddi.isUseDataSource=false
-juddi.jdbcDriver=com.mysql.jdbc.Driver
-juddi.jdbcUrl=jdbc:mysql://localhost:3306/juddi
-juddi.jdbcUsername=root
-juddi.jdbcPassword=admin
-# jUDDI DataSource to use
-# juddi.dataSource=java:comp/env/jdbc/MySqlDS
-
-# jUDDI UUIDGen implementation to use
-juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
-
-# jUDDI Cryptor implementation to use
-juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
-
-# jUDDI Validator to use
-juddi.validator=org.apache.juddi.validator.DefaultValidator
-
-# jUDDI Proxy Properties (used by RegistryProxy)
-juddi.proxy.adminURL = http://localhost:8080/juddi/admin
-juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
-juddi.proxy.publishURL = http://localhost:8080/juddi/publish
-juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
-juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
-juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
-
-# JNDI settings (used by RMITransport)
-java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-java.naming.provider.url=jnp://localhost:1099
-java.naming.factory.url.pkgs=org.jboss.naming
-
Copied: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/juddi.properties (from rev 25163, labs/jbossesb/trunk/product/samples/quickstarts/http_gateway/juddi.properties)
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/juddi.properties (rev 0)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/juddi.properties 2009-02-19 13:08:39 UTC (rev 25342)
@@ -0,0 +1,69 @@
+# jUDDI Registry Properties (used by RegistryServer)
+# see http://www.juddi.org for more information
+
+# The UDDI Operator Name
+juddi.operatorName = jUDDI.org
+
+# The i18n locale default codes
+juddi.i18n.languageCode = en
+juddi.i18n.countryCode = US
+
+# The UDDI DiscoveryURL Prefix
+juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
+
+# The UDDI Operator Contact Email Address
+juddi.operatorEmailAddress = admin at juddi.org
+
+# The maximum name size and maximum number
+# of name elements allows in several of the
+# FindXxxx and SaveXxxx UDDI functions.
+juddi.maxNameLength=255
+juddi.maxNameElementsAllowed=5
+
+# The maximum number of UDDI artifacts allowed
+# per publisher. A value of '-1' indicates any
+# number of artifacts is valid (These values can be
+# overridden at the individual publisher level).
+juddi.maxBusinessesPerPublisher=25
+juddi.maxServicesPerBusiness=20
+juddi.maxBindingsPerService=10
+juddi.maxTModelsPerPublisher=100
+
+# jUDDI Authentication module to use
+juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
+
+# jUDDI DataStore module currently to use
+juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
+
+# use a dataSource (if set to false a direct
+# jdbc connection will be used.
+juddi.isUseDataSource=false
+juddi.jdbcDriver=com.mysql.jdbc.Driver
+juddi.jdbcUrl=jdbc:mysql://localhost:3306/juddi
+juddi.jdbcUsername=root
+juddi.jdbcPassword=admin
+# jUDDI DataSource to use
+# juddi.dataSource=java:comp/env/jdbc/MySqlDS
+
+# jUDDI UUIDGen implementation to use
+juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
+
+# jUDDI Cryptor implementation to use
+juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
+
+# jUDDI Validator to use
+juddi.validator=org.apache.juddi.validator.DefaultValidator
+
+# jUDDI Proxy Properties (used by RegistryProxy)
+juddi.proxy.adminURL = http://localhost:8080/juddi/admin
+juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
+juddi.proxy.publishURL = http://localhost:8080/juddi/publish
+juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
+juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
+juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
+
+# JNDI settings (used by RMITransport)
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+
Copied: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/lib (from rev 25163, labs/jbossesb/trunk/product/samples/quickstarts/http_gateway/lib)
Deleted: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/log4j.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/http_gateway/log4j.xml 2009-02-09 18:20:00 UTC (rev 25163)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/log4j.xml 2009-02-19 13:08:39 UTC (rev 25342)
@@ -1,79 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-
-<!-- ===================================================================== -->
-<!-- -->
-<!-- Log4j Configuration -->
-<!-- -->
-<!-- ===================================================================== -->
-
-<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
-
-<!--
- | For more configuration infromation and examples see the Jakarta Log4j
- | owebsite: http://jakarta.apache.org/log4j
- -->
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
-
- <!-- ============================== -->
- <!-- Append messages to the console -->
- <!-- ============================== -->
-
- <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
- <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
- <param name="Target" value="System.out"/>
- <param name="Threshold" value="INFO"/>
-
- <layout class="org.apache.log4j.PatternLayout">
- <!-- The default pattern: Date Priority [Category] Message\n -->
- <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%t][%c{1}] %m%n"/>
- </layout>
- </appender>
-
- <!-- ================================= -->
- <!-- Preserve messages in a local file -->
- <!-- ================================= -->
-
- <!-- A size based file rolling appender -->
- <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
- <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
- <param name="File" value="./listener.log"/>
- <param name="Append" value="false"/>
- <param name="MaxFileSize" value="500KB"/>
- <param name="MaxBackupIndex" value="1"/>
-
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d %-5p [%t][%c] %m%n"/>
- </layout>
- </appender>
-
- <!-- ================ -->
- <!-- Limit categories -->
- <!-- ================ -->
-
- <category name="org.jboss">
- <priority value="WARN"/>
- </category>
- <category name="org.jboss.soa.esb">
- <priority value="ERROR"/>
- </category>
- <category name="org.jboss.internal.soa.esb">
- <priority value="ERROR"/>
- </category>
- <category name="org.apache">
- <priority value="ERROR"/>
- </category>
- <category name="quickstart">
- <priority value="DEBUG"/>
- </category>
- <!-- ======================= -->
- <!-- Setup the Root category -->
- <!-- ======================= -->
-
- <root>
- <appender-ref ref="CONSOLE"/>
- <appender-ref ref="FILE"/>
- </root>
-
-</log4j:configuration>
Copied: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/log4j.xml (from rev 25163, labs/jbossesb/trunk/product/samples/quickstarts/http_gateway/log4j.xml)
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/log4j.xml (rev 0)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/log4j.xml 2009-02-19 13:08:39 UTC (rev 25342)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Log4j Configuration -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
+
+<!--
+ | For more configuration infromation and examples see the Jakarta Log4j
+ | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <!-- ============================== -->
+ <!-- Append messages to the console -->
+ <!-- ============================== -->
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="Target" value="System.out"/>
+ <param name="Threshold" value="INFO"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%t][%c{1}] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ================================= -->
+ <!-- Preserve messages in a local file -->
+ <!-- ================================= -->
+
+ <!-- A size based file rolling appender -->
+ <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="File" value="./listener.log"/>
+ <param name="Append" value="false"/>
+ <param name="MaxFileSize" value="500KB"/>
+ <param name="MaxBackupIndex" value="1"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %-5p [%t][%c] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ================ -->
+ <!-- Limit categories -->
+ <!-- ================ -->
+
+ <category name="org.jboss">
+ <priority value="WARN"/>
+ </category>
+ <category name="org.jboss.soa.esb">
+ <priority value="ERROR"/>
+ </category>
+ <category name="org.jboss.internal.soa.esb">
+ <priority value="ERROR"/>
+ </category>
+ <category name="org.apache">
+ <priority value="ERROR"/>
+ </category>
+ <category name="quickstart">
+ <priority value="DEBUG"/>
+ </category>
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="FILE"/>
+ </root>
+
+</log4j:configuration>
Deleted: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/readme.txt
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/http_gateway/readme.txt 2009-02-09 18:20:00 UTC (rev 25163)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/readme.txt 2009-02-19 13:08:39 UTC (rev 25342)
@@ -1,18 +0,0 @@
-Overview:
-=========
- The purpose of the http_gateway quickstart sample is to demonstarte how to
- configue a http gateway to pass the http request into ESB service.
-
-
-Running this quickstart:
-========================
- Please refer to 'ant help-quickstarts' for prerequisites about the quickstarts
- and a more detailed descripton of the different ways to run the quickstarts.
-
-To Run '.esb' archive mode:
-===========================
- 1. In a command terminal window in this folder ("Window1"), type 'ant deploy'.
- 2. Open the web brower and send http request to "http://localhost:8765/jbossesb/httpgateway/serviceA/"
- and "http://localhost:8765/jbossesb/httpgateway/serviceB/"
- 3. Switch back to Application Server console to see the output from the ESB
- 4. In this folder ("Window1"), type 'ant undeploy'.
Copied: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/readme.txt (from rev 25163, labs/jbossesb/trunk/product/samples/quickstarts/http_gateway/readme.txt)
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/readme.txt (rev 0)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/readme.txt 2009-02-19 13:08:39 UTC (rev 25342)
@@ -0,0 +1,18 @@
+Overview:
+=========
+ The purpose of the http_gateway quickstart sample is to demonstarte how to
+ configue a http gateway to pass the http request into ESB service.
+
+
+Running this quickstart:
+========================
+ Please refer to 'ant help-quickstarts' for prerequisites about the quickstarts
+ and a more detailed descripton of the different ways to run the quickstarts.
+
+To Run '.esb' archive mode:
+===========================
+ 1. In a command terminal window in this folder ("Window1"), type 'ant deploy'.
+ 2. Open the web brower and send http request to "http://localhost:8765/jbossesb/httpgateway/serviceA/"
+ and "http://localhost:8765/jbossesb/httpgateway/serviceB/"
+ 3. Switch back to Application Server console to see the output from the ESB
+ 4. In this folder ("Window1"), type 'ant undeploy'.
Copied: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/src (from rev 25163, labs/jbossesb/trunk/product/samples/quickstarts/http_gateway/src)
Copied: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/src/org (from rev 25163, labs/jbossesb/trunk/product/samples/quickstarts/http_gateway/src/org)
Copied: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/src/org/jboss (from rev 25163, labs/jbossesb/trunk/product/samples/quickstarts/http_gateway/src/org/jboss)
Copied: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/src/org/jboss/soa (from rev 25163, labs/jbossesb/trunk/product/samples/quickstarts/http_gateway/src/org/jboss/soa)
Copied: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb (from rev 25163, labs/jbossesb/trunk/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb)
Copied: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples (from rev 25163, labs/jbossesb/trunk/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples)
Copied: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples/quickstart (from rev 25163, labs/jbossesb/trunk/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples/quickstart)
Copied: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples/quickstart/httpgateway (from rev 25163, labs/jbossesb/trunk/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples/quickstart/httpgateway)
Deleted: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples/quickstart/httpgateway/MyAction.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples/quickstart/httpgateway/MyAction.java 2009-02-09 18:20:00 UTC (rev 25163)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples/quickstart/httpgateway/MyAction.java 2009-02-19 13:08:39 UTC (rev 25342)
@@ -1,74 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-package org.jboss.soa.esb.samples.quickstart.httpgateway;
-
-import java.util.Iterator;
-import java.util.Map;
-
-import org.jboss.soa.esb.actions.AbstractActionLifecycle;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-
-public class MyAction extends AbstractActionLifecycle {
-
- protected ConfigTree _config;
-
- public MyAction(ConfigTree config) {
- _config = config;
- }
-
- public Message displayMessage(Message message) throws Exception {
-
- System.out.println("&&&&&&&&&&&&&&&& MyAction &&&&&&&&&&&&&&&&&&&&&");
-
- System.out.println("------------Http Request Info-------------------");
- Map requestInfo = (Map)message.getProperties().getProperty("RequestInfoMap");
- requestInfo.get("Method");
- Iterator<String> infoIte = requestInfo.keySet().iterator();
- while(infoIte.hasNext()) {
- String key = infoIte.next();
- System.out.println(key + " : " + requestInfo.get(key));
- }
-
-
- System.out.println("------------Http Prameter Map-------------------");
- Object obj = message.getProperties().getProperty("RequestParameterMap");
-
- if (obj != null) {
- Map<String, Object> paraMap = (Map<String, Object>)obj;
- Iterator<String> paraIte = paraMap.keySet().iterator();
- while(paraIte.hasNext()) {
- String key = paraIte.next();
- System.out.println(key + " : " + paraMap.get(key));
- }
- }
-
-
- System.out.println("------------Http Request body -------------------");
- System.out.println(new String((byte[])message.getBody().get()));
-
- System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
- message.getBody().add("This message is from ESB service 1");
- return message;
-
- }
-
-}
Copied: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples/quickstart/httpgateway/MyAction.java (from rev 25163, labs/jbossesb/trunk/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples/quickstart/httpgateway/MyAction.java)
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples/quickstart/httpgateway/MyAction.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples/quickstart/httpgateway/MyAction.java 2009-02-19 13:08:39 UTC (rev 25342)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.httpgateway;
+
+import java.util.Iterator;
+import java.util.Map;
+
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+public class MyAction extends AbstractActionLifecycle {
+
+ protected ConfigTree _config;
+
+ public MyAction(ConfigTree config) {
+ _config = config;
+ }
+
+ public Message displayMessage(Message message) throws Exception {
+
+ System.out.println("&&&&&&&&&&&&&&&& MyAction &&&&&&&&&&&&&&&&&&&&&");
+
+ System.out.println("------------Http Request Info-------------------");
+ Map requestInfo = (Map)message.getProperties().getProperty("RequestInfoMap");
+ requestInfo.get("Method");
+ Iterator<String> infoIte = requestInfo.keySet().iterator();
+ while(infoIte.hasNext()) {
+ String key = infoIte.next();
+ System.out.println(key + " : " + requestInfo.get(key));
+ }
+
+
+ System.out.println("------------Http Prameter Map-------------------");
+ Object obj = message.getProperties().getProperty("RequestParameterMap");
+
+ if (obj != null) {
+ Map<String, Object> paraMap = (Map<String, Object>)obj;
+ Iterator<String> paraIte = paraMap.keySet().iterator();
+ while(paraIte.hasNext()) {
+ String key = paraIte.next();
+ System.out.println(key + " : " + paraMap.get(key));
+ }
+ }
+
+
+ System.out.println("------------Http Request body -------------------");
+ System.out.println(new String((byte[])message.getBody().get()));
+
+ System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
+ message.getBody().add("This message is from ESB service 1");
+ return message;
+
+ }
+
+}
Deleted: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples/quickstart/httpgateway/MyAction2.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples/quickstart/httpgateway/MyAction2.java 2009-02-09 18:20:00 UTC (rev 25163)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples/quickstart/httpgateway/MyAction2.java 2009-02-19 13:08:39 UTC (rev 25342)
@@ -1,75 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-package org.jboss.soa.esb.samples.quickstart.httpgateway;
-
-import java.util.Iterator;
-import java.util.Map;
-
-import org.jboss.soa.esb.actions.AbstractActionLifecycle;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-
-public class MyAction2 extends AbstractActionLifecycle {
-
- protected ConfigTree _config;
-
- public MyAction2(ConfigTree config) {
- _config = config;
- }
-
- public Message displayMessage(Message message) throws Exception {
-
-
- System.out.println("&&&&&&&&&&&&&&&& MyAction2 &&&&&&&&&&&&&&&&&&&&&");
-
- System.out.println("------------Http Request Info-------------------");
- Map requestInfo = (Map)message.getProperties().getProperty("RequestInfoMap");
- requestInfo.get("Method");
- Iterator<String> infoIte = requestInfo.keySet().iterator();
- while(infoIte.hasNext()) {
- String key = infoIte.next();
- System.out.println(key + " : " + requestInfo.get(key));
- }
-
-
- System.out.println("------------Http Prameter Map-------------------");
- Object obj = message.getProperties().getProperty("RequestParameterMap");
-
- if (obj != null) {
- Map<String, Object> paraMap = (Map<String, Object>)obj;
- Iterator<String> paraIte = paraMap.keySet().iterator();
- while(paraIte.hasNext()) {
- String key = paraIte.next();
- System.out.println(key + " : " + paraMap.get(key));
- }
- }
-
-
- System.out.println("------------Http Request body -------------------");
- System.out.println(new String((byte[])message.getBody().get()));
-
- System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
- message.getBody().add("This message is from ESB service 2");
- return message;
-
- }
-
-}
Copied: labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples/quickstart/httpgateway/MyAction2.java (from rev 25163, labs/jbossesb/trunk/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples/quickstart/httpgateway/MyAction2.java)
===================================================================
--- labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples/quickstart/httpgateway/MyAction2.java (rev 0)
+++ labs/jbossesb/branches/JBESB_4_4_GA_FP/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples/quickstart/httpgateway/MyAction2.java 2009-02-19 13:08:39 UTC (rev 25342)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.httpgateway;
+
+import java.util.Iterator;
+import java.util.Map;
+
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+public class MyAction2 extends AbstractActionLifecycle {
+
+ protected ConfigTree _config;
+
+ public MyAction2(ConfigTree config) {
+ _config = config;
+ }
+
+ public Message displayMessage(Message message) throws Exception {
+
+
+ System.out.println("&&&&&&&&&&&&&&&& MyAction2 &&&&&&&&&&&&&&&&&&&&&");
+
+ System.out.println("------------Http Request Info-------------------");
+ Map requestInfo = (Map)message.getProperties().getProperty("RequestInfoMap");
+ requestInfo.get("Method");
+ Iterator<String> infoIte = requestInfo.keySet().iterator();
+ while(infoIte.hasNext()) {
+ String key = infoIte.next();
+ System.out.println(key + " : " + requestInfo.get(key));
+ }
+
+
+ System.out.println("------------Http Prameter Map-------------------");
+ Object obj = message.getProperties().getProperty("RequestParameterMap");
+
+ if (obj != null) {
+ Map<String, Object> paraMap = (Map<String, Object>)obj;
+ Iterator<String> paraIte = paraMap.keySet().iterator();
+ while(paraIte.hasNext()) {
+ String key = paraIte.next();
+ System.out.println(key + " : " + paraMap.get(key));
+ }
+ }
+
+
+ System.out.println("------------Http Request body -------------------");
+ System.out.println(new String((byte[])message.getBody().get()));
+
+ System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
+ message.getBody().add("This message is from ESB service 2");
+ return message;
+
+ }
+
+}
More information about the jboss-svn-commits
mailing list