[savara-commits] savara SVN: r692 - in branches/experimental/2.0.x: distribution/src/files/jbossws-native and 17 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Fri Feb 18 16:06:44 EST 2011
Author: objectiser
Date: 2011-02-18 16:06:43 -0500 (Fri, 18 Feb 2011)
New Revision: 692
Added:
branches/experimental/2.0.x/integration/jboss/common/src/main/java/org/savara/integration/
branches/experimental/2.0.x/integration/jboss/common/src/main/java/org/savara/integration/jboss/
branches/experimental/2.0.x/integration/jboss/common/src/main/java/org/savara/integration/jboss/SavaraService.java
branches/experimental/2.0.x/integration/jboss/common/src/main/java/org/savara/integration/jboss/SavaraServiceMBean.java
branches/experimental/2.0.x/integration/jboss/esb/src/main/java/org/savara/integration/
branches/experimental/2.0.x/integration/jboss/esb/src/main/java/org/savara/integration/jbossesb/
branches/experimental/2.0.x/integration/jboss/esb/src/main/java/org/savara/integration/jbossesb/JBossESBInterceptor.java
branches/experimental/2.0.x/integration/jboss/wsnative/src/main/java/org/savara/integration/
branches/experimental/2.0.x/integration/jboss/wsnative/src/main/java/org/savara/integration/jbosswsnative/
branches/experimental/2.0.x/integration/jboss/wsnative/src/main/java/org/savara/integration/jbosswsnative/AbstractJBossWSNativeInterceptor.java
branches/experimental/2.0.x/integration/jboss/wsnative/src/main/java/org/savara/integration/jbosswsnative/JBossWSNativeClientInterceptor.java
branches/experimental/2.0.x/integration/jboss/wsnative/src/main/java/org/savara/integration/jbosswsnative/JBossWSNativeServerInterceptor.java
Removed:
branches/experimental/2.0.x/integration/jboss/common/src/main/java/org/savara/integration/jboss/ServiceValidatorService.java
branches/experimental/2.0.x/integration/jboss/common/src/main/java/org/savara/integration/jboss/ServiceValidatorServiceMBean.java
branches/experimental/2.0.x/integration/jboss/common/src/main/java/org/savara/validator/service/ServiceValidatorService.java
branches/experimental/2.0.x/integration/jboss/common/src/main/java/org/savara/validator/service/ServiceValidatorServiceMBean.java
branches/experimental/2.0.x/integration/jboss/esb/src/main/java/org/savara/integration/jbossesb/JBossESBInterceptor.java
branches/experimental/2.0.x/integration/jboss/esb/src/main/java/org/savara/integration/jbossesb/ValidatorFilter.java
branches/experimental/2.0.x/integration/jboss/esb/src/main/java/org/savara/validator/jbossesb/ESBUtil.java
branches/experimental/2.0.x/integration/jboss/esb/src/main/java/org/savara/validator/jbossesb/JBossESBInterceptor.java
branches/experimental/2.0.x/integration/jboss/wsnative/src/main/configs/META-INF/jboss-beans.xml
branches/experimental/2.0.x/integration/jboss/wsnative/src/main/java/org/savara/validator/jbosswsnative/AbstractJBossWSNativeInterceptor.java
branches/experimental/2.0.x/integration/jboss/wsnative/src/main/java/org/savara/validator/jbosswsnative/JBossWSNativeClientInterceptor.java
branches/experimental/2.0.x/integration/jboss/wsnative/src/main/java/org/savara/validator/jbosswsnative/JBossWSNativeServerInterceptor.java
branches/experimental/2.0.x/integration/jboss/wsnative/src/main/java/org/savara/validator/jbosswsnative/service/
Modified:
branches/experimental/2.0.x/distribution/src/files/jbossesb/jbossesb-properties-savara.xml
branches/experimental/2.0.x/distribution/src/files/jbossws-native/standard-jaxws-client-config-savara.xml
branches/experimental/2.0.x/distribution/src/files/jbossws-native/standard-jaxws-endpoint-config-savara.xml
branches/experimental/2.0.x/integration/jboss/common/src/main/configs/META-INF/jboss-beans.xml
branches/experimental/2.0.x/integration/jboss/common/src/main/configs/pi4soa.xml
branches/experimental/2.0.x/integration/jboss/esb/src/main/configs/META-INF/deployment.xml
branches/experimental/2.0.x/integration/jboss/esb/src/main/java/org/savara/integration/jbossesb/ESBUtil.java
branches/experimental/2.0.x/integration/jboss/esb/src/test/java/org/savara/validator/jbossesb/ESBUtilTest.java
Log:
Refactored integration classes into more appropriate packages.
Modified: branches/experimental/2.0.x/distribution/src/files/jbossesb/jbossesb-properties-savara.xml
===================================================================
--- branches/experimental/2.0.x/distribution/src/files/jbossesb/jbossesb-properties-savara.xml 2011-02-18 20:17:52 UTC (rev 691)
+++ branches/experimental/2.0.x/distribution/src/files/jbossesb/jbossesb-properties-savara.xml 2011-02-18 21:06:43 UTC (rev 692)
@@ -143,7 +143,7 @@
<properties name="filters">
<property name="org.jboss.soa.esb.filter.1" value="org.jboss.internal.soa.esb.message.filter.MetaDataFilter"/>
<property name="org.jboss.soa.esb.filter.2" value="org.jboss.internal.soa.esb.message.filter.GatewayFilter"/>
- <property name="org.jboss.soa.esb.filter.10" value="org.savara.validator.jbossesb.JBossESBInterceptor" />
+ <property name="org.jboss.soa.esb.filter.10" value="org.savara.integration.jbossesb.JBossESBInterceptor" />
</properties>
<properties name="rules">
Modified: branches/experimental/2.0.x/distribution/src/files/jbossws-native/standard-jaxws-client-config-savara.xml
===================================================================
--- branches/experimental/2.0.x/distribution/src/files/jbossws-native/standard-jaxws-client-config-savara.xml 2011-02-18 20:17:52 UTC (rev 691)
+++ branches/experimental/2.0.x/distribution/src/files/jbossws-native/standard-jaxws-client-config-savara.xml 2011-02-18 21:06:43 UTC (rev 692)
@@ -9,8 +9,8 @@
<javaee:handler-chain>
<javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
<javaee:handler>
- <javaee:handler-name>SAVARA JBossWS-Native Service Validator Interceptor</javaee:handler-name>
- <javaee:handler-class>org.savara.validator.jbosswsnative.JBossWSNativeClientInterceptor</javaee:handler-class>
+ <javaee:handler-name>SAVARA JBossWS-Native Interceptor</javaee:handler-name>
+ <javaee:handler-class>org.savara.integration.jbosswsnative.JBossWSNativeClientInterceptor</javaee:handler-class>
</javaee:handler>
</javaee:handler-chain>
</pre-handler-chains>
Modified: branches/experimental/2.0.x/distribution/src/files/jbossws-native/standard-jaxws-endpoint-config-savara.xml
===================================================================
--- branches/experimental/2.0.x/distribution/src/files/jbossws-native/standard-jaxws-endpoint-config-savara.xml 2011-02-18 20:17:52 UTC (rev 691)
+++ branches/experimental/2.0.x/distribution/src/files/jbossws-native/standard-jaxws-endpoint-config-savara.xml 2011-02-18 21:06:43 UTC (rev 692)
@@ -16,8 +16,8 @@
<javaee:handler-chain>
<javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
<javaee:handler>
- <javaee:handler-name>SAVARA JBossWS-Native Service Validator Interceptor</javaee:handler-name>
- <javaee:handler-class>org.savara.validator.jbosswsnative.JBossWSNativeServerInterceptor</javaee:handler-class>
+ <javaee:handler-name>SAVARA JBossWS-Native Interceptor</javaee:handler-name>
+ <javaee:handler-class>org.savara.integration.jbosswsnative.JBossWSNativeServerInterceptor</javaee:handler-class>
</javaee:handler>
</javaee:handler-chain>
</pre-handler-chains>
Modified: branches/experimental/2.0.x/integration/jboss/common/src/main/configs/META-INF/jboss-beans.xml
===================================================================
--- branches/experimental/2.0.x/integration/jboss/common/src/main/configs/META-INF/jboss-beans.xml 2011-02-18 20:17:52 UTC (rev 691)
+++ branches/experimental/2.0.x/integration/jboss/common/src/main/configs/META-INF/jboss-beans.xml 2011-02-18 21:06:43 UTC (rev 692)
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<deployment xmlns="urn:jboss:bean-deployer:2.0">
- <bean class="org.savara.validator.service.ServiceValidatorService"
- name="ServiceValidator">
- <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.savara:service=ServiceValidatorManager", exposedInterface=org.savara.validator.service.ServiceValidatorServiceMBean.class,registerDirectly=true)</annotation>
+ <bean class="org.savara.integration.jboss.SavaraService"
+ name="SavaraService">
+ <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="savara:service=SavaraService", exposedInterface=org.savara.integration.jboss.SavaraServiceMBean.class,registerDirectly=true)</annotation>
<depends>jboss.messaging.destination:service=Topic,name=tracker</depends>
</bean>
Modified: branches/experimental/2.0.x/integration/jboss/common/src/main/configs/pi4soa.xml
===================================================================
--- branches/experimental/2.0.x/integration/jboss/common/src/main/configs/pi4soa.xml 2011-02-18 20:17:52 UTC (rev 691)
+++ branches/experimental/2.0.x/integration/jboss/common/src/main/configs/pi4soa.xml 2011-02-18 21:06:43 UTC (rev 692)
@@ -21,13 +21,4 @@
-->
<pi4soa>
-<!--
- <monitor>
- <serviceTracker class="org.savara.validator.pi4soa.JMSServiceTracker" >
- <jmsConnectionFactory>ConnectionFactory</jmsConnectionFactory>
- <jmsDestination>topic/tracker</jmsDestination>
- <recordMessagePayload>true</recordMessagePayload>
- </serviceTracker>
- </monitor>
--->
</pi4soa>
\ No newline at end of file
Copied: branches/experimental/2.0.x/integration/jboss/common/src/main/java/org/savara/integration/jboss/SavaraService.java (from rev 648, branches/experimental/2.0.x/integration/jboss/common/src/main/java/org/savara/validator/service/ServiceValidatorService.java)
===================================================================
--- branches/experimental/2.0.x/integration/jboss/common/src/main/java/org/savara/integration/jboss/SavaraService.java (rev 0)
+++ branches/experimental/2.0.x/integration/jboss/common/src/main/java/org/savara/integration/jboss/SavaraService.java 2011-02-18 21:06:43 UTC (rev 692)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, 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.
+ */
+package org.savara.integration.jboss;
+
+import java.util.logging.Logger;
+
+import org.savara.activity.ActivityProcessor;
+import org.savara.activity.ActivityProcessorFactory;
+import org.savara.activity.ActivityValidator;
+import org.savara.activity.DefaultActivityProcessor;
+import org.savara.activity.notifier.jms.JMSActivityNotifier;
+import org.savara.activity.validator.cdm.CDMActivityValidator;
+import org.savara.common.config.file.FileConfiguration;
+
+/**
+ * This is the JBoss Savara Service Validator Service managing the Service Validator.
+ *
+ * @author gbrown
+ *
+ */
+public class SavaraService extends org.jboss.system.ServiceMBeanSupport implements SavaraServiceMBean {
+
+ private final static Logger logger = Logger.getLogger(SavaraService.class.getName());
+
+ /**
+ * The default constructor.
+ */
+ public SavaraService() {
+ }
+
+ /**
+ * This method starts the service, instantiating the
+ * Service Validation Manager and registering it with JNDI.
+ */
+ protected void startService() throws Exception {
+ logger.info("Starting Savara Service Validator Manager");
+
+ // Create ActivityProcessor
+ ActivityProcessor dap=new DefaultActivityProcessor();
+
+ FileConfiguration config=new FileConfiguration();
+
+ JMSActivityNotifier notifier=new JMSActivityNotifier();
+ notifier.setConfiguration(config);
+
+ dap.addActivityNotifier(notifier);
+
+ ActivityValidator validator=new CDMActivityValidator();
+
+ dap.addActivityValidator(validator);
+
+ setActivityProcessor(dap);
+ }
+
+ public void setActivityProcessor(ActivityProcessor ap) {
+ ActivityProcessorFactory.setActivityProcessor(ap);
+ }
+
+ /**
+ * This method stops the service, closing the
+ * Service Validation Manager and unregistering it from JNDI.
+ */
+ protected void stopService() throws Exception {
+ logger.info("Stopping Savara Service Validator Manager");
+ }
+}
Copied: branches/experimental/2.0.x/integration/jboss/common/src/main/java/org/savara/integration/jboss/SavaraServiceMBean.java (from rev 648, branches/experimental/2.0.x/integration/jboss/common/src/main/java/org/savara/validator/service/ServiceValidatorServiceMBean.java)
===================================================================
--- branches/experimental/2.0.x/integration/jboss/common/src/main/java/org/savara/integration/jboss/SavaraServiceMBean.java (rev 0)
+++ branches/experimental/2.0.x/integration/jboss/common/src/main/java/org/savara/integration/jboss/SavaraServiceMBean.java 2011-02-18 21:06:43 UTC (rev 692)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, 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.
+ */
+package org.savara.integration.jboss;
+
+import org.jboss.system.ServiceMBean;
+import org.savara.activity.ActivityProcessor;
+
+/**
+ * The MBean for the Service Validator Service.
+ *
+ * @author gbrown
+ *
+ */
+public interface SavaraServiceMBean extends ServiceMBean {
+
+ public void setActivityProcessor(ActivityProcessor ap);
+
+}
Deleted: branches/experimental/2.0.x/integration/jboss/common/src/main/java/org/savara/integration/jboss/ServiceValidatorService.java
===================================================================
--- branches/experimental/2.0.x/integration/jboss/common/src/main/java/org/savara/validator/service/ServiceValidatorService.java 2011-02-10 20:00:20 UTC (rev 648)
+++ branches/experimental/2.0.x/integration/jboss/common/src/main/java/org/savara/integration/jboss/ServiceValidatorService.java 2011-02-18 21:06:43 UTC (rev 692)
@@ -1,121 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat Middleware LLC, 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.
- */
-package org.savara.validator.service;
-
-import java.util.logging.Logger;
-
-import org.savara.validator.ServiceValidator;
-import org.savara.validator.ServiceValidatorManager;
-import org.jboss.util.naming.NonSerializableFactory;
-
-import javax.naming.*;
-
-/**
- * This is the JBoss Savara Service Validator Service managing the Service Validator.
- *
- * @author gbrown
- *
- */
-public class ServiceValidatorService extends org.jboss.system.ServiceMBeanSupport implements ServiceValidatorServiceMBean {
-
- private final static Logger logger = Logger.getLogger(ServiceValidatorService.class.getName());
-
- private String m_jndiName=null;
- private ServiceValidatorManager m_serviceValidatorManager=null;
-
- /**
- * The default constructor.
- */
- public ServiceValidatorService() {
- }
-
- /**
- * This method starts the service, instantiating the
- * Service Validation Manager and registering it with JNDI.
- */
- protected void startService() throws Exception {
- logger.info("Starting Savara Service Validator Manager");
-
- m_serviceValidatorManager = new ServiceValidatorManager();
-
- rebind();
- }
-
- /**
- * This method stops the service, closing the
- * Service Validation Manager and unregistering it from JNDI.
- */
- protected void stopService() throws Exception {
- logger.info("Stopping Savara Service Validator Manager");
-
- unbind(m_jndiName);
-
- m_serviceValidatorManager.close();
-
- m_serviceValidatorManager = null;
- }
-
- /**
- * This method returns the JNDI name used to register the
- * Service Validation Manager.
- */
- public String getJndiName() {
- return m_jndiName;
- }
-
- /**
- * This method sets the JNDI name associated with the
- * BPEL engine.
- *
- * @param jndiName The JNDI name
- * @throws NamingException Failed to register BPEL engine against
- * the JNDI name
- */
- public void setJndiName(String jndiName) throws NamingException {
- String oldName = m_jndiName;
- m_jndiName = jndiName;
-
- if (super.getState() == STARTED) {
- unbind(oldName);
- try {
- rebind();
- } catch(Exception e) {
- NamingException ne = new NamingException("Failed to update jndiName");
- ne.setRootCause(e);
- throw ne;
- }
- }
- }
-
- private void rebind() throws NamingException {
- InitialContext rootCtx = new InitialContext();
- Name fullName = rootCtx.getNameParser("").parse(m_jndiName);
- logger.info("fullName="+fullName);
- NonSerializableFactory.rebind(fullName, m_serviceValidatorManager, true);
- }
-
- private void unbind(String jndiName) {
- try {
- InitialContext rootCtx = new InitialContext();
- rootCtx.unbind(jndiName);
- NonSerializableFactory.unbind(jndiName);
- } catch(NamingException e) {
- logger.severe("Failed to unbind map: "+e);
- }
- }
-}
Deleted: branches/experimental/2.0.x/integration/jboss/common/src/main/java/org/savara/integration/jboss/ServiceValidatorServiceMBean.java
===================================================================
--- branches/experimental/2.0.x/integration/jboss/common/src/main/java/org/savara/validator/service/ServiceValidatorServiceMBean.java 2011-02-10 20:00:20 UTC (rev 648)
+++ branches/experimental/2.0.x/integration/jboss/common/src/main/java/org/savara/integration/jboss/ServiceValidatorServiceMBean.java 2011-02-18 21:06:43 UTC (rev 692)
@@ -1,48 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat Middleware LLC, 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.
- */
-package org.savara.validator.service;
-
-import javax.naming.NamingException;
-
-import org.jboss.system.ServiceMBean;
-
-/**
- * The MBean for the Service Validator Service.
- *
- * @author gbrown
- *
- */
-public interface ServiceValidatorServiceMBean extends ServiceMBean {
-
- /**
- * This method returns the JNDI name used to register the
- * Service Validator.
- */
- public String getJndiName();
-
- /**
- * This method sets the JNDI name associated with the
- * Service Validator.
- *
- * @param jndiName The JNDI name
- * @throws NamingException Failed to register Service Validator against
- * the JNDI name
- */
- public void setJndiName(String jndiName) throws javax.naming.NamingException;
-
-}
Deleted: branches/experimental/2.0.x/integration/jboss/common/src/main/java/org/savara/validator/service/ServiceValidatorService.java
===================================================================
--- branches/experimental/2.0.x/integration/jboss/common/src/main/java/org/savara/validator/service/ServiceValidatorService.java 2011-02-18 20:17:52 UTC (rev 691)
+++ branches/experimental/2.0.x/integration/jboss/common/src/main/java/org/savara/validator/service/ServiceValidatorService.java 2011-02-18 21:06:43 UTC (rev 692)
@@ -1,81 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat Middleware LLC, 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.
- */
-package org.savara.validator.service;
-
-import java.util.logging.Logger;
-
-import org.savara.activity.ActivityProcessor;
-import org.savara.activity.ActivityProcessorFactory;
-import org.savara.activity.ActivityValidator;
-import org.savara.activity.DefaultActivityProcessor;
-import org.savara.activity.notifier.jms.JMSActivityNotifier;
-import org.savara.activity.validator.cdm.CDMActivityValidator;
-import org.savara.common.config.file.FileConfiguration;
-
-/**
- * This is the JBoss Savara Service Validator Service managing the Service Validator.
- *
- * @author gbrown
- *
- */
-public class ServiceValidatorService extends org.jboss.system.ServiceMBeanSupport implements ServiceValidatorServiceMBean {
-
- private final static Logger logger = Logger.getLogger(ServiceValidatorService.class.getName());
-
- /**
- * The default constructor.
- */
- public ServiceValidatorService() {
- }
-
- /**
- * This method starts the service, instantiating the
- * Service Validation Manager and registering it with JNDI.
- */
- protected void startService() throws Exception {
- logger.info("Starting Savara Service Validator Manager");
-
- // Create ActivityProcessor
- ActivityProcessor dap=new DefaultActivityProcessor();
-
- FileConfiguration config=new FileConfiguration();
-
- JMSActivityNotifier notifier=new JMSActivityNotifier();
- notifier.setConfiguration(config);
-
- dap.addActivityNotifier(notifier);
-
- ActivityValidator validator=new CDMActivityValidator();
-
- dap.addActivityValidator(validator);
-
- setActivityProcessor(dap);
- }
-
- public void setActivityProcessor(ActivityProcessor ap) {
- ActivityProcessorFactory.setActivityProcessor(ap);
- }
-
- /**
- * This method stops the service, closing the
- * Service Validation Manager and unregistering it from JNDI.
- */
- protected void stopService() throws Exception {
- logger.info("Stopping Savara Service Validator Manager");
- }
-}
Deleted: branches/experimental/2.0.x/integration/jboss/common/src/main/java/org/savara/validator/service/ServiceValidatorServiceMBean.java
===================================================================
--- branches/experimental/2.0.x/integration/jboss/common/src/main/java/org/savara/validator/service/ServiceValidatorServiceMBean.java 2011-02-18 20:17:52 UTC (rev 691)
+++ branches/experimental/2.0.x/integration/jboss/common/src/main/java/org/savara/validator/service/ServiceValidatorServiceMBean.java 2011-02-18 21:06:43 UTC (rev 692)
@@ -1,33 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat Middleware LLC, 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.
- */
-package org.savara.validator.service;
-
-import org.jboss.system.ServiceMBean;
-import org.savara.activity.ActivityProcessor;
-
-/**
- * The MBean for the Service Validator Service.
- *
- * @author gbrown
- *
- */
-public interface ServiceValidatorServiceMBean extends ServiceMBean {
-
- public void setActivityProcessor(ActivityProcessor ap);
-
-}
Modified: branches/experimental/2.0.x/integration/jboss/esb/src/main/configs/META-INF/deployment.xml
===================================================================
--- branches/experimental/2.0.x/integration/jboss/esb/src/main/configs/META-INF/deployment.xml 2011-02-18 20:17:52 UTC (rev 691)
+++ branches/experimental/2.0.x/integration/jboss/esb/src/main/configs/META-INF/deployment.xml 2011-02-18 21:06:43 UTC (rev 692)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<jbossesb-deployment>
<depends>jboss.esb:deployment=jbossesb.esb</depends>
- <depends>jboss.savara:service=ServiceValidatorManager</depends>
+ <depends>savara:service=SavaraService</depends>
</jbossesb-deployment>
Modified: branches/experimental/2.0.x/integration/jboss/esb/src/main/java/org/savara/integration/jbossesb/ESBUtil.java
===================================================================
--- branches/experimental/2.0.x/integration/jboss/esb/src/main/java/org/savara/validator/jbossesb/ESBUtil.java 2011-02-10 20:00:20 UTC (rev 648)
+++ branches/experimental/2.0.x/integration/jboss/esb/src/main/java/org/savara/integration/jbossesb/ESBUtil.java 2011-02-18 21:06:43 UTC (rev 692)
@@ -15,7 +15,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
-package org.savara.validator.jbossesb;
+package org.savara.integration.jbossesb;
import org.apache.log4j.Logger;
import org.pi4soa.common.util.NamesUtil;
Deleted: branches/experimental/2.0.x/integration/jboss/esb/src/main/java/org/savara/integration/jbossesb/JBossESBInterceptor.java
===================================================================
--- branches/experimental/2.0.x/integration/jboss/esb/src/main/java/org/savara/validator/jbossesb/JBossESBInterceptor.java 2011-02-10 20:00:20 UTC (rev 648)
+++ branches/experimental/2.0.x/integration/jboss/esb/src/main/java/org/savara/integration/jbossesb/JBossESBInterceptor.java 2011-02-18 21:06:43 UTC (rev 692)
@@ -1,285 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, 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.
- */
-package org.savara.validator.jbossesb;
-
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-import org.apache.log4j.Logger;
-
-import org.savara.validator.Endpoint;
-import org.savara.validator.ServiceValidator;
-import org.savara.validator.ServiceValidatorManager;
-import org.jboss.soa.esb.message.*;
-import org.jboss.soa.esb.couriers.*;
-
-/**
- * This class represents the filter used to intercept ESB
- * messages an apply them to relevant Service Validators.
- */
-public class JBossESBInterceptor extends org.jboss.soa.esb.filter.InputOutputFilter {
-
- private static final String TOPIC_PREFIX = "topic/";
- private static final String QUEUE_PREFIX = "queue/";
- private static final String JMS_PROTOCOL_PREFIX = "jms:";
-
- private static final Logger logger = Logger.getLogger(JBossESBInterceptor.class);
-
- private ServiceValidatorManager m_serviceValidatorManager=null;
-
- /**
- * The default constructor.
- */
- public JBossESBInterceptor() {
- }
-
- /**
- * This method returns the service validator manager.
- *
- * @return The service validator manager
- */
- protected ServiceValidatorManager getServiceValidatorManager() {
- if (m_serviceValidatorManager == null) {
- try {
- InitialContext ctx = new InitialContext();
- m_serviceValidatorManager =
- (ServiceValidatorManager)ctx.lookup("savara/ServiceValidatorManager");
- } catch (NamingException e) {
- throw new RuntimeException("Failed to locate Savara Service Validator Manager");
- }
- }
-
- return(m_serviceValidatorManager);
- }
-
- /**
- * This method is invoked when a message is sent by an
- * ESB service.
- *
- * @param msg The ESB message
- * @param params The parameters
- * @throws CourierException Failed to validate message
- */
- public Message onOutput(Message msg, java.util.Map params)
- throws CourierException {
-
- Endpoint endpoint=getEndpoint(msg);
-
- if (endpoint != null) {
- java.util.List<ServiceValidator> validators=
- getServiceValidatorManager().getOutputServiceValidators(endpoint);
-
- if (validators != null && validators.size() > 0) {
- boolean validated=false;
- Exception ex=null;
-
- for (int i=0; validators != null &&
- i < validators.size(); i++) {
- try {
- validators.get(i).messageSent(null, ESBUtil.getMessage(msg));
- validated = true;
- } catch(Exception t) {
- // Ignore
- ex = t;
- }
- }
-
- // Only raise exception if none of the service
- // validators were able to validate the message
- if (validated == false) {
- String vnames="";
-
- for (int i=0; validators != null &&
- i < validators.size(); i++) {
- if (vnames.length() > 0) {
- vnames += ", ";
- }
- vnames += validators.get(i).getValidatorName();
- }
-
- logger.error("Failed to handle sent message on endpoint '"+
- endpoint+"' validated against: "+vnames);
-
- if (logger.isDebugEnabled()) {
- logger.debug("Invalid sent message", ex);
- }
-
- if (getServiceValidatorManager().isManagedMode()) {
- throw new CourierException("Failed to handle sent message on endpoint '"+
- endpoint+"' validated against: "+vnames, ex);
- }
- } else {
-
- // Check whether a dynamic reply is expected
- if (getServiceValidatorManager().isOutputDynamicReplyTo(endpoint)) {
-
- // Register interest in the 'reply-to' endpoint
- Endpoint replyTo=getReplyToEndpoint(msg);
-
- if (replyTo != null) {
- getServiceValidatorManager().registerInputReplyToValidators(replyTo,
- validators);
- } else {
- logger.error("Unable to get 'reply-to' endpoint for message: "+msg);
- }
- }
- }
- }
- }
-
- return(msg);
- }
-
- /**
- * This method is invoked when a message is received by an
- * ESB service.
- *
- * @param msg The ESB message
- * @param params The parameters
- * @throws CourierException Failed to validate message
- */
- public Message onInput(Message msg, java.util.Map params)
- throws CourierException {
-
- Endpoint endpoint=getEndpoint(msg);
-
- if (endpoint != null) {
- java.util.List<ServiceValidator> validators=
- getServiceValidatorManager().getInputServiceValidators(endpoint);
-
- if (validators != null && validators.size() > 0) {
- boolean validated=false;
- Exception ex=null;
-
- for (int i=0; validators != null &&
- i < validators.size(); i++) {
- try {
- validators.get(i).messageReceived(null, ESBUtil.getMessage(msg));
- validated = true;
- } catch(Exception t) {
- // Ignore
- ex = t;
- }
- }
-
- // Only raise exception if none of the service
- // validators were able to validate the message
- if (validated == false) {
- String vnames="";
-
- for (int i=0; validators != null &&
- i < validators.size(); i++) {
- if (vnames.length() > 0) {
- vnames += ", ";
- }
- vnames += validators.get(i).getValidatorName();
- }
-
- logger.error("Failed to handle received message on endpoint '"+
- endpoint+"' validated against: "+vnames);
-
- if (logger.isDebugEnabled()) {
- logger.debug("Invalid received message", ex);
- }
-
- if (getServiceValidatorManager().isManagedMode()) {
- throw new CourierException("Failed to handle received message on endpoint '"+
- endpoint+"' validated against: "+vnames, ex);
- }
- } else {
-
- // Check whether a dynamic reply is expected
- if (getServiceValidatorManager().isInputDynamicReplyTo(endpoint)) {
-
- // Register interest in the 'reply-to' endpoint
- Endpoint replyTo=getReplyToEndpoint(msg);
-
- if (replyTo != null) {
- getServiceValidatorManager().registerOutputReplyToValidators(replyTo,
- validators);
- } else {
- logger.error("Unable to get 'reply-to' endpoint for message: "+msg);
- }
- }
- }
- }
- }
-
- return(msg);
- }
-
- /**
- * This method returns an endpoint associated with the 'to'
- * destination of the supplied message.
- *
- * @param msg The message
- * @return The endpoint, or null if not relevant
- */
- protected Endpoint getEndpoint(Message msg) {
- Endpoint ret=null;
-
- if (msg != null && msg.getHeader() != null &&
- msg.getHeader().getCall() != null &&
- msg.getHeader().getCall().getTo() != null &&
- msg.getHeader().getCall().getTo().getAddr() != null) {
-
- String key=msg.getHeader().getCall().getTo().getAddr().getAddress();
- int ind=-1;
-
- if (key.startsWith(JMS_PROTOCOL_PREFIX) &&
- ((ind=key.indexOf(QUEUE_PREFIX)) != -1 ||
- (ind=key.indexOf(TOPIC_PREFIX)) != -1)) {
- ret = new Endpoint(JMS_PROTOCOL_PREFIX+key.substring(ind));
- }
- }
-
- logger.debug("Destination for message '"+msg+"' is: "+ret);
-
- return(ret);
- }
-
- /**
- * This method returns an endpoint associated with the 'to'
- * destination of the supplied message.
- *
- * @param msg The message
- * @return The endpoint, or null if not relevant
- */
- protected Endpoint getReplyToEndpoint(Message msg) {
- Endpoint ret=null;
-
- if (msg != null && msg.getHeader() != null &&
- msg.getHeader().getCall() != null &&
- msg.getHeader().getCall().getReplyTo() != null &&
- msg.getHeader().getCall().getReplyTo().getAddr() != null) {
-
- String key=msg.getHeader().getCall().getReplyTo().getAddr().getAddress();
- int ind=-1;
-
- if (key.startsWith(JMS_PROTOCOL_PREFIX) &&
- ((ind=key.indexOf(QUEUE_PREFIX)) != -1 ||
- (ind=key.indexOf(TOPIC_PREFIX)) != -1)) {
- ret = new Endpoint(JMS_PROTOCOL_PREFIX+key.substring(ind));
- }
- }
-
- logger.debug("Reply-To Destination for message '"+msg+"' is: "+ret);
-
- return(ret);
- }
-}
Copied: branches/experimental/2.0.x/integration/jboss/esb/src/main/java/org/savara/integration/jbossesb/JBossESBInterceptor.java (from rev 689, branches/experimental/2.0.x/integration/jboss/esb/src/main/java/org/savara/validator/jbossesb/JBossESBInterceptor.java)
===================================================================
--- branches/experimental/2.0.x/integration/jboss/esb/src/main/java/org/savara/integration/jbossesb/JBossESBInterceptor.java (rev 0)
+++ branches/experimental/2.0.x/integration/jboss/esb/src/main/java/org/savara/integration/jbossesb/JBossESBInterceptor.java 2011-02-18 21:06:43 UTC (rev 692)
@@ -0,0 +1,206 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, 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.
+ */
+package org.savara.integration.jbossesb;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.apache.log4j.Logger;
+
+import org.savara.activity.ActivityProcessor;
+import org.savara.activity.ActivityProcessorFactory;
+import org.savara.activity.model.InteractionActivity;
+import org.savara.activity.model.MessageParameter;
+import org.savara.common.util.MessageUtils;
+import org.jboss.soa.esb.message.*;
+import org.jboss.soa.esb.couriers.*;
+
+/**
+ * This class represents the filter used to intercept ESB
+ * messages an apply them to relevant Service Validators.
+ */
+public class JBossESBInterceptor extends org.jboss.soa.esb.filter.InputOutputFilter {
+
+ private static final String TOPIC_PREFIX = "topic/";
+ private static final String QUEUE_PREFIX = "queue/";
+ private static final String JMS_PROTOCOL_PREFIX = "jms:";
+
+ private static final Logger logger = Logger.getLogger(JBossESBInterceptor.class);
+
+ /**
+ * The default constructor.
+ */
+ public JBossESBInterceptor() {
+ }
+
+ /**
+ * This method is invoked when a message is sent by an
+ * ESB service.
+ *
+ * @param msg The ESB message
+ * @param params The parameters
+ * @throws CourierException Failed to validate message
+ */
+ public Message onOutput(Message msg, java.util.Map params)
+ throws CourierException {
+
+ String endpoint=getEndpoint(msg);
+
+ java.io.Serializable message=ESBUtil.getMessage(msg);
+
+ if (endpoint != null && message instanceof String) {
+
+ try {
+ ActivityProcessor ap=ActivityProcessorFactory.getActivityProcessor();
+
+ InteractionActivity ia=new InteractionActivity();
+
+ ia.setDestinationAddress(endpoint);
+
+ ia.setOutbound(true);
+
+ MessageParameter mp=new MessageParameter();
+ mp.setType(MessageUtils.getMessageType(message));
+ mp.setValue((String)message);
+
+ ia.getParameter().add(mp);
+
+ String replyTo=getReplyToEndpoint(msg);
+
+ if (replyTo != null) {
+ ia.setReplyToAddress(replyTo);
+ }
+
+ ap.process(ia);
+
+ } catch(Exception e) {
+ logger.error("Failed to report interaction activity", e);
+ }
+ }
+
+ return(msg);
+ }
+
+ /**
+ * This method is invoked when a message is received by an
+ * ESB service.
+ *
+ * @param msg The ESB message
+ * @param params The parameters
+ * @throws CourierException Failed to validate message
+ */
+ public Message onInput(Message msg, java.util.Map params)
+ throws CourierException {
+
+ String endpoint=getEndpoint(msg);
+
+ java.io.Serializable message=ESBUtil.getMessage(msg);
+
+ if (endpoint != null && message instanceof String) {
+
+ try {
+ ActivityProcessor ap=ActivityProcessorFactory.getActivityProcessor();
+
+ InteractionActivity ia=new InteractionActivity();
+
+ ia.setDestinationAddress(endpoint);
+
+ ia.setOutbound(false);
+
+ MessageParameter mp=new MessageParameter();
+ mp.setType(MessageUtils.getMessageType(message));
+ mp.setValue((String)message);
+
+ ia.getParameter().add(mp);
+
+ String replyTo=getReplyToEndpoint(msg);
+
+ if (replyTo != null) {
+ ia.setReplyToAddress(replyTo);
+ }
+
+ ap.process(ia);
+
+ } catch(Exception e) {
+ logger.error("Failed to report interaction activity", e);
+ }
+ }
+
+ return(msg);
+ }
+
+ /**
+ * This method returns an endpoint associated with the 'to'
+ * destination of the supplied message.
+ *
+ * @param msg The message
+ * @return The endpoint, or null if not relevant
+ */
+ protected String getEndpoint(Message msg) {
+ String ret=null;
+
+ if (msg != null && msg.getHeader() != null &&
+ msg.getHeader().getCall() != null &&
+ msg.getHeader().getCall().getTo() != null &&
+ msg.getHeader().getCall().getTo().getAddr() != null) {
+
+ String key=msg.getHeader().getCall().getTo().getAddr().getAddress();
+ int ind=-1;
+
+ if (key.startsWith(JMS_PROTOCOL_PREFIX) &&
+ ((ind=key.indexOf(QUEUE_PREFIX)) != -1 ||
+ (ind=key.indexOf(TOPIC_PREFIX)) != -1)) {
+ ret = JMS_PROTOCOL_PREFIX+key.substring(ind);
+ }
+ }
+
+ logger.debug("Destination for message '"+msg+"' is: "+ret);
+
+ return(ret);
+ }
+
+ /**
+ * This method returns an endpoint associated with the 'to'
+ * destination of the supplied message.
+ *
+ * @param msg The message
+ * @return The endpoint, or null if not relevant
+ */
+ protected String getReplyToEndpoint(Message msg) {
+ String ret=null;
+
+ if (msg != null && msg.getHeader() != null &&
+ msg.getHeader().getCall() != null &&
+ msg.getHeader().getCall().getReplyTo() != null &&
+ msg.getHeader().getCall().getReplyTo().getAddr() != null) {
+
+ String key=msg.getHeader().getCall().getReplyTo().getAddr().getAddress();
+ int ind=-1;
+
+ if (key.startsWith(JMS_PROTOCOL_PREFIX) &&
+ ((ind=key.indexOf(QUEUE_PREFIX)) != -1 ||
+ (ind=key.indexOf(TOPIC_PREFIX)) != -1)) {
+ ret = JMS_PROTOCOL_PREFIX+key.substring(ind);
+ }
+ }
+
+ logger.debug("Reply-To Destination for message '"+msg+"' is: "+ret);
+
+ return(ret);
+ }
+}
Deleted: branches/experimental/2.0.x/integration/jboss/esb/src/main/java/org/savara/integration/jbossesb/ValidatorFilter.java
===================================================================
--- branches/experimental/2.0.x/integration/jboss/esb/src/main/java/org/savara/validator/jbossesb/ValidatorFilter.java 2011-02-10 20:00:20 UTC (rev 648)
+++ branches/experimental/2.0.x/integration/jboss/esb/src/main/java/org/savara/integration/jbossesb/ValidatorFilter.java 2011-02-18 21:06:43 UTC (rev 692)
@@ -1,36 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY 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 along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.savara.validator.jbossesb;
-
-/**
- *
- * @deprecated Use JBossESBInterceptor instead
- */
-public class ValidatorFilter extends JBossESBInterceptor {
-
- /**
- * The default constructor.
- */
- public ValidatorFilter() {
- }
-
-}
Deleted: branches/experimental/2.0.x/integration/jboss/esb/src/main/java/org/savara/validator/jbossesb/ESBUtil.java
===================================================================
--- branches/experimental/2.0.x/integration/jboss/esb/src/main/java/org/savara/validator/jbossesb/ESBUtil.java 2011-02-18 20:17:52 UTC (rev 691)
+++ branches/experimental/2.0.x/integration/jboss/esb/src/main/java/org/savara/validator/jbossesb/ESBUtil.java 2011-02-18 21:06:43 UTC (rev 692)
@@ -1,135 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, 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.
- */
-package org.savara.validator.jbossesb;
-
-import org.apache.log4j.Logger;
-import org.pi4soa.common.util.NamesUtil;
-import org.pi4soa.common.xml.NameSpaceUtil;
-import org.pi4soa.common.xml.XMLUtils;
-
-/**
- * This class provides utility functions for processing
- * ESB messages.
- */
-public class ESBUtil {
-
- public static final String SOAP_ENVELOPE = "http://schemas.xmlsoap.org/soap/envelope/";
-
- /**
- * This method returns the message content associated
- * with the supplied JBoss ESB message.
- *
- * @param message The esb message
- * @return The message content
- */
- public static java.io.Serializable getMessage(
- org.jboss.soa.esb.message.Message message) {
- java.io.Serializable ret=null;
-
- ret = (java.io.Serializable)message.getBody().get();
-
- // Check if should return a multipart message
- if (ret == null) {
-
- // Check if single or multipart message
- if (message.getBody().getNames() != null &&
- message.getBody().getNames().length == 1) {
-
- Object mesg=message.getBody().get(message.getBody().getNames()[0]);
-
- if (logger.isDebugEnabled()) {
- logger.debug("MESSAGE("+
- message.getBody().getNames()[0]+")="+mesg);
- }
-
- if (mesg instanceof java.io.Serializable) {
- ret = (java.io.Serializable)mesg;
- }
-
- } else if (message.getBody().getNames() != null &&
- message.getBody().getNames().length > 1) {
-
- java.util.Hashtable<String,Object> multipart=
- new java.util.Hashtable<String,Object>();
-
- for (int i=0; i < message.getBody().getNames().length; i++) {
- multipart.put(message.getBody().getNames()[i],
- message.getBody().get(message.getBody().getNames()[i]));
- }
-
- ret = multipart;
- }
- }
-
- if (ret instanceof byte[]) {
- ret = new String((byte[])ret);
- }
-
- ret = getBody(ret);
-
- return(ret);
- }
-
- public static java.io.Serializable getBody(java.io.Serializable value) {
- java.io.Serializable ret=null;
-
- if (value instanceof org.w3c.dom.Element &&
- ((org.w3c.dom.Element)value).getLocalName().equals("Envelope") &&
- ((org.w3c.dom.Element)value).getNamespaceURI().equals(
- SOAP_ENVELOPE)) {
-
- org.w3c.dom.NodeList bodylist=((org.w3c.dom.Element)value).
- getElementsByTagNameNS(SOAP_ENVELOPE, "Body");
-
- for (int i=0; ret == null && i < bodylist.getLength(); i++) {
- if (bodylist.item(i) instanceof org.w3c.dom.Element &&
- bodylist.item(i).getLocalName().equals("Body")) {
- org.w3c.dom.NodeList children=((org.w3c.dom.Element)bodylist.item(i)).getChildNodes();
-
- for (int j=0; ret == null && j < children.getLength(); j++) {
- if (children.item(j) instanceof org.w3c.dom.Element) {
- ret = (java.io.Serializable)children.item(j);
- }
- }
- }
- }
- } else if (value instanceof String) {
-
- try {
- org.w3c.dom.Node node=XMLUtils.getNode((String)value);
-
- ret = getBody((java.io.Serializable)node);
-
- // Convert to string
- if (ret instanceof org.w3c.dom.Node) {
- ret = XMLUtils.getText((org.w3c.dom.Node)ret);
- }
-
- } catch(Exception e) {
- logger.warn("Failed to obtain message body from value: "+value);
- }
-
- } else {
- ret = value;
- }
-
- return(ret);
- }
-
- private static Logger logger = Logger.getLogger(ESBUtil.class);
-}
Deleted: branches/experimental/2.0.x/integration/jboss/esb/src/main/java/org/savara/validator/jbossesb/JBossESBInterceptor.java
===================================================================
--- branches/experimental/2.0.x/integration/jboss/esb/src/main/java/org/savara/validator/jbossesb/JBossESBInterceptor.java 2011-02-18 20:17:52 UTC (rev 691)
+++ branches/experimental/2.0.x/integration/jboss/esb/src/main/java/org/savara/validator/jbossesb/JBossESBInterceptor.java 2011-02-18 21:06:43 UTC (rev 692)
@@ -1,206 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, 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.
- */
-package org.savara.validator.jbossesb;
-
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-import org.apache.log4j.Logger;
-
-import org.savara.activity.ActivityProcessor;
-import org.savara.activity.ActivityProcessorFactory;
-import org.savara.activity.model.InteractionActivity;
-import org.savara.activity.model.MessageParameter;
-import org.savara.common.util.MessageUtils;
-import org.jboss.soa.esb.message.*;
-import org.jboss.soa.esb.couriers.*;
-
-/**
- * This class represents the filter used to intercept ESB
- * messages an apply them to relevant Service Validators.
- */
-public class JBossESBInterceptor extends org.jboss.soa.esb.filter.InputOutputFilter {
-
- private static final String TOPIC_PREFIX = "topic/";
- private static final String QUEUE_PREFIX = "queue/";
- private static final String JMS_PROTOCOL_PREFIX = "jms:";
-
- private static final Logger logger = Logger.getLogger(JBossESBInterceptor.class);
-
- /**
- * The default constructor.
- */
- public JBossESBInterceptor() {
- }
-
- /**
- * This method is invoked when a message is sent by an
- * ESB service.
- *
- * @param msg The ESB message
- * @param params The parameters
- * @throws CourierException Failed to validate message
- */
- public Message onOutput(Message msg, java.util.Map params)
- throws CourierException {
-
- String endpoint=getEndpoint(msg);
-
- java.io.Serializable message=ESBUtil.getMessage(msg);
-
- if (endpoint != null && message instanceof String) {
-
- try {
- ActivityProcessor ap=ActivityProcessorFactory.getActivityProcessor();
-
- InteractionActivity ia=new InteractionActivity();
-
- ia.setDestinationAddress(endpoint);
-
- ia.setOutbound(true);
-
- MessageParameter mp=new MessageParameter();
- mp.setType(MessageUtils.getMessageType(message));
- mp.setValue((String)message);
-
- ia.getParameter().add(mp);
-
- String replyTo=getReplyToEndpoint(msg);
-
- if (replyTo != null) {
- ia.setReplyToAddress(replyTo);
- }
-
- ap.process(ia);
-
- } catch(Exception e) {
- logger.error("Failed to report interaction activity", e);
- }
- }
-
- return(msg);
- }
-
- /**
- * This method is invoked when a message is received by an
- * ESB service.
- *
- * @param msg The ESB message
- * @param params The parameters
- * @throws CourierException Failed to validate message
- */
- public Message onInput(Message msg, java.util.Map params)
- throws CourierException {
-
- String endpoint=getEndpoint(msg);
-
- java.io.Serializable message=ESBUtil.getMessage(msg);
-
- if (endpoint != null && message instanceof String) {
-
- try {
- ActivityProcessor ap=ActivityProcessorFactory.getActivityProcessor();
-
- InteractionActivity ia=new InteractionActivity();
-
- ia.setDestinationAddress(endpoint);
-
- ia.setOutbound(false);
-
- MessageParameter mp=new MessageParameter();
- mp.setType(MessageUtils.getMessageType(message));
- mp.setValue((String)message);
-
- ia.getParameter().add(mp);
-
- String replyTo=getReplyToEndpoint(msg);
-
- if (replyTo != null) {
- ia.setReplyToAddress(replyTo);
- }
-
- ap.process(ia);
-
- } catch(Exception e) {
- logger.error("Failed to report interaction activity", e);
- }
- }
-
- return(msg);
- }
-
- /**
- * This method returns an endpoint associated with the 'to'
- * destination of the supplied message.
- *
- * @param msg The message
- * @return The endpoint, or null if not relevant
- */
- protected String getEndpoint(Message msg) {
- String ret=null;
-
- if (msg != null && msg.getHeader() != null &&
- msg.getHeader().getCall() != null &&
- msg.getHeader().getCall().getTo() != null &&
- msg.getHeader().getCall().getTo().getAddr() != null) {
-
- String key=msg.getHeader().getCall().getTo().getAddr().getAddress();
- int ind=-1;
-
- if (key.startsWith(JMS_PROTOCOL_PREFIX) &&
- ((ind=key.indexOf(QUEUE_PREFIX)) != -1 ||
- (ind=key.indexOf(TOPIC_PREFIX)) != -1)) {
- ret = JMS_PROTOCOL_PREFIX+key.substring(ind);
- }
- }
-
- logger.debug("Destination for message '"+msg+"' is: "+ret);
-
- return(ret);
- }
-
- /**
- * This method returns an endpoint associated with the 'to'
- * destination of the supplied message.
- *
- * @param msg The message
- * @return The endpoint, or null if not relevant
- */
- protected String getReplyToEndpoint(Message msg) {
- String ret=null;
-
- if (msg != null && msg.getHeader() != null &&
- msg.getHeader().getCall() != null &&
- msg.getHeader().getCall().getReplyTo() != null &&
- msg.getHeader().getCall().getReplyTo().getAddr() != null) {
-
- String key=msg.getHeader().getCall().getReplyTo().getAddr().getAddress();
- int ind=-1;
-
- if (key.startsWith(JMS_PROTOCOL_PREFIX) &&
- ((ind=key.indexOf(QUEUE_PREFIX)) != -1 ||
- (ind=key.indexOf(TOPIC_PREFIX)) != -1)) {
- ret = JMS_PROTOCOL_PREFIX+key.substring(ind);
- }
- }
-
- logger.debug("Reply-To Destination for message '"+msg+"' is: "+ret);
-
- return(ret);
- }
-}
Modified: branches/experimental/2.0.x/integration/jboss/esb/src/test/java/org/savara/validator/jbossesb/ESBUtilTest.java
===================================================================
--- branches/experimental/2.0.x/integration/jboss/esb/src/test/java/org/savara/validator/jbossesb/ESBUtilTest.java 2011-02-18 20:17:52 UTC (rev 691)
+++ branches/experimental/2.0.x/integration/jboss/esb/src/test/java/org/savara/validator/jbossesb/ESBUtilTest.java 2011-02-18 21:06:43 UTC (rev 692)
@@ -3,6 +3,7 @@
import static org.junit.Assert.*;
import org.pi4soa.common.xml.XMLUtils;
+import org.savara.integration.jbossesb.ESBUtil;
public class ESBUtilTest {
Deleted: branches/experimental/2.0.x/integration/jboss/wsnative/src/main/configs/META-INF/jboss-beans.xml
===================================================================
--- branches/experimental/2.0.x/integration/jboss/wsnative/src/main/configs/META-INF/jboss-beans.xml 2011-02-18 20:17:52 UTC (rev 691)
+++ branches/experimental/2.0.x/integration/jboss/wsnative/src/main/configs/META-INF/jboss-beans.xml 2011-02-18 21:06:43 UTC (rev 692)
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<deployment xmlns="urn:jboss:bean-deployer:2.0">
-
- <bean class="org.savara.validator.jbosswsnative.service.JBossWSNativeServiceValidatorService"
- name="JBossWSNativeServiceValidator">
- <!--
- <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.savara:service=ServiceValidatorManager", exposedInterface=org.savara.validator.service.ServiceValidatorServiceMBean.class,registerDirectly=true)</annotation>
- -->
- <depends>jboss.savara:service=ServiceValidatorManager</depends>
- </bean>
-
-</deployment>
Copied: branches/experimental/2.0.x/integration/jboss/wsnative/src/main/java/org/savara/integration/jbosswsnative/AbstractJBossWSNativeInterceptor.java (from rev 688, branches/experimental/2.0.x/integration/jboss/wsnative/src/main/java/org/savara/validator/jbosswsnative/AbstractJBossWSNativeInterceptor.java)
===================================================================
--- branches/experimental/2.0.x/integration/jboss/wsnative/src/main/java/org/savara/integration/jbosswsnative/AbstractJBossWSNativeInterceptor.java (rev 0)
+++ branches/experimental/2.0.x/integration/jboss/wsnative/src/main/java/org/savara/integration/jbosswsnative/AbstractJBossWSNativeInterceptor.java 2011-02-18 21:06:43 UTC (rev 692)
@@ -0,0 +1,179 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY 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 along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.savara.integration.jbosswsnative;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFault;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.pi4soa.common.util.NamesUtil;
+import org.pi4soa.common.xml.NameSpaceUtil;
+import org.pi4soa.common.xml.XMLUtils;
+import org.savara.common.util.MessageUtils;
+import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
+import org.jboss.ws.metadata.umdm.ParameterMetaData;
+import org.jboss.wsf.common.DOMWriter;
+import org.jboss.wsf.common.handler.GenericSOAPHandler;
+
+/**
+ * Common abstract base class for the client and server JBossWS
+ * native interceptors.
+ *
+ */
+public abstract class AbstractJBossWSNativeInterceptor extends GenericSOAPHandler {
+
+ private static Log logger = LogFactory.getLog(AbstractJBossWSNativeInterceptor.class);
+
+ /**
+ * This method returns the message content.
+ *
+ * @param soapCtx The SOAP message context
+ * @return The message content
+ * @throws Exception Failed to get the message content
+ */
+ public static String getMessage(SOAPMessageContext soapCtx) throws Exception {
+ String ret=null;
+
+ SOAPElement elem = getMessageBody(soapCtx);
+ if (elem != null) {
+ ret = DOMWriter.printNode(elem, true);
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method determines the message type associated with the supplied SOAP
+ * message context.
+ *
+ * @param soapCtx The SOAP message context
+ * @return The message type
+ * @throws SOAPException Failed to determine the message type
+ */
+ public static String getMessageType(SOAPMessageContext soapCtx, boolean request) throws SOAPException {
+ String ret=null;
+
+ if (soapCtx instanceof org.jboss.ws.core.jaxws.handler.MessageContextJAXWS) {
+ org.jboss.ws.core.jaxws.handler.MessageContextJAXWS mc=
+ (org.jboss.ws.core.jaxws.handler.MessageContextJAXWS)soapCtx;
+ org.jboss.ws.metadata.umdm.OperationMetaData opmetadata=mc.getOperationMetaData();
+
+ if (opmetadata != null) {
+ ParameterMetaData pmd=null;
+
+ if (request && opmetadata.getInputParameters().size() == 1) {
+ pmd = opmetadata.getInputParameters().get(0);
+ } else if (!request && opmetadata.getOutputParameters().size() == 1) {
+ pmd = opmetadata.getOutputParameters().get(0);
+ }
+
+ if (pmd != null) {
+ // TODO: Find out why 'genericParam' is generated when the parameter
+ // is a complex type
+ if (pmd.getXmlName().getLocalPart().equals("genericParam")) {
+
+ // Extract message value
+ SOAPElement elem=getMessageBody(soapCtx);
+
+ if (elem != null) {
+ ret = elem.getElementQName().toString();
+ }
+
+ } else {
+ ret = pmd.getXmlName().toString();
+ }
+ }
+ }
+ }
+
+ if (ret == null) {
+ try {
+ ret = MessageUtils.getMessageType(getMessage(soapCtx));
+ logger.debug("Message type (derived from content)="+ret);
+ } catch(Exception e) {
+ logger.error("Failed to get message type from message content", e);
+ }
+ } else {
+ logger.debug("Message type="+ret);
+ }
+
+ return(ret);
+ }
+
+ protected static SOAPElement getMessageBody(SOAPMessageContext soapCtx) throws SOAPException {
+ SOAPElement ret=null;
+
+ // Extract message value
+ SOAPBody soapBody = soapCtx.getMessage().getSOAPPart().getEnvelope().getBody();
+
+ java.util.Iterator<?> iter=soapBody.getChildElements();
+ while (ret == null && iter.hasNext()) {
+ Object body=iter.next();
+
+ if (body instanceof SOAPElement) {
+ ret = (SOAPElement)body;
+ }
+ }
+
+ if (ret instanceof SOAPFault) {
+ SOAPFault fault=(SOAPFault)ret;
+
+ ret = (SOAPElement)fault.getDetail().getChildElements().next();
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method returns the endpoint associated with the supplied SOAP
+ * message context.
+ *
+ * @param soapCtx The SOAP message context
+ * @return The endpoint
+ */
+ public static QName getEndpoint(SOAPMessageContext soapCtx) {
+ QName service=(QName)soapCtx.get(MessageContext.WSDL_SERVICE);
+
+ if (logger.isDebugEnabled()) {
+ logger.debug("Service for endpoint = "+service);
+ }
+
+ if (service == null && soapCtx instanceof SOAPMessageContextJAXWS) {
+ SOAPMessageContextJAXWS smc=(SOAPMessageContextJAXWS)soapCtx;
+
+ if (smc.getEndpointMetaData() != null &&
+ smc.getEndpointMetaData().getServiceMetaData() != null) {
+ service = smc.getEndpointMetaData().getServiceMetaData().getServiceName();
+ }
+ }
+
+ return(service);
+ }
+}
Copied: branches/experimental/2.0.x/integration/jboss/wsnative/src/main/java/org/savara/integration/jbosswsnative/JBossWSNativeClientInterceptor.java (from rev 688, branches/experimental/2.0.x/integration/jboss/wsnative/src/main/java/org/savara/validator/jbosswsnative/JBossWSNativeClientInterceptor.java)
===================================================================
--- branches/experimental/2.0.x/integration/jboss/wsnative/src/main/java/org/savara/integration/jbosswsnative/JBossWSNativeClientInterceptor.java (rev 0)
+++ branches/experimental/2.0.x/integration/jboss/wsnative/src/main/java/org/savara/integration/jbosswsnative/JBossWSNativeClientInterceptor.java 2011-02-18 21:06:43 UTC (rev 692)
@@ -0,0 +1,113 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, 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.
+ */
+package org.savara.integration.jbosswsnative;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.savara.activity.ActivityProcessor;
+import org.savara.activity.ActivityProcessorFactory;
+import org.savara.activity.model.ExchangeType;
+import org.savara.activity.model.InteractionActivity;
+import org.savara.activity.model.MessageParameter;
+
+public class JBossWSNativeClientInterceptor extends AbstractJBossWSNativeInterceptor {
+
+ private static Log logger = LogFactory.getLog(JBossWSNativeClientInterceptor.class);
+
+ public JBossWSNativeClientInterceptor() {
+ if (logger.isDebugEnabled()) {
+ logger.debug("JBossWSNativeClientInterceptor created");
+ }
+ }
+
+ protected boolean handleInbound(MessageContext ctx) {
+ boolean ret=true;
+ SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
+
+ QName endpoint=getEndpoint(soapCtx);
+
+ if (endpoint != null) {
+
+ try {
+ ActivityProcessor ap=ActivityProcessorFactory.getActivityProcessor();
+
+ InteractionActivity ia=new InteractionActivity();
+
+ ia.setDestinationType(endpoint.toString());
+
+ ia.setExchangeType(ExchangeType.RESPONSE);
+ ia.setOutbound(false);
+
+ MessageParameter mp=new MessageParameter();
+ mp.setType(getMessageType(soapCtx, false));
+ mp.setValue(getMessage(soapCtx));
+
+ ia.getParameter().add(mp);
+
+ ap.process(ia);
+
+ } catch(Exception e) {
+ logger.error("Failed to report interaction activity", e);
+ }
+ }
+
+ return(ret);
+ }
+
+ protected boolean handleOutbound(MessageContext ctx) {
+ boolean ret=true;
+ SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
+
+ QName endpoint=getEndpoint(soapCtx);
+
+ if (endpoint != null) {
+
+ try {
+ ActivityProcessor ap=ActivityProcessorFactory.getActivityProcessor();
+
+ InteractionActivity ia=new InteractionActivity();
+
+ ia.setDestinationType(endpoint.toString());
+
+ ia.setExchangeType(ExchangeType.REQUEST);
+ ia.setOutbound(true);
+
+ MessageParameter mp=new MessageParameter();
+ mp.setType(getMessageType(soapCtx, true));
+ mp.setValue(getMessage(soapCtx));
+
+ ia.getParameter().add(mp);
+
+ ap.process(ia);
+
+ } catch(Exception e) {
+ logger.error("Failed to report interaction activity", e);
+ }
+ }
+
+ return(ret);
+ }
+
+ public boolean handleFault(MessageContext ctx) {
+ return handleOutbound(ctx);
+ }
+}
Copied: branches/experimental/2.0.x/integration/jboss/wsnative/src/main/java/org/savara/integration/jbosswsnative/JBossWSNativeServerInterceptor.java (from rev 688, branches/experimental/2.0.x/integration/jboss/wsnative/src/main/java/org/savara/validator/jbosswsnative/JBossWSNativeServerInterceptor.java)
===================================================================
--- branches/experimental/2.0.x/integration/jboss/wsnative/src/main/java/org/savara/integration/jbosswsnative/JBossWSNativeServerInterceptor.java (rev 0)
+++ branches/experimental/2.0.x/integration/jboss/wsnative/src/main/java/org/savara/integration/jbosswsnative/JBossWSNativeServerInterceptor.java 2011-02-18 21:06:43 UTC (rev 692)
@@ -0,0 +1,113 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, 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.
+ */
+package org.savara.integration.jbosswsnative;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.savara.activity.ActivityProcessor;
+import org.savara.activity.ActivityProcessorFactory;
+import org.savara.activity.model.ExchangeType;
+import org.savara.activity.model.InteractionActivity;
+import org.savara.activity.model.MessageParameter;
+
+public class JBossWSNativeServerInterceptor extends AbstractJBossWSNativeInterceptor {
+
+ private static Log logger = LogFactory.getLog(JBossWSNativeServerInterceptor.class);
+
+ public JBossWSNativeServerInterceptor() {
+ if (logger.isDebugEnabled()) {
+ logger.debug("JBossWSNativeServerInterceptor created");
+ }
+ }
+
+ protected boolean handleInbound(MessageContext ctx) {
+ boolean ret=true;
+ SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
+
+ QName endpoint=getEndpoint(soapCtx);
+
+ if (endpoint != null) {
+
+ try {
+ ActivityProcessor ap=ActivityProcessorFactory.getActivityProcessor();
+
+ InteractionActivity ia=new InteractionActivity();
+
+ ia.setDestinationType(endpoint.toString());
+
+ ia.setExchangeType(ExchangeType.REQUEST);
+ ia.setOutbound(false);
+
+ MessageParameter mp=new MessageParameter();
+ mp.setType(getMessageType(soapCtx, true));
+ mp.setValue(getMessage(soapCtx));
+
+ ia.getParameter().add(mp);
+
+ ap.process(ia);
+
+ } catch(Exception e) {
+ logger.error("Failed to report interaction activity", e);
+ }
+ }
+
+ return(ret);
+ }
+
+ protected boolean handleOutbound(MessageContext ctx) {
+ boolean ret=true;
+ SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
+
+ QName endpoint=getEndpoint(soapCtx);
+
+ if (endpoint != null) {
+
+ try {
+ ActivityProcessor ap=ActivityProcessorFactory.getActivityProcessor();
+
+ InteractionActivity ia=new InteractionActivity();
+
+ ia.setDestinationType(endpoint.toString());
+
+ ia.setExchangeType(ExchangeType.RESPONSE);
+ ia.setOutbound(true);
+
+ MessageParameter mp=new MessageParameter();
+ mp.setType(getMessageType(soapCtx, false));
+ mp.setValue(getMessage(soapCtx));
+
+ ia.getParameter().add(mp);
+
+ ap.process(ia);
+
+ } catch(Exception e) {
+ logger.error("Failed to report interaction activity", e);
+ }
+ }
+
+ return(ret);
+ }
+
+ public boolean handleFault(MessageContext ctx) {
+ return handleOutbound(ctx);
+ }
+}
Deleted: branches/experimental/2.0.x/integration/jboss/wsnative/src/main/java/org/savara/validator/jbosswsnative/AbstractJBossWSNativeInterceptor.java
===================================================================
--- branches/experimental/2.0.x/integration/jboss/wsnative/src/main/java/org/savara/validator/jbosswsnative/AbstractJBossWSNativeInterceptor.java 2011-02-18 20:17:52 UTC (rev 691)
+++ branches/experimental/2.0.x/integration/jboss/wsnative/src/main/java/org/savara/validator/jbosswsnative/AbstractJBossWSNativeInterceptor.java 2011-02-18 21:06:43 UTC (rev 692)
@@ -1,179 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY 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 along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.savara.validator.jbosswsnative;
-
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.xml.namespace.QName;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPElement;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPFault;
-import javax.xml.ws.handler.MessageContext;
-import javax.xml.ws.handler.soap.SOAPMessageContext;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.pi4soa.common.util.NamesUtil;
-import org.pi4soa.common.xml.NameSpaceUtil;
-import org.pi4soa.common.xml.XMLUtils;
-import org.savara.common.util.MessageUtils;
-import org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS;
-import org.jboss.ws.metadata.umdm.ParameterMetaData;
-import org.jboss.wsf.common.DOMWriter;
-import org.jboss.wsf.common.handler.GenericSOAPHandler;
-
-/**
- * Common abstract base class for the client and server JBossWS
- * native interceptors.
- *
- */
-public abstract class AbstractJBossWSNativeInterceptor extends GenericSOAPHandler {
-
- private static Log logger = LogFactory.getLog(AbstractJBossWSNativeInterceptor.class);
-
- /**
- * This method returns the message content.
- *
- * @param soapCtx The SOAP message context
- * @return The message content
- * @throws Exception Failed to get the message content
- */
- public static String getMessage(SOAPMessageContext soapCtx) throws Exception {
- String ret=null;
-
- SOAPElement elem = getMessageBody(soapCtx);
- if (elem != null) {
- ret = DOMWriter.printNode(elem, true);
- }
-
- return(ret);
- }
-
- /**
- * This method determines the message type associated with the supplied SOAP
- * message context.
- *
- * @param soapCtx The SOAP message context
- * @return The message type
- * @throws SOAPException Failed to determine the message type
- */
- public static String getMessageType(SOAPMessageContext soapCtx, boolean request) throws SOAPException {
- String ret=null;
-
- if (soapCtx instanceof org.jboss.ws.core.jaxws.handler.MessageContextJAXWS) {
- org.jboss.ws.core.jaxws.handler.MessageContextJAXWS mc=
- (org.jboss.ws.core.jaxws.handler.MessageContextJAXWS)soapCtx;
- org.jboss.ws.metadata.umdm.OperationMetaData opmetadata=mc.getOperationMetaData();
-
- if (opmetadata != null) {
- ParameterMetaData pmd=null;
-
- if (request && opmetadata.getInputParameters().size() == 1) {
- pmd = opmetadata.getInputParameters().get(0);
- } else if (!request && opmetadata.getOutputParameters().size() == 1) {
- pmd = opmetadata.getOutputParameters().get(0);
- }
-
- if (pmd != null) {
- // TODO: Find out why 'genericParam' is generated when the parameter
- // is a complex type
- if (pmd.getXmlName().getLocalPart().equals("genericParam")) {
-
- // Extract message value
- SOAPElement elem=getMessageBody(soapCtx);
-
- if (elem != null) {
- ret = elem.getElementQName().toString();
- }
-
- } else {
- ret = pmd.getXmlName().toString();
- }
- }
- }
- }
-
- if (ret == null) {
- try {
- ret = MessageUtils.getMessageType(getMessage(soapCtx));
- logger.debug("Message type (derived from content)="+ret);
- } catch(Exception e) {
- logger.error("Failed to get message type from message content", e);
- }
- } else {
- logger.debug("Message type="+ret);
- }
-
- return(ret);
- }
-
- protected static SOAPElement getMessageBody(SOAPMessageContext soapCtx) throws SOAPException {
- SOAPElement ret=null;
-
- // Extract message value
- SOAPBody soapBody = soapCtx.getMessage().getSOAPPart().getEnvelope().getBody();
-
- java.util.Iterator<?> iter=soapBody.getChildElements();
- while (ret == null && iter.hasNext()) {
- Object body=iter.next();
-
- if (body instanceof SOAPElement) {
- ret = (SOAPElement)body;
- }
- }
-
- if (ret instanceof SOAPFault) {
- SOAPFault fault=(SOAPFault)ret;
-
- ret = (SOAPElement)fault.getDetail().getChildElements().next();
- }
-
- return(ret);
- }
-
- /**
- * This method returns the endpoint associated with the supplied SOAP
- * message context.
- *
- * @param soapCtx The SOAP message context
- * @return The endpoint
- */
- public static QName getEndpoint(SOAPMessageContext soapCtx) {
- QName service=(QName)soapCtx.get(MessageContext.WSDL_SERVICE);
-
- if (logger.isDebugEnabled()) {
- logger.debug("Service for endpoint = "+service);
- }
-
- if (service == null && soapCtx instanceof SOAPMessageContextJAXWS) {
- SOAPMessageContextJAXWS smc=(SOAPMessageContextJAXWS)soapCtx;
-
- if (smc.getEndpointMetaData() != null &&
- smc.getEndpointMetaData().getServiceMetaData() != null) {
- service = smc.getEndpointMetaData().getServiceMetaData().getServiceName();
- }
- }
-
- return(service);
- }
-}
Deleted: branches/experimental/2.0.x/integration/jboss/wsnative/src/main/java/org/savara/validator/jbosswsnative/JBossWSNativeClientInterceptor.java
===================================================================
--- branches/experimental/2.0.x/integration/jboss/wsnative/src/main/java/org/savara/validator/jbosswsnative/JBossWSNativeClientInterceptor.java 2011-02-18 20:17:52 UTC (rev 691)
+++ branches/experimental/2.0.x/integration/jboss/wsnative/src/main/java/org/savara/validator/jbosswsnative/JBossWSNativeClientInterceptor.java 2011-02-18 21:06:43 UTC (rev 692)
@@ -1,113 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat Middleware LLC, 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.
- */
-package org.savara.validator.jbosswsnative;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.handler.MessageContext;
-import javax.xml.ws.handler.soap.SOAPMessageContext;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.savara.activity.ActivityProcessor;
-import org.savara.activity.ActivityProcessorFactory;
-import org.savara.activity.model.ExchangeType;
-import org.savara.activity.model.InteractionActivity;
-import org.savara.activity.model.MessageParameter;
-
-public class JBossWSNativeClientInterceptor extends AbstractJBossWSNativeInterceptor {
-
- private static Log logger = LogFactory.getLog(JBossWSNativeClientInterceptor.class);
-
- public JBossWSNativeClientInterceptor() {
- if (logger.isDebugEnabled()) {
- logger.debug("JBossWSNativeClientInterceptor created");
- }
- }
-
- protected boolean handleInbound(MessageContext ctx) {
- boolean ret=true;
- SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
-
- QName endpoint=getEndpoint(soapCtx);
-
- if (endpoint != null) {
-
- try {
- ActivityProcessor ap=ActivityProcessorFactory.getActivityProcessor();
-
- InteractionActivity ia=new InteractionActivity();
-
- ia.setDestinationType(endpoint.toString());
-
- ia.setExchangeType(ExchangeType.RESPONSE);
- ia.setOutbound(false);
-
- MessageParameter mp=new MessageParameter();
- mp.setType(getMessageType(soapCtx, false));
- mp.setValue(getMessage(soapCtx));
-
- ia.getParameter().add(mp);
-
- ap.process(ia);
-
- } catch(Exception e) {
- logger.error("Failed to report interaction activity", e);
- }
- }
-
- return(ret);
- }
-
- protected boolean handleOutbound(MessageContext ctx) {
- boolean ret=true;
- SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
-
- QName endpoint=getEndpoint(soapCtx);
-
- if (endpoint != null) {
-
- try {
- ActivityProcessor ap=ActivityProcessorFactory.getActivityProcessor();
-
- InteractionActivity ia=new InteractionActivity();
-
- ia.setDestinationType(endpoint.toString());
-
- ia.setExchangeType(ExchangeType.REQUEST);
- ia.setOutbound(true);
-
- MessageParameter mp=new MessageParameter();
- mp.setType(getMessageType(soapCtx, true));
- mp.setValue(getMessage(soapCtx));
-
- ia.getParameter().add(mp);
-
- ap.process(ia);
-
- } catch(Exception e) {
- logger.error("Failed to report interaction activity", e);
- }
- }
-
- return(ret);
- }
-
- public boolean handleFault(MessageContext ctx) {
- return handleOutbound(ctx);
- }
-}
Deleted: branches/experimental/2.0.x/integration/jboss/wsnative/src/main/java/org/savara/validator/jbosswsnative/JBossWSNativeServerInterceptor.java
===================================================================
--- branches/experimental/2.0.x/integration/jboss/wsnative/src/main/java/org/savara/validator/jbosswsnative/JBossWSNativeServerInterceptor.java 2011-02-18 20:17:52 UTC (rev 691)
+++ branches/experimental/2.0.x/integration/jboss/wsnative/src/main/java/org/savara/validator/jbosswsnative/JBossWSNativeServerInterceptor.java 2011-02-18 21:06:43 UTC (rev 692)
@@ -1,113 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat Middleware LLC, 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.
- */
-package org.savara.validator.jbosswsnative;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.handler.MessageContext;
-import javax.xml.ws.handler.soap.SOAPMessageContext;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.savara.activity.ActivityProcessor;
-import org.savara.activity.ActivityProcessorFactory;
-import org.savara.activity.model.ExchangeType;
-import org.savara.activity.model.InteractionActivity;
-import org.savara.activity.model.MessageParameter;
-
-public class JBossWSNativeServerInterceptor extends AbstractJBossWSNativeInterceptor {
-
- private static Log logger = LogFactory.getLog(JBossWSNativeServerInterceptor.class);
-
- public JBossWSNativeServerInterceptor() {
- if (logger.isDebugEnabled()) {
- logger.debug("JBossWSNativeServerInterceptor created");
- }
- }
-
- protected boolean handleInbound(MessageContext ctx) {
- boolean ret=true;
- SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
-
- QName endpoint=getEndpoint(soapCtx);
-
- if (endpoint != null) {
-
- try {
- ActivityProcessor ap=ActivityProcessorFactory.getActivityProcessor();
-
- InteractionActivity ia=new InteractionActivity();
-
- ia.setDestinationType(endpoint.toString());
-
- ia.setExchangeType(ExchangeType.REQUEST);
- ia.setOutbound(false);
-
- MessageParameter mp=new MessageParameter();
- mp.setType(getMessageType(soapCtx, true));
- mp.setValue(getMessage(soapCtx));
-
- ia.getParameter().add(mp);
-
- ap.process(ia);
-
- } catch(Exception e) {
- logger.error("Failed to report interaction activity", e);
- }
- }
-
- return(ret);
- }
-
- protected boolean handleOutbound(MessageContext ctx) {
- boolean ret=true;
- SOAPMessageContext soapCtx = (SOAPMessageContext)ctx;
-
- QName endpoint=getEndpoint(soapCtx);
-
- if (endpoint != null) {
-
- try {
- ActivityProcessor ap=ActivityProcessorFactory.getActivityProcessor();
-
- InteractionActivity ia=new InteractionActivity();
-
- ia.setDestinationType(endpoint.toString());
-
- ia.setExchangeType(ExchangeType.RESPONSE);
- ia.setOutbound(true);
-
- MessageParameter mp=new MessageParameter();
- mp.setType(getMessageType(soapCtx, false));
- mp.setValue(getMessage(soapCtx));
-
- ia.getParameter().add(mp);
-
- ap.process(ia);
-
- } catch(Exception e) {
- logger.error("Failed to report interaction activity", e);
- }
- }
-
- return(ret);
- }
-
- public boolean handleFault(MessageContext ctx) {
- return handleOutbound(ctx);
- }
-}
More information about the savara-commits
mailing list