[jboss-svn-commits] JBL Code SVN: r23173 - in labs/jbossesb/workspace/skeagh/runtime/src: main/resources/META-INF/jbossesb/xsd and 1 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Mon Sep 29 06:37:22 EDT 2008
Author: tfennelly
Date: 2008-09-29 06:37:21 -0400 (Mon, 29 Sep 2008)
New Revision: 23173
Added:
labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/ServiceMEP.java
Modified:
labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/ServiceConfig.java
labs/jbossesb/workspace/skeagh/runtime/src/main/resources/META-INF/jbossesb/xsd/jbossesb-5.0.xsd
labs/jbossesb/workspace/skeagh/runtime/src/main/resources/META-INF/jbossesb/xsd/services-smooks.xml
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/DefaultConfigurationDigesterTest.java
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-services_01.xml
Log:
Added ServiceMEP tests
Modified: labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/ServiceConfig.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/ServiceConfig.java 2008-09-29 10:15:25 UTC (rev 23172)
+++ labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/ServiceConfig.java 2008-09-29 10:37:21 UTC (rev 23173)
@@ -41,6 +41,10 @@
* Service Instance.
*/
private Service service;
+ /**
+ * Service Message Exchange Pattern.
+ */
+ private ServiceMEP messageExchangePattern = ServiceMEP.InOnly;
/**
* Get the Service Name.
@@ -101,4 +105,22 @@
{
this.service = service;
}
+
+ /**
+ * Get the configured Message Exchange Pattern.
+ * @return The configured Message Exchange Pattern.
+ */
+ public final ServiceMEP getMessageExchangePattern()
+ {
+ return messageExchangePattern;
+ }
+
+ /**
+ * Set the configured Message Exchange Pattern.
+ * @param messageExchangePattern The configured Message Exchange Pattern.
+ */
+ public final void setMessageExchangePattern(final ServiceMEP messageExchangePattern)
+ {
+ this.messageExchangePattern = messageExchangePattern;
+ }
}
Added: labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/ServiceMEP.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/ServiceMEP.java (rev 0)
+++ labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/ServiceMEP.java 2008-09-29 10:37:21 UTC (rev 23173)
@@ -0,0 +1,45 @@
+/*
+ * 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.
+ *
+ * (C) 2005-2008, JBoss Inc.
+ */
+package org.jboss.esb.deploy.config;
+
+/**
+ * Service Message Exchange Pattern (MEP) enumeration.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public enum ServiceMEP
+{
+ /**
+ * Service only accepts messages. Doesn't support 'replyTo'.
+ */
+ InOnly,
+ /**
+ * Service only sends messages. Doesn't support invocation.
+ * <p/>
+ * An example of such a service might be a scheduled Service that
+ * periodically queries a DB, from which it generates a message
+ * and sends it to another Service or {@link org.jboss.esb.routing.OutboundRouter}.
+ */
+ OutOnly,
+ /**
+ * Service accepts messages. Supports 'replyTo'.
+ */
+ InOut;
+}
\ No newline at end of file
Property changes on: labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/ServiceMEP.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: labs/jbossesb/workspace/skeagh/runtime/src/main/resources/META-INF/jbossesb/xsd/jbossesb-5.0.xsd
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/main/resources/META-INF/jbossesb/xsd/jbossesb-5.0.xsd 2008-09-29 10:15:25 UTC (rev 23172)
+++ labs/jbossesb/workspace/skeagh/runtime/src/main/resources/META-INF/jbossesb/xsd/jbossesb-5.0.xsd 2008-09-29 10:37:21 UTC (rev 23173)
@@ -92,8 +92,17 @@
<xs:attribute name="serviceName" use="required" type="xs:string"/>
<xs:attribute name="serviceDescription" use="required" type="xs:string"/>
<xs:attribute name="class" use="required" type="xs:string"/>
+ <xs:attribute name="mep" type="mepType" default="In-Only" />
</xs:complexType>
+ <xs:simpleType name="mepType">
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="In-Only" />
+ <xs:enumeration value="Out-Only" />
+ <xs:enumeration value="In-Out" />
+ </xs:restriction>
+ </xs:simpleType>
+
<xs:complexType name="property">
<xs:annotation>
<xs:documentation xml:lang="en">Property</xs:documentation>
Modified: labs/jbossesb/workspace/skeagh/runtime/src/main/resources/META-INF/jbossesb/xsd/services-smooks.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/main/resources/META-INF/jbossesb/xsd/services-smooks.xml 2008-09-29 10:15:25 UTC (rev 23172)
+++ labs/jbossesb/workspace/skeagh/runtime/src/main/resources/META-INF/jbossesb/xsd/services-smooks.xml 2008-09-29 10:37:21 UTC (rev 23173)
@@ -18,6 +18,12 @@
<jb:bindings beanId="serviceConfig" class="org.jboss.esb.deploy.config.ServiceConfig" createOnElement="service">
<jb:wiring property="serviceName" beanIdRef="serviceName" />
<jb:value property="description" data="service/@serviceDescription" />
+ <jb:value property="messageExchangePattern" data="service/@mep" decoder="Enum" default="In-Only">
+ <jb:decodeParam name="enumType">org.jboss.esb.deploy.config.ServiceMEP</jb:decodeParam>
+ <jb:decodeParam name="In-Only">InOnly</jb:decodeParam>
+ <jb:decodeParam name="Out-Only">OutOnly</jb:decodeParam>
+ <jb:decodeParam name="In-Out">InOut</jb:decodeParam>
+ </jb:value>
<jb:wiring property="service" beanIdRef="serviceInstance" />
</jb:bindings>
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/DefaultConfigurationDigesterTest.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/DefaultConfigurationDigesterTest.java 2008-09-29 10:15:25 UTC (rev 23172)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/DefaultConfigurationDigesterTest.java 2008-09-29 10:37:21 UTC (rev 23173)
@@ -220,6 +220,7 @@
MyTestService serviceA = (MyTestService) serviceAConfig.getService();
assertNotNull(serviceA);
assertEquals("propValueA", serviceA.getProp1());
+ assertEquals(ServiceMEP.InOnly, serviceAConfig.getMessageExchangePattern());
ServiceConfig serviceBConfig = services.get(new ServiceName("service-cat", "service-b"));
assertNotNull(serviceBConfig);
@@ -227,6 +228,11 @@
MyTestService serviceB = (MyTestService) serviceBConfig.getService();
assertNotNull(serviceB);
assertEquals("propValueB", serviceB.getProp1());
+ assertEquals(ServiceMEP.InOut, serviceBConfig.getMessageExchangePattern());
+
+ ServiceConfig serviceCConfig = services.get(new ServiceName("service-cat", "service-c"));
+ assertNotNull(serviceCConfig);
+ assertEquals(ServiceMEP.OutOnly, serviceCConfig.getMessageExchangePattern());
}
@Test
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-services_01.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-services_01.xml 2008-09-29 10:15:25 UTC (rev 23172)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-services_01.xml 2008-09-29 10:37:21 UTC (rev 23173)
@@ -3,8 +3,9 @@
<service serviceCategory="service-cat" serviceName="service-a" serviceDescription="A Service" class="org.jboss.esb.deploy.config.MyTestService">
<property name="prop1">propValueA</property>
</service>
- <service serviceCategory="service-cat" serviceName="service-b" serviceDescription="B Service" class="org.jboss.esb.deploy.config.MyTestService">
+ <service serviceCategory="service-cat" serviceName="service-b" serviceDescription="B Service" class="org.jboss.esb.deploy.config.MyTestService" mep="In-Out">
<property name="prop1">propValueB</property>
</service>
+ <service serviceCategory="service-cat" serviceName="service-c" serviceDescription="C Service" class="org.jboss.esb.deploy.config.MyTestService" mep="Out-Only" />
</services>
</jbossesb>
\ No newline at end of file
More information about the jboss-svn-commits
mailing list