[jboss-svn-commits] JBL Code SVN: r23349 - in labs/jbossesb/workspace/skeagh: api/service/src/main/java/org/jboss/esb/annotations and 30 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Oct 7 10:16:03 EDT 2008
Author: tfennelly
Date: 2008-10-07 10:16:03 -0400 (Tue, 07 Oct 2008)
New Revision: 23349
Added:
labs/jbossesb/workspace/skeagh/api/routing/src/main/java/org/jboss/esb/routing/FilterEvaluator.java
labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/InboundRouterFilterConfig.java
labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/digest/FilterDecisionTreeBuilder.java
labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/dispatch/DispatchChain.java
labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/dispatch/FilteredDispatchChain.java
labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/filter/
labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/filter/FilterDecisionNode.java
labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/filter/package.html
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/FilterConfigTest.java
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/digest/ConfigUtilTest.java
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-inrouters_filters_01.xml
Modified:
labs/jbossesb/workspace/skeagh/api/service/src/main/java/org/jboss/esb/annotations/Property.java
labs/jbossesb/workspace/skeagh/routing/jms/src/test/java/org/jboss/esb/jms/jms-inbound-router_01.xml
labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/DeploymentRuntime.java
labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/DeploymentUtil.java
labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/ConfigUtil.java
labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/DeploymentUnit.java
labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/InboundRouterConfig.java
labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/digest/CreateObject.java
labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/digest/DefaultConfigurationDigester.java
labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/digest/SetProperty.java
labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/dispatch/AbstractDispatcher.java
labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/dispatch/LocalDispatcher.java
labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/federate/bus/BusDispatcher.java
labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/test/JBossESBTestCase.java
labs/jbossesb/workspace/skeagh/runtime/src/main/resources/META-INF/jbossesb/xsd/inrouters-smooks.xml
labs/jbossesb/workspace/skeagh/runtime/src/main/resources/META-INF/jbossesb/xsd/jbossesb-5.0.xsd
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/digest/SetPropertyTest.java
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-02.xml
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-03.xml
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-inandoutrouters_01.xml
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-inrouters_01.xml
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-inrouters_02.xml
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-services_06.xml
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-services_07.xml
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/lifecycle/01-inrouter-config.xml
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/lifecycle/UndeployDispatcherDelayTest.java
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/lifecycle/jbossesb-deploy-01.xml
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/dispatch/LocalDispatcherTest.java
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/dispatch/RestStringTransformer.java
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/dispatch/jbossesb-dispatch-no-service.xml
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/dispatch/jbossesb-dispatch-with-intransform.xml
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/dispatch/jbossesb-dispatch-with-outtransform.xml
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/dispatch/jbossesb-dispatch-with-service.xml
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/federate/deployment-01.xml
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/federate/deployment-02.xml
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/federate/deployment-03.xml
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_001/01-inrouter-config.xml
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_001/RoutingTest.java
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_002/01-inrouter-config.xml
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_002/RoutingTest.java
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_003/01-inrouter-config.xml
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_003/RoutingTest.java
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_004/01-inrouter-config.xml
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_004/RoutingTest.java
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_005/01-inrouter-config.xml
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_005/RoutingTest.java
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_006/RoutingTest.java
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_007/RoutingTest.java
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_008/01-deployment.xml
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_008/RoutingTest.java
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_009/01-deployment.xml
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_009/RoutingTest.java
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_010/01-deployment.xml
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_010/RoutingTest.java
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_011/01-deployment.xml
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_011/RoutingTest.java
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_012/RoutingTest.java
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_013/RoutingTest.java
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_014/RoutingTest.java
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/schedule/schedule-listener-01.xml
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/schedule/schedule-listener-02.xml
labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/schedule/schedule-listener-03.xml
Log:
Filtering for inbound routers
Added: labs/jbossesb/workspace/skeagh/api/routing/src/main/java/org/jboss/esb/routing/FilterEvaluator.java
===================================================================
--- labs/jbossesb/workspace/skeagh/api/routing/src/main/java/org/jboss/esb/routing/FilterEvaluator.java (rev 0)
+++ labs/jbossesb/workspace/skeagh/api/routing/src/main/java/org/jboss/esb/routing/FilterEvaluator.java 2008-10-07 14:16:03 UTC (rev 23349)
@@ -0,0 +1,40 @@
+/*
+ * 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.routing;
+
+import org.jboss.esb.message.Message;
+
+/**
+ * Routing filter evaluator.
+ * <p/>
+ * Filters can be applied to inbound and outbound routers.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public interface FilterEvaluator
+{
+ /**
+ * Filter the message.
+ *
+ * @param message The message to be evaluated.
+ * @return True if the message is to be filtered through. False if the message is to be filtered out.
+ */
+ boolean filterMessage(Message message);
+}
Property changes on: labs/jbossesb/workspace/skeagh/api/routing/src/main/java/org/jboss/esb/routing/FilterEvaluator.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: labs/jbossesb/workspace/skeagh/api/service/src/main/java/org/jboss/esb/annotations/Property.java
===================================================================
--- labs/jbossesb/workspace/skeagh/api/service/src/main/java/org/jboss/esb/annotations/Property.java 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/api/service/src/main/java/org/jboss/esb/annotations/Property.java 2008-10-07 14:16:03 UTC (rev 23349)
@@ -29,7 +29,7 @@
/**
* Configuration paramater field annotation.
* <p/>
- *
+ * <p/>
* <h3>Usage</h3>
* Where the paramater name is the same as the field name:
* <pre>{@code
@@ -62,8 +62,7 @@
Use use() default Use.REQUIRED;
/**
- * The default paramater value. <p/> Only relevant when use=OPTIONAL and the
- * paramater is not defined on the configuration..
+ * The default paramater value.
*/
String defaultVal() default AnnotationConstants.UNASSIGNED;
@@ -87,4 +86,32 @@
*/
OPTIONAL,
}
+
+ /**
+ * Property annotation assertions.
+ */
+ public final class Assert
+ {
+ /**
+ * Private constructor.
+ */
+ private Assert()
+ {
+ }
+
+ /**
+ * Is the default value set on the annotation.
+ *
+ * @param annotation The annotation.
+ * @return True if the defaultVal is assigned a value, otherwise false.
+ */
+ public static boolean isDefaultAssigned(final Property annotation)
+ {
+ if (AnnotationConstants.UNASSIGNED.equals(annotation.defaultVal()))
+ {
+ return false;
+ }
+ return true;
+ }
+ }
}
Modified: labs/jbossesb/workspace/skeagh/routing/jms/src/test/java/org/jboss/esb/jms/jms-inbound-router_01.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/routing/jms/src/test/java/org/jboss/esb/jms/jms-inbound-router_01.xml 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/routing/jms/src/test/java/org/jboss/esb/jms/jms-inbound-router_01.xml 2008-10-07 14:16:03 UTC (rev 23349)
@@ -1,19 +1,14 @@
<jbossesb xmlns="http://www.jboss.org/jbossesb/xsd/jbossesb-5.0.xsd">
- <routing>
- <inRouters serviceCategory="service-cat" serviceName="service-a">
+ <services>
+ <service serviceCategory="service-cat" serviceName="service-a" serviceDescription="TestService" class="org.jboss.esb.jms.MyTestService">
<inRouter name="inrouter1" class="org.jboss.esb.jms.JmsInboundRouter">
<property name="java.naming.provider.url">tcp://localhost:61717</property>
<property name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</property>
<property name="jmsDestination">jbossesb.TestQueue</property>
<property name="queue.jbossesb.TestQueue">jbossesb.TestQueue</property>
</inRouter>
- </inRouters>
- </routing>
-
- <services>
- <service serviceCategory="service-cat" serviceName="service-a" serviceDescription="TestService" class="org.jboss.esb.jms.MyTestService"/>
+ </service>
</services>
-
</jbossesb>
\ No newline at end of file
Modified: labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/DeploymentRuntime.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/DeploymentRuntime.java 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/DeploymentRuntime.java 2008-10-07 14:16:03 UTC (rev 23349)
@@ -27,10 +27,13 @@
import org.jboss.esb.deploy.config.ConfigUtil;
import org.jboss.esb.deploy.config.DeploymentUnit;
import org.jboss.esb.deploy.config.InboundRouterConfig;
+import org.jboss.esb.deploy.config.InboundRouterFilterConfig;
import org.jboss.esb.deploy.config.OutboundRouterConfig;
import org.jboss.esb.deploy.config.PropertiesUtil;
import org.jboss.esb.deploy.config.ServiceConfig;
import org.jboss.esb.deploy.config.digest.DefaultConfigurationDigester;
+import org.jboss.esb.dispatch.DispatchChain;
+import org.jboss.esb.dispatch.FilteredDispatchChain;
import org.jboss.esb.dispatch.LocalDispatcher;
import org.jboss.esb.federate.DeploymentCoordinator;
import org.jboss.esb.federate.bus.BusDispatcher;
@@ -101,11 +104,14 @@
*/
private DeploymentUnit aggregatedDeploymentUnit = new DeploymentUnit();
/**
+ * Dispatch chains hosted through this deployment.
+ */
+ private Map<ServiceName, DispatchChain> dispatchChainMap = new LinkedHashMap<ServiceName, DispatchChain>();
+ /**
* Deployed Objects Map.
*/
private Map<Object, Object> deployedObjects = new LinkedHashMap<Object, Object>()
{
- @Override
public Object put(final Object key, final Object value)
{
if (containsKey(key))
@@ -257,6 +263,7 @@
deployResources();
deployOutboundRouters();
deployServices();
+ assembleDispatchChainMap();
deployInboundRouters();
deployDeploymentCoordinator();
}
@@ -318,16 +325,13 @@
private void undeployInboundRouters()
{
List<MessageDispatcher> activeDispatchers = new ArrayList<MessageDispatcher>();
- Collection<List<InboundRouterConfig>> inRouterConfigsMatrix = aggregatedDeploymentUnit.getInboundRouters().values();
+ Collection<InboundRouterConfig> inRouterConfigs = aggregatedDeploymentUnit.getInboundRouters().values();
// Undeploy all the "non bus" inbound routers...
- for (List<InboundRouterConfig> inRouterConfigs : inRouterConfigsMatrix)
+ for (InboundRouterConfig inRouterConfig : inRouterConfigs)
{
- for (InboundRouterConfig inRouterConfig : inRouterConfigs)
- {
- undeploy(inRouterConfig.getName(), inRouterConfig.getRouter());
- activeDispatchers.add(inRouterConfig.getDispatcher());
- }
+ undeploy(inRouterConfig.getName(), inRouterConfig.getRouter());
+ activeDispatchers.add(inRouterConfig.getDispatcher());
}
// Stop listening for messages on all connected buses...
@@ -388,7 +392,7 @@
* Dead Letter service.
*
* @throws DeploymentException Error processing one of the pre-installed
- * deployment units.
+ * deployment units.
*/
private void addPreinstalledDeploymentUnits() throws DeploymentException
{
@@ -396,9 +400,8 @@
{
new PropertiesIterator(deploymentProperties)
{
- DefaultConfigurationDigester digester = new DefaultConfigurationDigester();
+ private DefaultConfigurationDigester digester = new DefaultConfigurationDigester();
- @Override
public void processEntry(final String unitName, final String unitPath) throws DeploymentException
{
String deploymentCheckPath = "preinstalled/" + ConfigUtil.urlEncode(deploymentName) + "/" + unitPath;
@@ -585,65 +588,132 @@
}
/**
+ * Assemble the {@link DispatchChain} map.
+ */
+ private void assembleDispatchChainMap()
+ {
+ Map<ServiceName, ServiceConfig> serviceMap = aggregatedDeploymentUnit.getServices();
+ Map<ServiceName, List<OutboundRouterConfig>> outboundRouters = aggregatedDeploymentUnit.getOutboundRouters();
+ Set<ServiceName> serviceNames = outboundRouters.keySet();
+ Set<Map.Entry<ServiceName, ServiceConfig>> services = serviceMap.entrySet();
+
+ for (ServiceName serviceName : serviceNames)
+ {
+ DispatchChain dispatchChain = new DispatchChain(serviceName);
+
+ dispatchChain.setServiceConfig(serviceMap.get(serviceName));
+ dispatchChain.setOutboundRouters(outboundRouters.get(serviceName));
+ dispatchChainMap.put(serviceName, dispatchChain);
+ }
+ }
+
+ /**
* Deploy the inbound routers.
*
* @throws DeploymentException Error deploying routers.
*/
private void deployInboundRouters() throws DeploymentException
{
- Map<ServiceName, List<InboundRouterConfig>> routerMap = aggregatedDeploymentUnit.getInboundRouters();
- Set<Map.Entry<ServiceName, List<InboundRouterConfig>>> routers = routerMap.entrySet();
+ Map<String, InboundRouterConfig> routerMap = aggregatedDeploymentUnit.getInboundRouters();
+ Set<Map.Entry<String, InboundRouterConfig>> routers = routerMap.entrySet();
- for (Map.Entry<ServiceName, List<InboundRouterConfig>> routerConfigMap : routers)
+ for (Map.Entry<String, InboundRouterConfig> routerConfigMap : routers)
{
- ServiceName serviceName = routerConfigMap.getKey();
+ InboundRouterConfig inRouterConfig = routerConfigMap.getValue();
+ ServiceName serviceName = getOnlyTargetService(inRouterConfig);
+ List<InboundRouterFilterConfig> filters = inRouterConfig.getFilters();
+ List<FilteredDispatchChain> filteredDispatchChains;
- List<InboundRouterConfig> routerList = routerConfigMap.getValue();
- for (InboundRouterConfig routerConfig : routerList)
+ assertRoutingConfigOK(inRouterConfig);
+
+ filteredDispatchChains = new ArrayList<FilteredDispatchChain>();
+ for (InboundRouterFilterConfig filter : filters)
{
- try
- {
- ServiceConfig service = getService(aggregatedDeploymentUnit, serviceName);
+ FilteredDispatchChain filteredChain = new FilteredDispatchChain();
- if (service != null && !service.isRoutable())
- {
- throw new DeploymentException("Invalid InboundRouter configuration '" + routerConfig.getName() + "' (" + routerConfig.getRouter().getClass().getName() + "). Target Service '" + serviceName + "' is not routable. Check Service 'mep' configuration.");
- }
+ filteredChain.setFilterConfig(filter);
+ filteredChain.setDispatchChain(dispatchChainMap.get(filter.getTo()));
+ filteredDispatchChains.add(filteredChain);
+ }
- // Deploy the processors first...
- deployProcessors(serviceName, routerConfig.getProcessors(), routerConfig.getName());
+ try
+ {
+ // Deploy the processors first...
+ deployProcessors(serviceName, inRouterConfig.getProcessors(), inRouterConfig.getName());
- // Create a LocalDispatcher and hook it into the DispatcherProxy...
- LocalDispatcher dispatcher = new LocalDispatcher(context);
- dispatcher.setServiceName(serviceName);
- dispatcher.setService(service);
- dispatcher.setReplyTo(routerConfig.getReplyTo());
- dispatcher.setFaultTo(routerConfig.getFaultTo());
- dispatcher.setProcessors(routerConfig.getProcessors());
- dispatcher.setOutboundRouters(aggregatedDeploymentUnit.getOutboundRouters().get(serviceName));
+ // Create a LocalDispatcher and hook it into the DispatcherProxy...
+ LocalDispatcher dispatcher = new LocalDispatcher(inRouterConfig.getName(), context);
+ dispatcher.setProcessors(inRouterConfig.getProcessors());
+ dispatcher.setFilteredDispatchChains(filteredDispatchChains);
- // Set the dispacther on both the router and the routerconfig. We set it on the config
- // so we can access it later...
- routerConfig.getRouter().setDispatcher(dispatcher);
- routerConfig.setDispatcher(dispatcher);
+ // Set the dispacther on both the router and the routerconfig. We set it on the config
+ // so we can access it later...
+ inRouterConfig.getRouter().setDispatcher(dispatcher);
+ inRouterConfig.setDispatcher(dispatcher);
- // Now deploy the router...
- deployObject(routerConfig.getRouter(), routerConfig.getName(), serviceName);
- logger.debug("Deployed InboundRouter '" + routerConfig.getName() + "' (" + routerConfig.getRouter().getClass().getName() + ").");
- }
- catch (InvocationTargetException e)
- {
- throw new DeploymentException("Unable to deploy InboundRouter '" + routerConfig.getName() + "' (" + routerConfig.getRouter().getClass().getName() + ").", e.getCause());
- }
- catch (Exception e)
- {
- throw new DeploymentException("Unable to deploy InboundRouter '" + routerConfig.getName() + "' (" + routerConfig.getRouter().getClass().getName() + ").", e);
- }
+ // Now deploy the router...
+ deployObject(inRouterConfig.getRouter(), inRouterConfig.getName(), serviceName);
+ logger.debug("Deployed InboundRouter '" + inRouterConfig.getName() + "' (" + inRouterConfig.getRouter().getClass().getName() + ").");
}
+ catch (InvocationTargetException e)
+ {
+ throw new DeploymentException("Unable to deploy InboundRouter '" + inRouterConfig.getName() + "' (" + inRouterConfig.getRouter().getClass().getName() + ").", e.getCause());
+ }
+ catch (Exception e)
+ {
+ throw new DeploymentException("Unable to deploy InboundRouter '" + inRouterConfig.getName() + "' (" + inRouterConfig.getRouter().getClass().getName() + ").", e);
+ }
}
}
/**
+ * Get the name of the only service that the supplied inbound router is
+ * routing to.
+ * <p/>
+ * If the inbound router is routing to more than one service (i.e. has multiple filters),
+ * this method will return null (i.e. there is no "only" service).
+ *
+ * @param routerConfig The routing config.
+ * @return The "only" service if the router is routing just one service, otherwise null
+ */
+ private ServiceName getOnlyTargetService(final InboundRouterConfig routerConfig)
+ {
+ if (routerConfig.getFilters().size() == 1)
+ {
+ return routerConfig.getFilters().get(0).getTo();
+ }
+
+ return null;
+ }
+
+ /**
+ * Assert that the routing configuration associated with this inrouter is OK.
+ * <p/>
+ * It checks that the router is filtering to at least one service and that all services being
+ * routed to are {@link org.jboss.esb.deploy.config.ServiceConfig#isRoutable() routable}.
+ *
+ * @param routerConfig The routing config to be checked.
+ * @throws DeploymentException Routing config not OK.
+ */
+ private void assertRoutingConfigOK(final InboundRouterConfig routerConfig) throws DeploymentException
+ {
+ if (routerConfig.getFilters().isEmpty())
+ {
+ throw new DeploymentException("Invalid InboundRouter configuration '" + routerConfig.getName() + "' (" + routerConfig.getRouter().getClass().getName() + "). This InboundRouter has no associated <filter>.");
+ }
+
+ for (InboundRouterFilterConfig filter : routerConfig.getFilters())
+ {
+ ServiceConfig service = getService(aggregatedDeploymentUnit, filter.getTo());
+
+ if (service != null && !service.isRoutable())
+ {
+ throw new DeploymentException("Invalid InboundRouter configuration '" + routerConfig.getName() + "' (" + routerConfig.getRouter().getClass().getName() + "). Target Service '" + filter.getTo() + "' is not routable. Check Service 'mep' configuration.");
+ }
+ }
+ }
+
+ /**
* Deploy the deployment coordinator.
*
* @throws DeploymentException Unable to deploy DeploymentCoordinator.
@@ -808,18 +878,10 @@
}
BusInboundRouter inRouter = new BusInboundRouter();
- BusDispatcher dispatcher = new BusDispatcher(context);
- List<OutboundRouterConfig> outRouterList = serviceOutRouters.getValue();
+ BusDispatcher dispatcher = new BusDispatcher(context, dispatchChainMap.get(serviceName));
busRouters.put(serviceName, inRouter);
inRouter.setDispatcher(dispatcher);
-
- dispatcher.setServiceName(serviceName);
- if (serviceConfig != null)
- {
- dispatcher.setService(serviceConfig);
- }
- dispatcher.setOutboundRouters(outRouterList);
}
}
@@ -827,7 +889,7 @@
* Deploy the processors.
*
* @param serviceName The service with which the processor set is associated.
- * @param processors The processor list.
+ * @param processors The processor list.
* @param routerConfigName The name of the owning router. @throws DeploymentException Error deploying processors.
* @throws DeploymentException Error deploying processors.
*/
@@ -884,6 +946,7 @@
/**
* Get the deployment properties.
+ *
* @return The deployment properties.
*/
public final ApplicationProperties getDeploymentProperties()
Modified: labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/DeploymentUtil.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/DeploymentUtil.java 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/DeploymentUtil.java 2008-10-07 14:16:03 UTC (rev 23349)
@@ -72,21 +72,19 @@
/**
* Get an inrouter config from the runtime.
*
- * @param service The service name associated with the config.
* @param configName The configuration name.
* @param runtime The runtime instance.
* @return The router configuration instance, or null if no such router config exists.
*/
- public static InboundRouterConfig getInboundRouter(final ServiceName service, final String configName, final DeploymentRuntime runtime)
+ public static InboundRouterConfig getInboundRouter(final String configName, final DeploymentRuntime runtime)
{
- AssertArgument.isNotNull(service, "service");
AssertArgument.isNotNullAndNotEmpty(configName, "configName");
AssertArgument.isNotNull(runtime, "runtime");
List<DeploymentUnit> deploymentUnits = runtime.getDeploymentUnits();
for (DeploymentUnit deploymentUnit : deploymentUnits)
{
- InboundRouterConfig inrouterConfig = deploymentUnit.getInboundRouter(service, configName);
+ InboundRouterConfig inrouterConfig = deploymentUnit.getInboundRouter(configName);
if (inrouterConfig != null)
{
return inrouterConfig;
Modified: labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/ConfigUtil.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/ConfigUtil.java 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/ConfigUtil.java 2008-10-07 14:16:03 UTC (rev 23349)
@@ -19,15 +19,21 @@
*/
package org.jboss.esb.deploy.config;
+import org.jboss.esb.annotations.AnnotationConstants;
+import org.jboss.esb.annotations.Property;
import org.jboss.esb.classpath.ClassUtil;
import org.jboss.esb.deploy.DeploymentException;
+import org.milyn.javabean.DataDecoder;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
+import java.lang.reflect.Field;
import java.net.URLEncoder;
+import java.util.Arrays;
+import java.util.Properties;
/**
* Configuration utilities.
@@ -105,4 +111,126 @@
throw new RuntimeException("Unexpected runtime exception. Character encoding 'UTF-8' not supported on runtime VM.");
}
}
+
+ /**
+ * Configure the supplied component with the supplied property set.
+ * <p/>
+ * Configures according to the {@link org.jboss.esb.annotations.Property}
+ * and {@link org.jboss.esb.annotations.Properties} annotations.
+ *
+ * @param component The component to be configured.
+ * @param properties The properties set.
+ * @throws DeploymentException Error configuring component.
+ */
+ public static void configure(final Object component, final Properties properties) throws DeploymentException
+ {
+ Class objectClass = component.getClass();
+
+ configure(component, objectClass, properties);
+ }
+
+ /**
+ * Configure the supplied component with the supplied property set.
+ * @param component The component to be configured.
+ * @param hierarchyClass The class to be used to search for annotated fields.
+ * @param properties The properties set.
+ * @throws DeploymentException Error configuring component.
+ */
+ private static void configure(final Object component, final Class hierarchyClass, final Properties properties) throws DeploymentException
+ {
+ final Class<?> superclass = hierarchyClass.getSuperclass();
+
+ if (superclass != null)
+ {
+ configure(component, superclass, properties);
+ }
+
+ for (Field field : hierarchyClass.getDeclaredFields())
+ {
+ Property propertyAnno = field.getAnnotation(Property.class);
+ if (propertyAnno != null)
+ {
+ String propertyName = AnnotationConstants.NULL_STRING.equals(propertyAnno.name()) ? field.getName() : propertyAnno.name();
+ String propertyValue = properties.getProperty(propertyName);
+
+ if(propertyValue == null)
+ {
+ if(!Property.Assert.isDefaultAssigned(propertyAnno))
+ {
+ if(propertyAnno.use() == Property.Use.REQUIRED)
+ {
+ throw new DeploymentException("Required property '" + propertyName + "' is not configured on class '" + component.getClass() + ".");
+ }
+ else
+ {
+ continue;
+ }
+ }
+ else
+ {
+ propertyValue = propertyAnno.defaultVal();
+ }
+ }
+
+ assertValidChoice(propertyAnno.choice(), propertyName, propertyValue);
+ try
+ {
+ setPropertyValue(field, component, propertyValue);
+ }
+ catch (IllegalAccessException e)
+ {
+ throw new DeploymentException("Property '" + propertyName + "' unknown on class '" + component.getClass() + "' (or super class).", e);
+ }
+ }
+ }
+ }
+
+ /**
+ * Verifies that the passed in paramValue if a valid choice.
+ *
+ * @param choices the choices available
+ * @param name the name of the paramter
+ * @param paramValue the property value
+ */
+ private static void assertValidChoice(final String[] choices, final String name, final String paramValue) throws DeploymentException
+ {
+ if (choices == null || choices.length == 0)
+ {
+ throw new RuntimeException("Unexpected annotation default choice value. Should not be null or empty. Code may have changed incompatibly.");
+ }
+ else if (choices.length == 1 && AnnotationConstants.NULL_STRING.equals(choices[0]))
+ {
+ // A choice wasn't specified on the paramater config.
+ return;
+ }
+ else
+ {
+ // A choice was specified. Check it against the value...
+ for (String choice : choices)
+ {
+ if (paramValue.equals(choice))
+ {
+ return;
+ }
+ }
+ }
+
+ throw new DeploymentException("Value '" + paramValue + "' for paramater '" + name + "' is invalid. Valid choices for this paramater are: " + Arrays.asList(choices));
+ }
+
+ /**
+ * Set property value.
+ *
+ * @param field The property field.
+ * @param instance The Object instance.
+ * @param value The property value.
+ * @throws IllegalAccessException Property access exception.
+ */
+ private static void setPropertyValue(final Field field, final Object instance, final String value) throws IllegalAccessException
+ {
+ DataDecoder decoder = DataDecoder.Factory.create(field.getType());
+ Object objValue = decoder.decode(value);
+
+ ClassUtil.setFieldValue(field, instance, objValue);
+ }
}
Modified: labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/DeploymentUnit.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/DeploymentUnit.java 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/DeploymentUnit.java 2008-10-07 14:16:03 UTC (rev 23349)
@@ -28,6 +28,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.Collection;
/**
* JBoss ESB Deployment Configuration Unit.
@@ -43,7 +44,7 @@
/**
* List of Inbound routers defined in the configuration.
*/
- private Map<ServiceName, List<InboundRouterConfig>> inboundRouters = new LinkedHashMap<ServiceName, List<InboundRouterConfig>>();
+ private Map<String, InboundRouterConfig> inboundRouters = new LinkedHashMap<String, InboundRouterConfig>();
/**
* List of Services defined in the configuration.
*/
@@ -89,21 +90,8 @@
}
// Add the InRouters...
- Set<Map.Entry<ServiceName, List<InboundRouterConfig>>> newInRouters = deployment.getInboundRouters().entrySet();
- for (Map.Entry<ServiceName, List<InboundRouterConfig>> serviceInRouters : newInRouters)
- {
- ServiceName serviceName = serviceInRouters.getKey();
- List<InboundRouterConfig> routers = serviceInRouters.getValue();
- List<InboundRouterConfig> aggregateRouterList = inboundRouters.get(serviceName);
+ inboundRouters.putAll(deployment.getInboundRouters());
- if (aggregateRouterList == null)
- {
- aggregateRouterList = new ArrayList<InboundRouterConfig>();
- inboundRouters.put(serviceName, aggregateRouterList);
- }
- aggregateRouterList.addAll(routers);
- }
-
// Add the OutRouters...
Set<Map.Entry<ServiceName, List<OutboundRouterConfig>>> newOutRouters = deployment.getOutboundRouters().entrySet();
for (Map.Entry<ServiceName, List<OutboundRouterConfig>> serviceOutRouters : newOutRouters)
@@ -149,7 +137,7 @@
*
* @return The List of Inbound routers defined in the configuration.
*/
- public final Map<ServiceName, List<InboundRouterConfig>> getInboundRouters()
+ public final Map<String, InboundRouterConfig> getInboundRouters()
{
return inboundRouters;
}
@@ -157,27 +145,13 @@
/**
* Get the named InboundRouterConfig from the specified service.
*
- * @param service The service name.
* @param configName The configuration name.
* @return The router configuration, or null if no such router is
* specified.
*/
- public final InboundRouterConfig getInboundRouter(final ServiceName service, final String configName)
+ public final InboundRouterConfig getInboundRouter(final String configName)
{
- List<InboundRouterConfig> inboundRouterList = inboundRouters.get(service);
-
- if (inboundRouterList != null)
- {
- for (InboundRouterConfig inboundRouterConfig : inboundRouterList)
- {
- if (configName.equals(inboundRouterConfig.getName()))
- {
- return inboundRouterConfig;
- }
- }
- }
-
- return null;
+ return inboundRouters.get(configName);
}
/**
@@ -185,7 +159,7 @@
*
* @param inboundRouters The List of Inbound routers defined in the configuration.
*/
- public final void setInboundRouters(final Map<ServiceName, List<InboundRouterConfig>> inboundRouters)
+ public final void setInboundRouters(final Map<String, InboundRouterConfig> inboundRouters)
{
this.inboundRouters = inboundRouters;
}
@@ -266,12 +240,15 @@
public final void expandOutboundRouters()
{
// Check through the inrouter definitions...
- Set<Map.Entry<ServiceName, List<InboundRouterConfig>>> inrouterLists = inboundRouters.entrySet();
- for (Map.Entry<ServiceName, List<InboundRouterConfig>> inrouterList : inrouterLists)
+ Collection<InboundRouterConfig> inrouters = inboundRouters.values();
+ for (InboundRouterConfig inrouter : inrouters)
{
- if (!outboundRouters.containsKey(inrouterList.getKey()))
+ for(InboundRouterFilterConfig filterConfig : inrouter.getFilters())
{
- outboundRouters.put(inrouterList.getKey(), new ArrayList<OutboundRouterConfig>());
+ if (!outboundRouters.containsKey(filterConfig.getTo()))
+ {
+ outboundRouters.put(filterConfig.getTo(), new ArrayList<OutboundRouterConfig>());
+ }
}
}
Modified: labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/InboundRouterConfig.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/InboundRouterConfig.java 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/InboundRouterConfig.java 2008-10-07 14:16:03 UTC (rev 23349)
@@ -24,6 +24,7 @@
import org.jboss.esb.routing.MessageDispatcher;
import org.jboss.esb.service.ServiceName;
+import java.util.ArrayList;
import java.util.List;
/**
@@ -34,7 +35,8 @@
public class InboundRouterConfig
{
/**
- * The ServiceName of the Service this inrouter is routing to.
+ * The ServiceName of the Service this inrouter is routing to. This is only specified
+ * when the InboundRouter is configured directly on the Service configuration.
*/
private ServiceName serviceName;
/**
@@ -54,16 +56,15 @@
*/
private List<MessageProcessor> processors;
/**
- * "replyTo" address for all messages dispatched from this router.
+ * Inbound Filters. Filtering messages to services.
*/
- private ServiceName replyTo;
- /**
- * "faultTo" address for all messages dispatched from this router.
- */
- private ServiceName faultTo;
+ private List<InboundRouterFilterConfig> filters = new ArrayList<InboundRouterFilterConfig>();
/**
* Get the ServiceName of the Service this inrouter is routing to.
+ * <p/>
+ * Only available when the router is defined locally/inline on the Service.
+ *
* @return The ServiceName of the Service this inrouter is routing to.
*/
public final ServiceName getServiceName()
@@ -161,46 +162,11 @@
}
/**
- * Get the "replyTo" address for messages generated out of this
- * inrouter.
- *
- * @return The replyTo Service name.
+ * Get the inbound filter list.
+ * @return The inbound filter list.
*/
- public final ServiceName getReplyTo()
+ public final List<InboundRouterFilterConfig> getFilters()
{
- return replyTo;
+ return filters;
}
-
- /**
- * Set the "replyTo" address for messages generated out of this
- * inrouter.
- *
- * @param replyTo The replyTo Service name.
- */
- public final void setReplyTo(final ServiceName replyTo)
- {
- this.replyTo = replyTo;
- }
-
- /**
- * Get the "faultTo" address for messages generated out of this
- * inrouter.
- *
- * @return The faultTo Service name.
- */
- public final ServiceName getFaultTo()
- {
- return faultTo;
- }
-
- /**
- * Set the "faultTo" address for messages generated out of this
- * inrouter.
- *
- * @param faultTo The replyTo Service name.
- */
- public final void setFaultTo(final ServiceName faultTo)
- {
- this.faultTo = faultTo;
- }
}
Added: labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/InboundRouterFilterConfig.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/InboundRouterFilterConfig.java (rev 0)
+++ labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/InboundRouterFilterConfig.java 2008-10-07 14:16:03 UTC (rev 23349)
@@ -0,0 +1,179 @@
+/*
+ * 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;
+
+import org.jboss.esb.message.MessageProcessor;
+import org.jboss.esb.routing.FilterEvaluator;
+import org.jboss.esb.service.ServiceName;
+
+import java.util.List;
+
+/**
+ * Inbound router filter configuration.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class InboundRouterFilterConfig
+{
+ /**
+ * Router config name.
+ */
+ private String inRouterName;
+ /**
+ * Filter evaluator.
+ */
+ private FilterEvaluator evaluator;
+ /**
+ * "replyTo" address for all messages dispatched via this filter.
+ */
+ private ServiceName to;
+ /**
+ * "replyTo" address for all messages dispatched via this filter.
+ */
+ private ServiceName replyTo;
+ /**
+ * "faultTo" address for all messages dispatched via this filter.
+ */
+ private ServiceName faultTo;
+ /**
+ * Processors to be applied to message before routing via this filter.
+ */
+ private List<MessageProcessor> processors;
+
+ /**
+ * Get the inrouter name.
+ *
+ * @return The inrouter config name.
+ */
+ public final String getInRouterName()
+ {
+ return inRouterName;
+ }
+
+ /**
+ * Set the inrouter name.
+ *
+ * @param inRouterName The inrouter config name.
+ */
+ public final void setInRouterName(final String inRouterName)
+ {
+ this.inRouterName = inRouterName;
+ }
+
+ /**
+ * Get the filter evaluator.
+ *
+ * @return The filter evaluator.
+ */
+ public final FilterEvaluator getEvaluator()
+ {
+ return evaluator;
+ }
+
+ /**
+ * Set the filter evaluator.
+ *
+ * @param evaluator The filter evaluator.
+ */
+ public final void setEvaluator(final FilterEvaluator evaluator)
+ {
+ this.evaluator = evaluator;
+ }
+
+ /**
+ * Get the to address.
+ *
+ * @return The to address.
+ */
+ public final ServiceName getTo()
+ {
+ return to;
+ }
+
+ /**
+ * Set the "to" address.
+ *
+ * @param to The "to" address.
+ */
+ public final void setTo(final ServiceName to)
+ {
+ this.to = to;
+ }
+
+ /**
+ * Get the "replyTo" address.
+ *
+ * @return The "replyTo" address.
+ */
+ public final ServiceName getReplyTo()
+ {
+ return replyTo;
+ }
+
+ /**
+ * Set the "replyTo" address.
+ *
+ * @param replyTo The "replyTo" address.
+ */
+ public final void setReplyTo(final ServiceName replyTo)
+ {
+ this.replyTo = replyTo;
+ }
+
+ /**
+ * Get the "faultTo" address.
+ *
+ * @return The "faultTo" address.
+ */
+ public final ServiceName getFaultTo()
+ {
+ return faultTo;
+ }
+
+ /**
+ * Set the "faultTo" address.
+ *
+ * @param faultTo The "faultTo" address.
+ */
+ public final void setFaultTo(final ServiceName faultTo)
+ {
+ this.faultTo = faultTo;
+ }
+
+ /**
+ * Get the pre-routing processor list.
+ *
+ * @return The pre-routing processor list.
+ */
+ public final List<MessageProcessor> getProcessors()
+ {
+ return processors;
+ }
+
+ /**
+ * Set the pre-routing processor list.
+ *
+ * @param processors The pre-routing processor list.
+ */
+ public final void setProcessors(final List<MessageProcessor> processors)
+ {
+ this.processors = processors;
+ }
+}
Property changes on: labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/InboundRouterFilterConfig.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/digest/CreateObject.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/digest/CreateObject.java 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/digest/CreateObject.java 2008-10-07 14:16:03 UTC (rev 23349)
@@ -37,8 +37,8 @@
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
+import java.util.List;
import java.util.ArrayList;
-import java.util.List;
/**
* Create an object and set it in the Smooks bean repository.
@@ -123,8 +123,46 @@
throw new SmooksException("One of the attributes 'className' or 'classAttrib' must be defined on the '" + CreateObject.class.getName() + "' resource.");
}
+ Object objectInstance = createObject(objectClassName, expectedType);
+
+ // Store the bean in the Smooks bean repository...
+ BeanRepositoryManager.getBeanRepository(executionContext).addBean(beanId, objectInstance);
+
+ FieldListAccessor.set(executionContext, beanId, new ArrayList<Field>());
+ }
+
+ /**
+ * Visit after.
+ * <p/>
+ * Look at the created bean and check that all required fields are set.
+ *
+ * @param element The event element.
+ * @param executionContext The Smooks execution context.
+ * @throws SmooksException Visit exception.
+ */
+ public final void visitAfter(final Element element, final ExecutionContext executionContext) throws SmooksException
+ {
+ final Object bean = BeanRepositoryManager.getBeanRepository(executionContext).getBean(beanId);
+ List<Field> setFields = FieldListAccessor.get(executionContext, beanId);
try
{
+ checkFieldAnnoations(bean.getClass(), bean, setFields);
+ }
+ finally
+ {
+ FieldListAccessor.remove(executionContext, beanId);
+ }
+ }
+
+ /**
+ * Create the specified object and check it's type.
+ * @param objectClassName The object class name.
+ * @param expectedType The expected type.
+ */
+ public static Object createObject(final String objectClassName, final Class expectedType) throws SmooksException
+ {
+ try
+ {
Class objectClass = ClassUtil.forName(objectClassName, CreateObject.class);
Constructor defaultConstructor;
@@ -149,10 +187,7 @@
{
Object objectInstance = defaultConstructor.newInstance();
- // Store the bean in the Smooks bean repository...
- BeanRepositoryManager.getBeanRepository(executionContext).addBean(beanId, objectInstance);
-
- FieldListAccessor.set(executionContext, beanId, new ArrayList<Field>());
+ return objectInstance;
}
finally
{
@@ -166,36 +201,13 @@
}
/**
- * Visit after.
- * <p/>
- * Look at the created bean and check that all required fields are set.
- *
- * @param element The event element.
- * @param executionContext The Smooks execution context.
- * @throws SmooksException Visit exception.
- */
- public final void visitAfter(final Element element, final ExecutionContext executionContext) throws SmooksException
- {
- final Object bean = BeanRepositoryManager.getBeanRepository(executionContext).getBean(beanId);
- List<Field> setFields = FieldListAccessor.get(executionContext, beanId);
- try
- {
- checkFieldAnnoations(bean.getClass(), bean, setFields);
- }
- finally
- {
- FieldListAccessor.remove(executionContext, beanId);
- }
- }
-
- /**
* Check field annotations.
* <p/>
* @param hierarchyClass The Class hierarchy level to be checked
* @param instance The object instance
* @param setFields List containing the fields that have been set(that existed in the config)
*/
- final void checkFieldAnnoations(final Class<?> hierarchyClass, final Object instance, final List<Field> setFields)
+ private static void checkFieldAnnoations(final Class<?> hierarchyClass, final Object instance, final List<Field> setFields)
{
final Class<?> superclass = hierarchyClass.getSuperclass();
if (superclass != null)
Modified: labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/digest/DefaultConfigurationDigester.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/digest/DefaultConfigurationDigester.java 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/digest/DefaultConfigurationDigester.java 2008-10-07 14:16:03 UTC (rev 23349)
@@ -23,6 +23,7 @@
import org.jboss.esb.deploy.DeploymentResource;
import org.jboss.esb.deploy.config.DeploymentUnit;
import org.jboss.esb.deploy.config.InboundRouterConfig;
+import org.jboss.esb.deploy.config.InboundRouterFilterConfig;
import org.jboss.esb.deploy.config.OutboundRouterConfig;
import org.jboss.esb.deploy.config.ServiceConfig;
import org.jboss.esb.service.ServiceName;
@@ -88,10 +89,12 @@
{
Document configDoc = XMLParseUtils.parse(configStream);
return digest(configDoc);
- } catch (ParserConfigurationException e)
+ }
+ catch (ParserConfigurationException e)
{
throw new DeploymentException("Parser configuration error parsing JBoss ESB Configuration.", e);
- } catch (SAXException e)
+ }
+ catch (SAXException e)
{
throw new DeploymentException("Configuration format error parsing JBoss ESB Configuration..", e);
}
@@ -122,7 +125,8 @@
* TODO: revisit this and our osgi strategy as a whole.
*/
validator.validate(getClass());
- } catch (IOException e)
+ }
+ catch (IOException e)
{
throw new DeploymentException("Error reading configuration schemas.", e);
// The XsdDOMValidator.validate() method throws a SAXException if there's an actual config validation error!
@@ -165,10 +169,12 @@
configurationtUnit.addResource(deploymentResource.getId(), deploymentResource.getResourceObject());
}
}
- } catch (IOException e)
+ }
+ catch (IOException e)
{
throw new DeploymentException("Error digesting configurations for child elements of '" + resources + "'.", e);
- } catch (SAXException e)
+ }
+ catch (SAXException e)
{
throw new DeploymentException("Error digesting configurations for child elements of '" + resources + "'.", e);
}
@@ -213,7 +219,7 @@
private void digestInRouters(final DeploymentUnit configurationtUnit, final NodeList inRoutersNodeList) throws DeploymentException
{
int inRoutersCount = inRoutersNodeList.getLength();
- Map<ServiceName, List<InboundRouterConfig>> inboundRouters = new LinkedHashMap<ServiceName, List<InboundRouterConfig>>();
+ Map<String, InboundRouterConfig> inboundRouters = new LinkedHashMap<String, InboundRouterConfig>();
configurationtUnit.setInboundRouters(inboundRouters);
for (int i = 0; i < inRoutersCount; i++)
@@ -222,18 +228,34 @@
try
{
Map<String, Object> inRoutersObjects = DigestUtil.digestElement(inRoutersElement);
- ServiceName serviceName = (ServiceName) inRoutersObjects.get("serviceName");
List<InboundRouterConfig> inRouters = (List<InboundRouterConfig>) inRoutersObjects.get("inRouters");
+ List<InboundRouterFilterConfig> inRouterFilters = (List<InboundRouterFilterConfig>) inRoutersObjects.get("inRouterFilters");
- if (inboundRouters.containsKey(serviceName))
+ for (InboundRouterConfig inRouter : inRouters)
{
- throw new DeploymentException("An <inRouters> section is defined multiple times for Service '" + serviceName + "'. There should only be one.");
+ if (inboundRouters.containsKey(inRouter.getName()))
+ {
+ throw new DeploymentException("Multiple <inRouter> configurations named '" + inRouter.getName() + "' exist. There should only be one.");
+ }
+ inboundRouters.put(inRouter.getName(), inRouter);
+
+ // Now map the filters onto the inrouter...
+ for (InboundRouterFilterConfig inRouterFilter : inRouterFilters)
+ {
+ String inRouterName = inRouterFilter.getInRouterName();
+
+ if (inRouter.getName().equals(inRouterName))
+ {
+ inRouter.getFilters().add(inRouterFilter);
+ }
+ }
}
- inboundRouters.put(serviceName, inRouters);
- } catch (IOException e)
+ }
+ catch (IOException e)
{
throw new DeploymentException("Error digesting configurations for child elements of '" + inRoutersElement + "'.", e);
- } catch (SAXException e)
+ }
+ catch (SAXException e)
{
throw new DeploymentException("Error digesting configurations for child elements of '" + inRoutersElement + "'.", e);
}
@@ -244,7 +266,7 @@
* Digest the outRouters.
*
* @param configurationtUnit ConfigurationUnit to add the configs to.
- * @param outRoutersNodeList The outRouters DOM node tree.
+ * @param outRoutersNodeList The outRouters DOM node tree.
* @throws DeploymentException Error in the supplied configuration data.
*/
private void digestOutRouters(final DeploymentUnit configurationtUnit, final NodeList outRoutersNodeList) throws DeploymentException
@@ -267,10 +289,12 @@
throw new DeploymentException("An <outRouters> section is defined multiple times for Service '" + serviceName + "'. There should only be one.");
}
outboundRouters.put(serviceName, outRouters);
- } catch (IOException e)
+ }
+ catch (IOException e)
{
throw new DeploymentException("Error digesting configurations for child elements of '" + outRoutersElement + "'.", e);
- } catch (SAXException e)
+ }
+ catch (SAXException e)
{
throw new DeploymentException("Error digesting configurations for child elements of '" + outRoutersElement + "'.", e);
}
@@ -310,16 +334,20 @@
// directly on the services (Vs those defined in the <inRouters> section)...
if (inRouters != null)
{
- for (InboundRouterConfig inRouter : inRouters)
+ Map<String, InboundRouterConfig> deploymentInrouters = configurationtUnit.getInboundRouters();
+ for (InboundRouterConfig locallyDefinedInRouter : inRouters)
{
- Map<ServiceName, List<InboundRouterConfig>> deploymentInrouters = configurationtUnit.getInboundRouters();
- List<InboundRouterConfig> serviceInrouters = deploymentInrouters.get(inRouter.getServiceName());
- if (serviceInrouters == null)
+ if (deploymentInrouters.containsKey(locallyDefinedInRouter.getName()))
{
- serviceInrouters = new ArrayList<InboundRouterConfig>();
- deploymentInrouters.put(inRouter.getServiceName(), serviceInrouters);
+ throw new DeploymentException("Multiple <inRouter> configurations named '" + locallyDefinedInRouter.getName() + "' exist, one of which is defined locally on Service '" + locallyDefinedInRouter.getServiceName() + "'. There should only be one.");
}
- serviceInrouters.add(inRouter);
+
+ InboundRouterFilterConfig directFilter = new InboundRouterFilterConfig();
+ directFilter.setInRouterName(locallyDefinedInRouter.getName());
+ directFilter.setTo(locallyDefinedInRouter.getServiceName());
+ locallyDefinedInRouter.getFilters().add(directFilter);
+
+ deploymentInrouters.put(locallyDefinedInRouter.getName(), locallyDefinedInRouter);
}
}
@@ -339,10 +367,12 @@
serviceOutrouters.add(outRouter);
}
}
- } catch (IOException e)
+ }
+ catch (IOException e)
{
throw new DeploymentException("Error digesting configurations for child elements of '" + services + "'.", e);
- } catch (SAXException e)
+ }
+ catch (SAXException e)
{
throw new DeploymentException("Error digesting configurations for child elements of '" + services + "'.", e);
}
Added: labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/digest/FilterDecisionTreeBuilder.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/digest/FilterDecisionTreeBuilder.java (rev 0)
+++ labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/digest/FilterDecisionTreeBuilder.java 2008-10-07 14:16:03 UTC (rev 23349)
@@ -0,0 +1,155 @@
+/*
+ * 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.digest;
+
+import org.jboss.esb.filter.FilterDecisionNode;
+import org.jboss.esb.routing.FilterEvaluator;
+import org.jboss.esb.deploy.config.ConfigUtil;
+import org.jboss.esb.deploy.DeploymentException;
+import org.milyn.SmooksException;
+import org.milyn.cdr.annotation.ConfigParam;
+import org.milyn.container.ExecutionContext;
+import org.milyn.delivery.dom.DOMVisitAfter;
+import org.milyn.delivery.dom.DOMVisitBefore;
+import org.milyn.javabean.repository.BeanRepositoryManager;
+import org.milyn.xml.DomUtils;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+import java.util.Properties;
+import java.util.Stack;
+
+/**
+ * Filter decision tree configuration builder.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class FilterDecisionTreeBuilder implements DOMVisitBefore, DOMVisitAfter
+{
+ /**
+ * The beanId for filter decision tree root bean.
+ */
+ @ConfigParam
+ private String beanId;
+
+ /**
+ * Visit the start of the "evaluator" element.
+ * <p/>
+ * Creates the associated {@link FilterDecisionNode} and adds it as a child
+ * to the current node.
+ *
+ * @param evaluatorElement The evaluator element.
+ * @param executionContext The Smooks execution context.
+ * @throws SmooksException Error creating {@link FilterDecisionNode}.
+ */
+ public void visitBefore(Element evaluatorElement, ExecutionContext executionContext) throws SmooksException
+ {
+ FilterDecisionNode node = new FilterDecisionNode();
+ Stack<FilterDecisionNode> nodeStack;
+
+ if (DomUtils.getName((Element) evaluatorElement.getParentNode()).equals("filter"))
+ {
+ nodeStack = new Stack<FilterDecisionNode>();
+ executionContext.setAttribute(FilterDecisionTreeBuilder.class, nodeStack);
+
+ // Store the "root" node in the bean context. This allows it to be
+ // wired into other beans..
+ BeanRepositoryManager.getBeanRepository(executionContext).addBean(beanId, node);
+ }
+ else
+ {
+ nodeStack = (Stack<FilterDecisionNode>) executionContext.getAttribute(FilterDecisionTreeBuilder.class);
+ nodeStack.peek().getSubFilters().add(node);
+ }
+
+ node.setFilterEvaluator(createEvaluator(evaluatorElement));
+ nodeStack.push(node);
+ }
+
+ /**
+ * Visit the end of the "evaluator" element.
+ * <p/>
+ * Pops off the current {@link FilterDecisionNode}.
+ *
+ * @param evaluatorElement The evaluator element.
+ * @param executionContext The Smooks execution context.
+ */
+ public void visitAfter(Element evaluatorElement, ExecutionContext executionContext)
+ {
+ Stack<FilterDecisionNode> nodeStack = (Stack<FilterDecisionNode>) executionContext.getAttribute(FilterDecisionTreeBuilder.class);
+
+ if (!nodeStack.isEmpty())
+ {
+ nodeStack.pop();
+ }
+ }
+
+ /**
+ * Create the evaluator instance from the configuration element.
+ * @param element The element.
+ * @return The FilterEvaluator instance.
+ * @throws SmooksException Error creating {@link FilterEvaluator}.
+ */
+ private FilterEvaluator createEvaluator(final Element element) throws SmooksException
+ {
+ FilterEvaluator evaluator = null;
+ String className = DomUtils.getAttributeValue(element, "class");
+
+ if (className != null)
+ {
+ evaluator = (FilterEvaluator) CreateObject.createObject(className.trim(), FilterEvaluator.class);
+ Properties properties = getProperties(element);
+
+ try
+ {
+ ConfigUtil.configure(evaluator, properties);
+ }
+ catch (DeploymentException e)
+ {
+ throw new SmooksException("Failed to configure Evaluator instance type '" + evaluator.getClass().getName() + "'.", e);
+ }
+ }
+
+ return evaluator;
+ }
+
+ /**
+ * Get the properties from the Evaluator configuration.
+ *
+ * @param element The evaluator config.
+ * @return The Evaluator properties.
+ */
+ private Properties getProperties(final Element element)
+ {
+ Properties properties = new Properties();
+ NodeList propertyList = element.getElementsByTagName("property");
+
+ for (int i = 0; i < propertyList.getLength(); i++)
+ {
+ Element propertyElement = (Element) propertyList.item(i);
+ String propertyName = DomUtils.getAttributeValue(propertyElement, "name");
+ String propertyValue = DomUtils.getAllText(propertyElement, true);
+
+ properties.setProperty(propertyName, propertyValue);
+ }
+
+ return properties;
+ }
+}
Property changes on: labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/digest/FilterDecisionTreeBuilder.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/digest/SetProperty.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/digest/SetProperty.java 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/deploy/config/digest/SetProperty.java 2008-10-07 14:16:03 UTC (rev 23349)
@@ -33,7 +33,6 @@
import java.lang.reflect.Field;
import java.util.Arrays;
-import java.util.List;
import java.util.Map;
import java.util.Properties;
@@ -81,24 +80,29 @@
*/
public final void visitBefore(final Element element, final ExecutionContext executionContext) throws SmooksException
{
- Object instance = getObject(executionContext);
- Class objectClass = instance.getClass();
+ Object objectInstance = getObject(executionContext);
+ Class objectClass = objectInstance.getClass();
String propertyName = getPropertyName(element);
String value = getPropertyValue(element);
- if (instance instanceof Map)
+ if (objectInstance instanceof Map)
{
- ((Map) instance).put(propertyName, value);
+ ((Map) objectInstance).put(propertyName, value);
}
else
{
try
{
- List<Field> fieldsList = FieldListAccessor.get(executionContext, beanId);
- if (!attemptAnnotationFieldSet(objectClass, instance, propertyName, value, fieldsList))
+ Field field = attemptAnnotationFieldSet(objectClass, objectInstance, propertyName, value);
+
+ if (field != null)
{
- attemptAnnotationPropertySet(objectClass, instance, propertyName, value);
+ FieldListAccessor.get(executionContext, beanId).add(field);
}
+ else
+ {
+ attemptAnnotationPropertySet(objectClass, objectInstance, propertyName, value);
+ }
}
catch (final IllegalAccessException e)
{
@@ -115,44 +119,42 @@
* @param instance the instance that contains the field to be set.
* @param configPropertyName the name of the configuration property.
* @param value the value to set the field to.
- * @param fieldsList The field list to be added t if the field is set.
* @return True if the field was set, otherwise false.
* @throws IllegalAccessException if the field was not accessible.
*/
- final boolean attemptAnnotationFieldSet(
+ final Field attemptAnnotationFieldSet(
final Class<?> clazz,
final Object instance,
final String configPropertyName,
- final String value,
- final List<Field> fieldsList) throws IllegalAccessException
+ final String value) throws IllegalAccessException
{
- boolean fieldSet = false;
final Class<?> superclass = clazz.getSuperclass();
+
if (superclass != null)
{
- fieldSet = attemptAnnotationFieldSet(superclass, instance, configPropertyName, value, fieldsList);
+ Field annotatedField = attemptAnnotationFieldSet(superclass, instance, configPropertyName, value);
+ if (annotatedField != null)
+ {
+ return annotatedField;
+ }
}
- if (!fieldSet)
+ for (Field field : clazz.getDeclaredFields())
{
- for (Field field : clazz.getDeclaredFields())
+ Property propertyAnno = field.getAnnotation(Property.class);
+ if (propertyAnno != null)
{
- Property propertyAnno = field.getAnnotation(Property.class);
- if (propertyAnno != null)
+ final String fieldName = AnnotationConstants.NULL_STRING.equals(propertyAnno.name()) ? field.getName() : propertyAnno.name();
+ if (fieldName.equals(configPropertyName))
{
- final String fieldName = AnnotationConstants.NULL_STRING.equals(propertyAnno.name()) ? field.getName() : propertyAnno.name();
- if (fieldName.equals(configPropertyName))
- {
- fieldsList.add(field);
- assertValidChoice(propertyAnno.choice(), configPropertyName, value);
- setPropertyValue(field, instance, value == null ? propertyAnno.defaultVal() : value);
- fieldSet = true;
- break;
- }
+ assertValidChoice(propertyAnno.choice(), configPropertyName, value);
+ setPropertyValue(field, instance, value == null ? propertyAnno.defaultVal() : value);
+ return field;
}
}
}
- return fieldSet;
+
+ return null;
}
/**
Modified: labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/dispatch/AbstractDispatcher.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/dispatch/AbstractDispatcher.java 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/dispatch/AbstractDispatcher.java 2008-10-07 14:16:03 UTC (rev 23349)
@@ -60,6 +60,10 @@
*/
private Logger logger;
/**
+ * The inbound router name.
+ */
+ private String routerName;
+ /**
* The associated deployment context.
*/
private DeploymentContext deploymentContext;
@@ -69,19 +73,6 @@
*/
private List<MessageProcessor> processors;
/**
- * The service name.
- */
- private ServiceName serviceName;
- /**
- * The Service config (can be null).
- */
- private ServiceConfig service;
- /**
- * The outbound routers, to which the message is passed after
- * Service invocation (can be null).
- */
- private List<OutboundRouterConfig> outboundRouters;
- /**
* ServiceInvoker.
*/
private ServiceInvoker serviceInvoker;
@@ -89,23 +80,16 @@
* Active message list.
*/
private List<Message> activeMessageList = Collections.synchronizedList(new ArrayList<Message>());
- /**
- * Clone messages before applying outbound routers.
- * <p/>
- * If there are any processors on any of the outbound routers, we need to clone
- * the message before applying each router. This is to protect against a situation
- * where an error has occured after the original message has been modified. In this
- * case we would have lost the original message if we had not cloned.
- */
- private boolean cloneOutboundMessages = false;
/**
* Public constructor.
*
+ * @param routerName Router name.
* @param deploymentContext The deployment context.
*/
- public AbstractDispatcher(final DeploymentContext deploymentContext)
+ public AbstractDispatcher(final String routerName, final DeploymentContext deploymentContext)
{
+ this.routerName = routerName;
this.deploymentContext = deploymentContext;
logger = Logger.getLogger(getClass());
serviceInvoker = new ServiceInvoker(deploymentContext);
@@ -168,17 +152,18 @@
}
/**
- * Apply the inbound processor set.
+ * Apply the supplied processor set.
*
- * @param message The message.
+ * @param message The message.
+ * @param processorList The processors to be applied.
* @throws org.jboss.esb.routing.RoutingException
* Error applying processor.
*/
- protected final void applyInboundProcessors(final Message message) throws RoutingException
+ protected final void applyProcessors(final Message message, final List<MessageProcessor> processorList) throws RoutingException
{
- if (processors != null && !processors.isEmpty())
+ if (processorList != null && !processorList.isEmpty())
{
- for (MessageProcessor processor : processors)
+ for (MessageProcessor processor : processorList)
{
try
{
@@ -195,36 +180,43 @@
/**
* Dispatch the message to the Service instance.
*
- * @param theMessage The message.
+ * @param theMessage The message.
+ * @param serviceConfig The service configuration.
+ * @param processorList Processors to be applied before dispatching to the service.
* @return The processed message. Can be a new Message instance.
*/
- protected final Message dispatchToService(final Message theMessage)
+ protected final Message dispatchToService(final Message theMessage, final ServiceConfig serviceConfig, final List<MessageProcessor> processorList)
{
- if (service != null && service.getService() != null)
+ if (serviceConfig != null && serviceConfig.getService() != null)
{
+ ServiceName serviceName = serviceConfig.getServiceName();
+
try
{
AddressingContext addressingContext = AddressingContext.getContext();
ServiceName replyTo = addressingContext.getReplyTo();
Message outMessage;
+ // Apply the processors before dispatching to the service...
+ applyProcessors(theMessage, processorList);
+
// Process the message...
- outMessage = service.getService().process(theMessage);
- addressingContext.setFrom(getServiceName());
+ outMessage = serviceConfig.getService().process(theMessage);
+ addressingContext.setFrom(serviceName);
// Log this processing event...
- ProcessingEventLog.getEventLog().logEvent(new ServiceProcessingEvent(getServiceName()));
+ ProcessingEventLog.getEventLog().logEvent(new ServiceProcessingEvent(serviceName));
// If we need to send a reply, send it now...
if (outMessage != null && replyTo != null)
{
- if (service.getServiceMEP() == ServiceMEP.InOut)
+ if (serviceConfig.getServiceMEP() == ServiceMEP.InOut)
{
serviceInvoker.send(outMessage, replyTo);
}
else
{
- logger.debug("Not sending reply to '" + replyTo + "'. Service '" + serviceName + "' does not support 'replyTo'. Service MEP is '" + service.getServiceMEP() + "'.");
+ logger.debug("Not sending reply to '" + replyTo + "'. Service '" + serviceName + "' does not support 'replyTo'. Service MEP is '" + serviceConfig.getServiceMEP() + "'.");
}
}
@@ -268,9 +260,11 @@
/**
* Apply the outbound routers to the message.
*
- * @param message The message.
+ * @param message The message.
+ * @param serviceName The name of the service associated with the set of outbound routers.
+ * @param outboundRouters The outbound routers. @throws org.jboss.esb.routing.RoutingException Error routing message.
*/
- protected final void applyOutboundRouters(final Message message)
+ protected final void applyOutboundRouters(final Message message, final ServiceName serviceName, final List<OutboundRouterConfig> outboundRouters)
{
if (outboundRouters != null && !outboundRouters.isEmpty())
{
@@ -311,7 +305,6 @@
}
}
-
for (OutboundRouterConfig outboundRouterConfig : outboundRouters)
{
OutboundRouter outRouter = outboundRouterConfig.getRouter();
@@ -333,13 +326,9 @@
}
else
{
- Message outMessage = message;
+ // TODO: Optimize... only clone if we need to...
+ Message outMessage = cloneMessage(message);
- if (cloneOutboundMessages)
- {
- outMessage = cloneMessage(message);
- }
-
try
{
applyOutboundProcessors(outMessage, outboundRouterConfig.getProcessors());
@@ -372,10 +361,11 @@
/**
* Create a full clone of the supplied message.
+ *
* @param message The message to be cloned.
* @return A full clone of the message.
*/
- private Message cloneMessage(final Message message)
+ protected final Message cloneMessage(final Message message)
{
try
{
@@ -414,26 +404,16 @@
}
/**
- * Set the ServiceName.
+ * Get the router name.
*
- * @return The ServiceName.
+ * @return The router name.
*/
- public final ServiceName getServiceName()
+ public final String getRouterName()
{
- return serviceName;
+ return routerName;
}
/**
- * Get the ServiceName.
- *
- * @param serviceName The ServiceName.
- */
- public final void setServiceName(final ServiceName serviceName)
- {
- this.serviceName = serviceName;
- }
-
- /**
* Get inbound processors.
*
* @return The inbound processors.
@@ -454,63 +434,12 @@
}
/**
- * Get the Service.
- *
- * @return The Service.
- */
- public final ServiceConfig getService()
- {
- return service;
- }
-
- /**
- * Set the Service.
- *
- * @param service The Service.
- */
- public final void setService(final ServiceConfig service)
- {
- this.service = service;
- }
-
- /**
- * Set the Outbound Routers.
- *
- * @return The Outbound Routers.
- */
- public final List<OutboundRouterConfig> getOutboundRouters()
- {
- return outboundRouters;
- }
-
- /**
- * Get the Outbound Routers.
- *
- * @param outboundRouters The Outbound Routers.
- */
- public final void setOutboundRouters(final List<OutboundRouterConfig> outboundRouters)
- {
- this.outboundRouters = outboundRouters;
-
- // If there are any processors on any of the outbound routers, we need to clone
- // the message before applying each router.
- for (OutboundRouterConfig outboundRouter : outboundRouters)
- {
- if (outboundRouter.getProcessors() != null && !outboundRouter.getProcessors().isEmpty())
- {
- this.cloneOutboundMessages = true;
- break;
- }
- }
- }
-
- /**
* Route the supplied message to the Dead Letter Service.
*
* @param theMessage The message.
* @param theFault The fault that triggered the routing of the message to the Dead Letter Service.
*/
- protected void routeToDeadLetterService(final Message theMessage, final Throwable theFault)
+ protected final void routeToDeadLetterService(final Message theMessage, final Throwable theFault)
{
if (!routeToDeadLetterService(theMessage, theFault, serviceInvoker))
{
Added: labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/dispatch/DispatchChain.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/dispatch/DispatchChain.java (rev 0)
+++ labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/dispatch/DispatchChain.java 2008-10-07 14:16:03 UTC (rev 23349)
@@ -0,0 +1,112 @@
+/*
+ * 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.dispatch;
+
+import org.jboss.esb.deploy.config.OutboundRouterConfig;
+import org.jboss.esb.deploy.config.ServiceConfig;
+import org.jboss.esb.service.ServiceName;
+import org.jboss.esb.util.AssertArgument;
+
+import java.util.List;
+
+/**
+ * Message Dispatch Chain.
+ * <p/>
+ * Messages are dispatched (from an InboundRouter) to a Service instance and then out through
+ * a set of one or more {@link org.jboss.esb.routing.OutboundRouter outbound routers}. A
+ * Dispatch Chain manages the associations between the Service instance and the outbound routers.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class DispatchChain
+{
+ /**
+ * The name of the Service this DispatchChain is associated with.
+ */
+ private ServiceName serviceName;
+ /**
+ * The Service configuration for the Service.
+ */
+ private ServiceConfig serviceConfig;
+ /**
+ * List of Outbound routers defined in the configuration.
+ */
+ private List<OutboundRouterConfig> outboundRouters;
+
+ /**
+ * Public constructor.
+ *
+ * @param serviceName The name of the Service this DispatchChain is associated with.
+ */
+ public DispatchChain(final ServiceName serviceName)
+ {
+ AssertArgument.isNotNull(serviceName, "serviceName");
+ this.serviceName = serviceName;
+ }
+
+ /**
+ * Get the name of the service that this DispatchChain is associated with.
+ * @return The name of the service that this DispatchChain is associated with.
+ */
+ public final ServiceName getServiceName()
+ {
+ return serviceName;
+ }
+
+ /**
+ * Get the Service configuration.
+ *
+ * @return The Service configuration.
+ */
+ public final ServiceConfig getServiceConfig()
+ {
+ return serviceConfig;
+ }
+
+ /**
+ * Set the Service configuration.
+ *
+ * @param serviceConfig The Service configuration.
+ */
+ public final void setServiceConfig(final ServiceConfig serviceConfig)
+ {
+ this.serviceConfig = serviceConfig;
+ }
+
+ /**
+ * Get the OutboundRouters associated with the Service.
+ *
+ * @return The OutboundRouters associated with the Service.
+ */
+ public final List<OutboundRouterConfig> getOutboundRouters()
+ {
+ return outboundRouters;
+ }
+
+ /**
+ * Set the OutboundRouters associated with the Service.
+ *
+ * @param outboundRouters The OutboundRouters associated with the Service.
+ */
+ public final void setOutboundRouters(final List<OutboundRouterConfig> outboundRouters)
+ {
+ this.outboundRouters = outboundRouters;
+ }
+}
Property changes on: labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/dispatch/DispatchChain.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/dispatch/FilteredDispatchChain.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/dispatch/FilteredDispatchChain.java (rev 0)
+++ labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/dispatch/FilteredDispatchChain.java 2008-10-07 14:16:03 UTC (rev 23349)
@@ -0,0 +1,80 @@
+/*
+ * 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.dispatch;
+
+import org.jboss.esb.deploy.config.InboundRouterFilterConfig;
+
+/**
+ * Filtered Dispatch Chain.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class FilteredDispatchChain
+{
+ /**
+ * Inbound filter configuration.
+ */
+ private InboundRouterFilterConfig filterConfig;
+ /**
+ * The DispatchChain.
+ */
+ private DispatchChain dispatchChain;
+
+ /**
+ * Get the filter configuration.
+ *
+ * @return The filter configuration.
+ */
+ public final InboundRouterFilterConfig getFilterConfig()
+ {
+ return filterConfig;
+ }
+
+ /**
+ * Set the filter configuration.
+ *
+ * @param filterConfig The filter configuration.
+ */
+ public final void setFilterConfig(final InboundRouterFilterConfig filterConfig)
+ {
+ this.filterConfig = filterConfig;
+ }
+
+ /**
+ * Get the Dispatch Chain.
+ *
+ * @return The Dispatch Chain.
+ */
+ public final DispatchChain getDispatchChain()
+ {
+ return dispatchChain;
+ }
+
+ /**
+ * Set the Dispatch Chain.
+ *
+ * @param dispatchChain The Dispatch Chain.
+ */
+
+ public final void setDispatchChain(final DispatchChain dispatchChain)
+ {
+ this.dispatchChain = dispatchChain;
+ }
+}
Property changes on: labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/dispatch/FilteredDispatchChain.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/dispatch/LocalDispatcher.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/dispatch/LocalDispatcher.java 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/dispatch/LocalDispatcher.java 2008-10-07 14:16:03 UTC (rev 23349)
@@ -23,11 +23,14 @@
import org.jboss.esb.context.AddressingContext;
import org.jboss.esb.context.DeploymentContext;
import org.jboss.esb.context.InvocationContext;
+import org.jboss.esb.deploy.config.InboundRouterFilterConfig;
+import org.jboss.esb.history.ProcessingEventLog;
import org.jboss.esb.message.Message;
import org.jboss.esb.util.AssertArgument;
-import org.jboss.esb.history.ProcessingEventLog;
-import org.jboss.esb.service.ServiceName;
+import org.jboss.esb.routing.FilterEvaluator;
+import java.util.List;
+
/**
* Local message dispatcher.
*
@@ -40,44 +43,32 @@
*/
private static Logger logger = Logger.getLogger(LocalDispatcher.class);
/**
- * ReplyTo Address.
+ * Dispatch chains.
*/
- private ServiceName replyTo;
- /**
- * FaultTo Address.
- */
- private ServiceName faultTo;
+ private List<FilteredDispatchChain> filteredDispatchChains;
/**
* Public constructor.
*
+ * @param routerName Router name.
* @param deploymentContext The deployment context with which this
- * dispatcher is associated.
*/
- public LocalDispatcher(final DeploymentContext deploymentContext)
+ public LocalDispatcher(final String routerName, final DeploymentContext deploymentContext)
{
- super(deploymentContext);
+ super(routerName, deploymentContext);
}
/**
- * Set the "replyTo" address.
- * @param replyTo The "replyTo" address.
+ * Set the filtered dispatch chains on the dispatcher.
+ *
+ * @param filteredDispatchChains The dispatch chains.
*/
- public final void setReplyTo(final ServiceName replyTo)
+ public final void setFilteredDispatchChains(final List<FilteredDispatchChain> filteredDispatchChains)
{
- this.replyTo = replyTo;
+ this.filteredDispatchChains = filteredDispatchChains;
}
/**
- * Set the "faultTo" address.
- * @param faultTo The "faultTo" address.
- */
- public final void setFaultTo(final ServiceName faultTo)
- {
- this.faultTo = faultTo;
- }
-
- /**
* Dispatch method.
* <p/>
* Receives a message, applies the set of processors to it, passes it to
@@ -96,47 +87,71 @@
DeploymentContext.setContext(getDeploymentContext());
try
{
- AddressingContext addressingContext = new AddressingContext();
-
- addressingContext.setTo(getServiceName());
- addressingContext.setReplyTo(replyTo);
- addressingContext.setFaultTo(faultTo);
-
- AddressingContext.setContext(addressingContext);
+ InvocationContext.setContext(invocationContext);
try
{
- InvocationContext.setContext(invocationContext);
try
{
- try
+ // Apply the inbound routers processors. More may be applied
+ // as per the Filter configs...
+ applyProcessors(message, getProcessors());
+ }
+ catch (Throwable t)
+ {
+ // The message must make it past the inbound processors...
+ String errorMessage = "Exception applying Inbound Processors for InboundRouter '" + getRouterName() + "'. Rejecting message. Fix Processor!";
+
+ logger.error(errorMessage, t);
+ throw new IllegalStateException(errorMessage, t);
+ }
+
+ if (filteredDispatchChains != null && !filteredDispatchChains.isEmpty())
+ {
+ for (FilteredDispatchChain filteredDispatchChain : filteredDispatchChains)
{
- applyInboundProcessors(message);
- }
- catch (Throwable t)
- {
- // The message must make it past the inbound processors...
- String errorMessage = "Exception applying Inbound Processors to Service '" + getServiceName() + "'. Rejecting message. Fix Processor!";
+ InboundRouterFilterConfig filterConfig = filteredDispatchChain.getFilterConfig();
+ FilterEvaluator filterEvaluator = filterConfig.getEvaluator();
- logger.error(errorMessage, t);
- throw new IllegalStateException(errorMessage, t);
- }
- outMessage = dispatchToService(message);
- applyOutboundRouters(outMessage);
+ if (filterEvaluator == null || filterEvaluator.filterMessage(message))
+ {
+ DispatchChain dispatchChain = filteredDispatchChain.getDispatchChain();
+ AddressingContext addressingContext = new AddressingContext();
- // Make sure the message was processed...
- if(ProcessingEventLog.getEventLog().getProcessingEvents().isEmpty())
- {
- throw new IllegalStateException("Message not processed for Service Name '" + getServiceName() + "'. No Service instance or Outbound Router instances applied.");
+ addressingContext.setTo(filterConfig.getTo());
+ addressingContext.setReplyTo(filterConfig.getReplyTo());
+ addressingContext.setFaultTo(filterConfig.getFaultTo());
+
+ AddressingContext.setContext(addressingContext);
+ try
+ {
+ Message dispatchMessage = message;
+
+ if(filteredDispatchChains.size() > 1)
+ {
+ // TODO: Optimize... only clone if we need to. Iterate the FilteredDispatchChain list first and find out how many will be applied.
+ dispatchMessage = cloneMessage(message);
+ }
+
+ outMessage = dispatchToService(dispatchMessage, dispatchChain.getServiceConfig(), filterConfig.getProcessors());
+ applyOutboundRouters(outMessage, dispatchChain.getServiceName(), dispatchChain.getOutboundRouters());
+
+ // Log the event...
+ if (ProcessingEventLog.getEventLog().getProcessingEvents().isEmpty())
+ {
+ throw new IllegalStateException("Message not processed for Service Name '" + dispatchChain.getServiceName() + "'. No Service instance or Outbound Router instances applied.");
+ }
+ }
+ finally
+ {
+ AddressingContext.setContext(null);
+ }
+ }
}
}
- finally
- {
- InvocationContext.setContext(null);
- }
}
finally
{
- AddressingContext.setContext(null);
+ InvocationContext.setContext(null);
}
}
finally
Modified: labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/federate/bus/BusDispatcher.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/federate/bus/BusDispatcher.java 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/federate/bus/BusDispatcher.java 2008-10-07 14:16:03 UTC (rev 23349)
@@ -23,6 +23,7 @@
import org.jboss.esb.context.DeploymentContext;
import org.jboss.esb.context.InvocationContext;
import org.jboss.esb.dispatch.AbstractDispatcher;
+import org.jboss.esb.dispatch.DispatchChain;
import org.jboss.esb.message.Message;
import org.jboss.esb.service.ServiceName;
import org.jboss.esb.util.AssertArgument;
@@ -38,14 +39,20 @@
public class BusDispatcher extends AbstractDispatcher
{
/**
+ * The Service dispatch chain.
+ */
+ private DispatchChain dispatchChain;
+
+ /**
* Public constructor.
*
* @param deploymentContext The deployment context with which this
- * dispatcher is associated.
+ * @param dispatchChain The Service dispatch chain.
*/
- public BusDispatcher(final DeploymentContext deploymentContext)
+ public BusDispatcher(final DeploymentContext deploymentContext, final DispatchChain dispatchChain)
{
- super(deploymentContext);
+ super("BusInRouter", deploymentContext);
+ this.dispatchChain = dispatchChain;
}
/**
@@ -78,17 +85,15 @@
// Only pass the message to the service if the from address
// is null (i.e. it's from an InRouter or client), or it is from
// a different service....
- if (from == null || !from.equals(getServiceName()))
+ if (from == null || !from.equals(dispatchChain.getServiceName()))
{
- outMessage = dispatchToService(message);
+ outMessage = dispatchToService(message, dispatchChain.getServiceConfig(), null);
}
else
{
outMessage = message;
}
- applyOutboundRouters(outMessage);
-
- // TODO; Use the faultTo address if there's an issue??
+ applyOutboundRouters(outMessage, dispatchChain.getServiceName(), dispatchChain.getOutboundRouters());
}
finally
{
Added: labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/filter/FilterDecisionNode.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/filter/FilterDecisionNode.java (rev 0)
+++ labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/filter/FilterDecisionNode.java 2008-10-07 14:16:03 UTC (rev 23349)
@@ -0,0 +1,92 @@
+/*
+ * 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.filter;
+
+import org.jboss.esb.message.Message;
+import org.jboss.esb.routing.FilterEvaluator;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Filter decision node.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class FilterDecisionNode implements FilterEvaluator
+{
+ /**
+ * The filter evaluator for this decision node.
+ */
+ private FilterEvaluator evaluator;
+ /**
+ * The sub-filter decision nodes.
+ */
+ private List<FilterDecisionNode> subFilters = new ArrayList<FilterDecisionNode>();
+
+ /**
+ * Set the filter evaluator.
+ *
+ * @param evaluator The evaluator.
+ */
+ public final void setFilterEvaluator(final FilterEvaluator evaluator)
+ {
+ this.evaluator = evaluator;
+ }
+
+ /**
+ * Filter the message.
+ *
+ * @param message The message to be evaluated.
+ * @return True if the message is to be filtered through. False if the message is to be filtered out.
+ */
+ public final boolean filterMessage(final Message message)
+ {
+ if (evaluator != null && !evaluator.filterMessage(message))
+ {
+ return false;
+ }
+
+ if (subFilters.isEmpty())
+ {
+ return true;
+ }
+
+ for (FilterEvaluator subFilter : subFilters)
+ {
+ if (subFilter.filterMessage(message))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Get the sub-filters associated with this filter decision node.
+ *
+ * @return The sub-filters associated with this filter decision node.
+ */
+ public final List<FilterDecisionNode> getSubFilters()
+ {
+ return subFilters;
+ }
+}
Property changes on: labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/filter/FilterDecisionNode.java
___________________________________________________________________
Name: svn:eol-style
+ native
Copied: labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/filter/package.html (from rev 23293, labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/history/package.html)
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/filter/package.html (rev 0)
+++ labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/filter/package.html 2008-10-07 14:16:03 UTC (rev 23349)
@@ -0,0 +1,8 @@
+<html>
+<head></head>
+<body>
+Message Filtering.
+
+<h2>Package Specification</h2>
+</body>
+</html>
\ No newline at end of file
Modified: labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/test/JBossESBTestCase.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/test/JBossESBTestCase.java 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/test/JBossESBTestCase.java 2008-10-07 14:16:03 UTC (rev 23349)
@@ -49,7 +49,7 @@
* <p/>
* <pre>
* public class SimpleTest extends JBossESBTestCase {
- *
+ *
* public SimpleTest() {
* // Use the JMS Bus Provider...
* super(new JmsTestBusProvider());
@@ -79,8 +79,8 @@
*
* // Get a handle on the test inrouter and outrouter components from
* // the DeploymentRuntime instances that host them...
- * TestInRouter inrouterA = (TestInRouter) DeploymentUtil.getInboundRouter(serviceA, "inrouterA", deployment1).getRouter();
- * TestOutRouter outrouterF = (TestOutRouter) DeploymentUtil.getOutboundRouter(serviceF, "outrouterF", deployment3).getRouter();
+ * TestInRouter inrouterA = (TestInRouter) {@link org.jboss.esb.routing.InboundRouter DeploymentUtil.getInboundRouter}(serviceA, "inrouterA", deployment1).getRouter();
+ * TestOutRouter outrouterF = (TestOutRouter) {@link org.jboss.esb.routing.OutboundRouter DeploymentUtil.getOutboundRouter}(serviceF, "outrouterF", deployment3).getRouter();
*
* // Send a message in through the test inrouter and wait for it to
* // be routed to the test outrouter (timeout after 10 seconds)...
Modified: labs/jbossesb/workspace/skeagh/runtime/src/main/resources/META-INF/jbossesb/xsd/inrouters-smooks.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/main/resources/META-INF/jbossesb/xsd/inrouters-smooks.xml 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/main/resources/META-INF/jbossesb/xsd/inrouters-smooks.xml 2008-10-07 14:16:03 UTC (rev 23349)
@@ -4,30 +4,6 @@
default-selector-namespace="http://www.jboss.org/jbossesb/xsd/jbossesb-5.0.xsd">
<!--
- Service Name ("serviceName")...
- -->
-
- <resource-config selector="inRouters">
- <resource>org.jboss.esb.deploy.config.digest.CreateObject</resource>
- <param name="beanId">serviceName</param>
- <param name="className">org.jboss.esb.service.ServiceName</param>
- </resource-config>
-
- <resource-config selector="inRouters">
- <resource>org.jboss.esb.deploy.config.digest.SetProperty</resource>
- <param name="beanId">serviceName</param> <!-- Created above. -->
- <param name="property">category</param>
- <param name="valueAttrib">serviceCategory</param>
- </resource-config>
-
- <resource-config selector="inRouters">
- <resource>org.jboss.esb.deploy.config.digest.SetProperty</resource>
- <param name="beanId">serviceName</param> <!-- Created above. -->
- <param name="property">name</param>
- <param name="valueAttrib">serviceName</param>
- </resource-config>
-
- <!--
InRouters ("inRouters")...
-->
@@ -36,12 +12,10 @@
</jb:bindings>
<jb:bindings beanId="inRouterConfig" class="org.jboss.esb.deploy.config.InboundRouterConfig" createOnElement="inRouter">
+ <jb:value property="name" data="inRouter/@name" />
<jb:wiring property="serviceName" beanIdRef="serviceName" />
<jb:wiring property="router" beanIdRef="inRouter" />
<jb:wiring property="processors" beanIdRef="inrouter-processors" />
- <jb:wiring property="replyTo" beanIdRef="replyTo" />
- <jb:wiring property="faultTo" beanIdRef="faultTo" />
- <jb:value property="name" data="inRouter/@name" />
</jb:bindings>
<resource-config selector="inRouter">
@@ -58,72 +32,113 @@
</resource-config>
<!--
- "replyTo" Service Name...
+ inRouter processors
-->
- <resource-config selector="replyTo">
+ <jb:bindings beanId="inrouter-processors" class="java.util.ArrayList" createOnElement="inRouter/processors">
+ <jb:wiring beanIdRef="inrouter-processor" />
+ </jb:bindings>
+
+ <resource-config selector="inRouter/processors/processor">
<resource>org.jboss.esb.deploy.config.digest.CreateObject</resource>
- <param name="beanId">replyTo</param>
+ <param name="beanId">inrouter-processor</param> <!-- Wired in above. -->
+ <param name="classAttrib">class</param>
+ <param name="expectedType">org.jboss.esb.message.MessageProcessor</param>
+ </resource-config>
+
+ <resource-config selector="inRouter/processors/processor/property">
+ <resource>org.jboss.esb.deploy.config.digest.SetProperty</resource>
+ <param name="beanId">inrouter-processor</param> <!-- Created above. -->
+ <param name="nameAttrib">name</param>
+ </resource-config>
+
+ <!--
+ Filtering...
+ -->
+
+ <jb:bindings beanId="inRouterFilters" class="java.util.ArrayList" createOnElement="inRouters/filters">
+ <jb:wiring beanIdRef="inRouterFilter" />
+ </jb:bindings>
+ <jb:bindings beanId="inRouterFilter" class="org.jboss.esb.deploy.config.InboundRouterFilterConfig" createOnElement="inRouters/filters/filter">
+ <jb:value property="inRouterName" data="filter/@inRouter" />
+ <jb:wiring property="evaluator" beanIdRef="filterEvaluator" />
+ <jb:wiring property="to" beanIdRef="toSN" />
+ <jb:wiring property="replyTo" beanIdRef="replyToSN" />
+ <jb:wiring property="faultTo" beanIdRef="faultToSN" />
+ </jb:bindings>
+
+ <resource-config selector="evaluator">
+ <resource>org.jboss.esb.deploy.config.digest.FilterDecisionTreeBuilder</resource>
+ <param name="beanId">filterEvaluator</param>
+ </resource-config>
+
+ <!--
+ Filter "to" Service Name ("serviceName")...
+ -->
+ <resource-config selector="filter/to">
+ <resource>org.jboss.esb.deploy.config.digest.CreateObject</resource>
+ <param name="beanId">toSN</param>
<param name="className">org.jboss.esb.service.ServiceName</param>
</resource-config>
- <resource-config selector="replyTo">
+ <resource-config selector="filter/to">
<resource>org.jboss.esb.deploy.config.digest.SetProperty</resource>
- <param name="beanId">replyTo</param> <!-- Created above. -->
+ <param name="beanId">toSN</param> <!-- Created above. -->
<param name="property">category</param>
<param name="valueAttrib">serviceCategory</param>
</resource-config>
- <resource-config selector="replyTo">
+ <resource-config selector="filter/to">
<resource>org.jboss.esb.deploy.config.digest.SetProperty</resource>
- <param name="beanId">replyTo</param> <!-- Created above. -->
+ <param name="beanId">toSN</param> <!-- Created above. -->
<param name="property">name</param>
<param name="valueAttrib">serviceName</param>
</resource-config>
<!--
- "faultTo" Service Name...
+ Filter "replyTo" Service Name ("serviceName")...
-->
-
- <resource-config selector="faultTo">
+ <resource-config selector="filter/replyTo">
<resource>org.jboss.esb.deploy.config.digest.CreateObject</resource>
- <param name="beanId">faultTo</param>
+ <param name="beanId">replyToSN</param>
<param name="className">org.jboss.esb.service.ServiceName</param>
</resource-config>
- <resource-config selector="faultTo">
+ <resource-config selector="filter/replyTo">
<resource>org.jboss.esb.deploy.config.digest.SetProperty</resource>
- <param name="beanId">faultTo</param> <!-- Created above. -->
+ <param name="beanId">replyToSN</param> <!-- Created above. -->
<param name="property">category</param>
<param name="valueAttrib">serviceCategory</param>
</resource-config>
- <resource-config selector="faultTo">
+ <resource-config selector="filter/replyTo">
<resource>org.jboss.esb.deploy.config.digest.SetProperty</resource>
- <param name="beanId">faultTo</param> <!-- Created above. -->
+ <param name="beanId">replyToSN</param> <!-- Created above. -->
<param name="property">name</param>
<param name="valueAttrib">serviceName</param>
</resource-config>
<!--
- inRouter processors
+ Filter "faultTo" Service Name ("serviceName")...
-->
-
- <jb:bindings beanId="inrouter-processors" class="java.util.ArrayList" createOnElement="inRouter/processors">
- <jb:wiring beanIdRef="inrouter-processor" />
- </jb:bindings>
-
- <resource-config selector="inRouter/processors/processor">
+ <resource-config selector="filter/faultTo">
<resource>org.jboss.esb.deploy.config.digest.CreateObject</resource>
- <param name="beanId">inrouter-processor</param> <!-- Wired in above. -->
- <param name="classAttrib">class</param>
- <param name="expectedType">org.jboss.esb.message.MessageProcessor</param>
+ <param name="beanId">faultToSN</param>
+ <param name="className">org.jboss.esb.service.ServiceName</param>
</resource-config>
- <resource-config selector="inRouter/processors/processor/property">
+ <resource-config selector="filter/faultTo">
<resource>org.jboss.esb.deploy.config.digest.SetProperty</resource>
- <param name="beanId">inrouter-processor</param> <!-- Created above. -->
- <param name="nameAttrib">name</param>
+ <param name="beanId">faultToSN</param> <!-- Created above. -->
+ <param name="property">category</param>
+ <param name="valueAttrib">serviceCategory</param>
</resource-config>
+ <resource-config selector="filter/faultTo">
+ <resource>org.jboss.esb.deploy.config.digest.SetProperty</resource>
+ <param name="beanId">faultToSN</param> <!-- Created above. -->
+ <param name="property">name</param>
+ <param name="valueAttrib">serviceName</param>
+ </resource-config>
+
</smooks-resource-list>
\ No newline at end of file
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-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/main/resources/META-INF/jbossesb/xsd/jbossesb-5.0.xsd 2008-10-07 14:16:03 UTC (rev 23349)
@@ -132,6 +132,17 @@
<xs:attribute name="serviceName" use="required" type="xs:string"/>
</xs:complexType>
+ <xs:complexType name="evaluator">
+ <xs:annotation>
+ <xs:documentation xml:lang="en">Filter Evaluator.</xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:element name="property" type="property" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="evaluator" type="evaluator" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="class" use="optional" type="xs:string"/>
+ </xs:complexType>
+
<!--
In Routing...
-->
@@ -139,9 +150,8 @@
<xs:complexType name="inRouters">
<xs:sequence>
<xs:element ref="abstractInRouter" minOccurs="1" maxOccurs="unbounded"/>
+ <xs:element name="filters" type="filters" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
- <xs:attribute name="serviceCategory" use="required" type="xs:string"/>
- <xs:attribute name="serviceName" use="required" type="xs:string"/>
</xs:complexType>
<xs:complexType name="abstractInRouter" abstract="true">
@@ -157,8 +167,6 @@
<xs:complexContent>
<xs:extension base="abstractInRouter">
<xs:sequence>
- <xs:element name="replyTo" type="address" minOccurs="0" maxOccurs="1"/>
- <xs:element name="faultTo" type="address" minOccurs="0" maxOccurs="1"/>
<xs:element name="property" type="property" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="class" type="xs:string" use="required" />
@@ -167,6 +175,26 @@
</xs:complexType>
</xs:element>
+ <xs:complexType name="filters">
+ <xs:sequence>
+ <xs:element name="filter" type="infilter" minOccurs="1" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="infilter">
+ <xs:annotation>
+ <xs:documentation xml:lang="en">Inbound router filter.</xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:element name="evaluator" type="evaluator" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="to" type="address" minOccurs="1" maxOccurs="1"/>
+ <xs:element name="replyTo" type="address" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="faultTo" type="address" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="processors" type="processors" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="inRouter" use="required" type="xs:string"/>
+ </xs:complexType>
+
<!--
Out Routing...
-->
@@ -181,6 +209,7 @@
<xs:complexType name="abstractOutRouter" abstract="true">
<xs:sequence>
+ <xs:element name="filter" type="outfilter" minOccurs="0" maxOccurs="1"/>
<xs:element name="processors" type="processors" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required" />
@@ -200,4 +229,13 @@
</xs:complexType>
</xs:element>
+ <xs:complexType name="outfilter">
+ <xs:annotation>
+ <xs:documentation xml:lang="en">Outbound router filter.</xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:element name="evaluator" type="evaluator" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
</xs:schema>
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-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/DefaultConfigurationDigesterTest.java 2008-10-07 14:16:03 UTC (rev 23349)
@@ -84,33 +84,6 @@
test_outrouters(configUnit);
}
- @Test
- public void test_inrouters_02() throws DeploymentException, IOException
- {
- DeploymentUnit configUnit = digest("jbossesb-inrouters_02.xml");
- Map<ServiceName, List<InboundRouterConfig>> inRouters = configUnit.getInboundRouters();
- InboundRouterConfig routerConfig;
-
- List<InboundRouterConfig> cRouterConfigs = inRouters.get(new ServiceName("service-cat", "service-c"));
- assertEquals(4, cRouterConfigs.size());
-
- routerConfig = cRouterConfigs.get(0);
- assertEquals(new ServiceName("cat", "s1"), routerConfig.getReplyTo());
- assertEquals(null, routerConfig.getFaultTo());
-
- routerConfig = cRouterConfigs.get(1);
- assertEquals(null, routerConfig.getReplyTo());
- assertEquals(new ServiceName("cat", "s2"), routerConfig.getFaultTo());
-
- routerConfig = cRouterConfigs.get(2);
- assertEquals(new ServiceName("cat", "s3"), routerConfig.getReplyTo());
- assertEquals(new ServiceName("cat", "s4"), routerConfig.getFaultTo());
-
- routerConfig = cRouterConfigs.get(3);
- assertEquals(null, routerConfig.getReplyTo());
- assertEquals(null, routerConfig.getFaultTo());
- }
-
private void test_inrouters(String config) throws IOException, DeploymentException
{
DeploymentUnit configUnit = digest(config);
@@ -119,13 +92,13 @@
private void test_inrouters(DeploymentUnit configUnit)
{
- Map<ServiceName, List<InboundRouterConfig>> inRouters = configUnit.getInboundRouters();
+ Map<String, InboundRouterConfig> inRouters = configUnit.getInboundRouters();
+ List<InboundRouterFilterConfig> filters;
- List<InboundRouterConfig> aRouterConfigs = inRouters.get(new ServiceName("service-cat", "service-a"));
- assertNotNull(aRouterConfigs);
- assertEquals(2, aRouterConfigs.size());
+ assertNotNull(inRouters);
+ assertEquals(4, inRouters.size());
- InboundRouterConfig routerConfig = aRouterConfigs.get(0);
+ InboundRouterConfig routerConfig = inRouters.get("inrouter1");
assertEquals("inrouter1", routerConfig.getName());
assertEquals("1", ((MyInRouter) routerConfig.getRouter()).getMyparam());
List<MessageProcessor> processors = routerConfig.getProcessors();
@@ -133,31 +106,40 @@
assertEquals(1, ((MyMessageTransformer) processors.get(0)).getSomeParam());
assertEquals(2, ((MyMessageTransformer) processors.get(1)).getSomeParam());
assertEquals(3, ((MyMessageTransformer) processors.get(2)).getSomeParam());
+ filters = routerConfig.getFilters();
+ assertEquals(1, filters.size());
+ assertEquals("service-cat:service-a", filters.get(0).getTo().toString());
- routerConfig = aRouterConfigs.get(1);
+ routerConfig = inRouters.get("inrouter2");
assertEquals("inrouter2", routerConfig.getName());
assertEquals("2", ((MyInRouter) routerConfig.getRouter()).getMyparam());
processors = routerConfig.getProcessors();
assertEquals(2, processors.size());
assertEquals(4, ((MyMessageTransformer) processors.get(0)).getSomeParam());
assertEquals(5, ((MyMessageTransformer) processors.get(1)).getSomeParam());
+ filters = routerConfig.getFilters();
+ assertEquals(1, filters.size());
+ assertEquals("service-cat:service-a", filters.get(0).getTo().toString());
- List<InboundRouterConfig> bRouterConfigs = inRouters.get(new ServiceName("service-cat", "service-b"));
- assertNotNull(bRouterConfigs);
- assertEquals(2, bRouterConfigs.size());
- routerConfig = bRouterConfigs.get(0);
+ routerConfig = inRouters.get("inrouter3");
assertEquals("inrouter3", routerConfig.getName());
assertEquals("4", ((MyInRouter) routerConfig.getRouter()).getMyparam());
processors = routerConfig.getProcessors();
assertEquals(1, processors.size());
assertEquals(6, ((MyMessageTransformer) processors.get(0)).getSomeParam());
+ filters = routerConfig.getFilters();
+ assertEquals(1, filters.size());
+ assertEquals("service-cat:service-b", filters.get(0).getTo().toString());
- routerConfig = bRouterConfigs.get(1);
+ routerConfig = inRouters.get("inrouter4");
assertEquals("inrouter4", routerConfig.getName());
assertEquals("5", ((MyInRouter) routerConfig.getRouter()).getMyparam());
assertEquals(5, ((MyInRouter) routerConfig.getRouter()).getMyOtherParam());
processors = routerConfig.getProcessors();
assertNull(processors);
+ filters = routerConfig.getFilters();
+ assertEquals(1, filters.size());
+ assertEquals("service-cat:service-b", filters.get(0).getTo().toString());
}
private void test_outrouters(String config) throws IOException, DeploymentException
@@ -242,20 +224,24 @@
DeploymentUnit configUnit = digest("jbossesb-services_02.xml");
ServiceName serviceName = new ServiceName("service-cat", "service-a");
Map<ServiceName, ServiceConfig> services = configUnit.getServices();
- Map<ServiceName, List<InboundRouterConfig>> inrouters = configUnit.getInboundRouters();
+ Map<String, InboundRouterConfig> inrouters = configUnit.getInboundRouters();
Map<ServiceName, List<OutboundRouterConfig>> outrouters = configUnit.getOutboundRouters();
+ List<InboundRouterFilterConfig> filters;
ServiceConfig serviceAConfig = services.get(serviceName);
assertNotNull(serviceAConfig);
assertEquals("A Service", serviceAConfig.getDescription());
- InboundRouterConfig inRouter = inrouters.get(serviceName).get(0);
+ InboundRouterConfig inRouter = inrouters.get("inrouter1");
assertEquals("inrouter1", inRouter.getName());
assertTrue(inRouter.getRouter() instanceof MyInRouter);
assertEquals("1", ((MyInRouter)inRouter.getRouter()).getMyparam());
List<MessageProcessor> inProcessors = inRouter.getProcessors();
assertTrue(inProcessors.get(0) instanceof MyMessageTransformer);
assertEquals(1, ((MyMessageTransformer)inProcessors.get(0)).getSomeParam());
+ filters = inRouter.getFilters();
+ assertEquals(1, filters.size());
+ assertEquals("service-cat:service-a", filters.get(0).getTo().toString());
OutboundRouterConfig outRouter = outrouters.get(serviceName).get(0);
assertEquals("outrouter1", outRouter.getName());
@@ -272,20 +258,23 @@
DeploymentUnit configUnit = digest("jbossesb-services_03.xml");
ServiceName serviceName = new ServiceName("service-cat", "service-a");
Map<ServiceName, ServiceConfig> services = configUnit.getServices();
- Map<ServiceName, List<InboundRouterConfig>> inrouters = configUnit.getInboundRouters();
+ Map<String, InboundRouterConfig> inrouters = configUnit.getInboundRouters();
Map<ServiceName, List<OutboundRouterConfig>> outrouters = configUnit.getOutboundRouters();
ServiceConfig serviceAConfig = services.get(serviceName);
assertNotNull(serviceAConfig);
assertEquals("A Service", serviceAConfig.getDescription());
- InboundRouterConfig inRouter = inrouters.get(serviceName).get(0);
+ InboundRouterConfig inRouter = inrouters.get("inrouter1");
assertEquals("inrouter1", inRouter.getName());
assertTrue(inRouter.getRouter() instanceof MyInRouter);
assertEquals("1", ((MyInRouter)inRouter.getRouter()).getMyparam());
List<MessageProcessor> inProcessors = inRouter.getProcessors();
assertTrue(inProcessors.get(0) instanceof MyMessageTransformer);
assertEquals(1, ((MyMessageTransformer)inProcessors.get(0)).getSomeParam());
+ List<InboundRouterFilterConfig> filters = inRouter.getFilters();
+ assertEquals(1, filters.size());
+ assertEquals("service-cat:service-a", filters.get(0).getTo().toString());
OutboundRouterConfig outRouter = outrouters.get(serviceName).get(0);
assertEquals("outrouter1", outRouter.getName());
@@ -311,7 +300,7 @@
ServiceName serviceName;
Map<ServiceName, ServiceConfig> services = configUnit.getServices();
- Map<ServiceName, List<InboundRouterConfig>> inrouters = configUnit.getInboundRouters();
+ Map<String, InboundRouterConfig> inrouters = configUnit.getInboundRouters();
Map<ServiceName, List<OutboundRouterConfig>> outrouters = configUnit.getOutboundRouters();
serviceName = new ServiceName("service-cat", "service-a");
@@ -320,7 +309,7 @@
assertNotNull(serviceAConfig);
assertEquals("A Service", serviceAConfig.getDescription());
- InboundRouterConfig inRouter = inrouters.get(serviceName).get(0);
+ InboundRouterConfig inRouter = inrouters.get("inrouter1");
assertEquals("inrouter1", inRouter.getName());
assertTrue(inRouter.getRouter() instanceof MyInRouter);
assertEquals("1", ((MyInRouter)inRouter.getRouter()).getMyparam());
@@ -346,14 +335,14 @@
ServiceName serviceName = new ServiceName("service-cat", "service-a");
Map<ServiceName, ServiceConfig> services = configUnit.getServices();
- Map<ServiceName, List<InboundRouterConfig>> inrouters = configUnit.getInboundRouters();
+ Map<String, InboundRouterConfig> inrouters = configUnit.getInboundRouters();
Map<ServiceName, List<OutboundRouterConfig>> outrouters = configUnit.getOutboundRouters();
ServiceConfig serviceAConfig = services.get(serviceName);
assertNotNull(serviceAConfig);
assertEquals("A Service", serviceAConfig.getDescription());
- InboundRouterConfig inRouter = inrouters.get(serviceName).get(0);
+ InboundRouterConfig inRouter = inrouters.get("inrouter1");
assertEquals("inrouter1", inRouter.getName());
assertTrue(inRouter.getRouter() instanceof MyInRouter);
assertEquals("1", ((MyInRouter)inRouter.getRouter()).getMyparam());
@@ -363,7 +352,7 @@
serviceName = new ServiceName("service-cat", "service-b");
- inRouter = inrouters.get(serviceName).get(0);
+ inRouter = inrouters.get("inrouter2");
assertEquals("inrouter2", inRouter.getName());
assertTrue(inRouter.getRouter() instanceof MyInRouter);
assertEquals("2", ((MyInRouter)inRouter.getRouter()).getMyparam());
@@ -387,14 +376,14 @@
ServiceName serviceName = new ServiceName("service-cat", "service-a");
Map<ServiceName, ServiceConfig> services = configUnit.getServices();
- Map<ServiceName, List<InboundRouterConfig>> inrouters = configUnit.getInboundRouters();
+ Map<String, InboundRouterConfig> inrouters = configUnit.getInboundRouters();
Map<ServiceName, List<OutboundRouterConfig>> outrouters = configUnit.getOutboundRouters();
ServiceConfig serviceAConfig = services.get(serviceName);
assertNotNull(serviceAConfig);
assertEquals("A Service", serviceAConfig.getDescription());
- InboundRouterConfig inRouter = inrouters.get(serviceName).get(0);
+ InboundRouterConfig inRouter = inrouters.get("inrouter3");
assertEquals("inrouter3", inRouter.getName());
assertTrue(inRouter.getRouter() instanceof MyInRouter);
assertEquals("4", ((MyInRouter)inRouter.getRouter()).getMyparam());
@@ -402,7 +391,7 @@
assertTrue(inProcessors.get(0) instanceof MyMessageTransformer);
assertEquals(4, ((MyMessageTransformer)inProcessors.get(0)).getSomeParam());
- inRouter = inrouters.get(serviceName).get(1);
+ inRouter = inrouters.get("inrouter1");
assertEquals("inrouter1", inRouter.getName());
assertTrue(inRouter.getRouter() instanceof MyInRouter);
assertEquals("1", ((MyInRouter)inRouter.getRouter()).getMyparam());
@@ -412,7 +401,7 @@
serviceName = new ServiceName("service-cat", "service-b");
- inRouter = inrouters.get(serviceName).get(0);
+ inRouter = inrouters.get("inrouter2");
assertEquals("inrouter2", inRouter.getName());
assertTrue(inRouter.getRouter() instanceof MyInRouter);
assertEquals("2", ((MyInRouter)inRouter.getRouter()).getMyparam());
@@ -436,14 +425,14 @@
ServiceName serviceName = new ServiceName("service-cat", "service-a");
Map<ServiceName, ServiceConfig> services = configUnit.getServices();
- Map<ServiceName, List<InboundRouterConfig>> inrouters = configUnit.getInboundRouters();
+ Map<String, InboundRouterConfig> inrouters = configUnit.getInboundRouters();
Map<ServiceName, List<OutboundRouterConfig>> outrouters = configUnit.getOutboundRouters();
ServiceConfig serviceAConfig = services.get(serviceName);
assertNotNull(serviceAConfig);
assertEquals("A Service", serviceAConfig.getDescription());
- InboundRouterConfig inRouter = inrouters.get(serviceName).get(0);
+ InboundRouterConfig inRouter = inrouters.get("inrouter3");
assertEquals("inrouter3", inRouter.getName());
assertTrue(inRouter.getRouter() instanceof MyInRouter);
assertEquals("4", ((MyInRouter)inRouter.getRouter()).getMyparam());
@@ -451,7 +440,7 @@
assertTrue(inProcessors.get(0) instanceof MyMessageTransformer);
assertEquals(4, ((MyMessageTransformer)inProcessors.get(0)).getSomeParam());
- inRouter = inrouters.get(serviceName).get(1);
+ inRouter = inrouters.get("inrouter1");
assertEquals("inrouter1", inRouter.getName());
assertTrue(inRouter.getRouter() instanceof MyInRouter);
assertEquals("1", ((MyInRouter)inRouter.getRouter()).getMyparam());
@@ -461,7 +450,7 @@
serviceName = new ServiceName("service-cat", "service-b");
- inRouter = inrouters.get(serviceName).get(0);
+ inRouter = inrouters.get("inrouter2");
assertEquals("inrouter2", inRouter.getName());
assertTrue(inRouter.getRouter() instanceof MyInRouter);
assertEquals("2", ((MyInRouter)inRouter.getRouter()).getMyparam());
Added: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/FilterConfigTest.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/FilterConfigTest.java (rev 0)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/FilterConfigTest.java 2008-10-07 14:16:03 UTC (rev 23349)
@@ -0,0 +1,46 @@
+/*
+ * 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;
+
+import junit.framework.TestCase;
+import org.jboss.esb.deploy.DeploymentException;
+import org.jboss.esb.deploy.config.digest.DefaultConfigurationDigester;
+
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class FilterConfigTest extends TestCase
+{
+
+ public void test() throws DeploymentException, IOException
+ {
+ DeploymentUnit deploymentUnit = digest("jbossesb-inrouters_filters_01.xml");
+ System.out.println("hi");
+
+ }
+
+ private DeploymentUnit digest(String config) throws IOException, DeploymentException
+ {
+ DefaultConfigurationDigester digester = new DefaultConfigurationDigester();
+ return digester.digest(getClass().getResourceAsStream(config));
+ }
+}
Property changes on: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/FilterConfigTest.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/digest/ConfigUtilTest.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/digest/ConfigUtilTest.java (rev 0)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/digest/ConfigUtilTest.java 2008-10-07 14:16:03 UTC (rev 23349)
@@ -0,0 +1,151 @@
+/*
+ * 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.digest;
+
+import junit.framework.TestCase;
+import org.jboss.esb.annotations.Property;
+import org.jboss.esb.deploy.DeploymentException;
+import org.jboss.esb.deploy.config.ConfigUtil;
+
+import java.util.Properties;
+
+/**
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class ConfigUtilTest extends TestCase
+{
+ public void test_simple() throws DeploymentException
+ {
+ Properties properties = new Properties();
+
+ properties.setProperty("stringParam", "a");
+ properties.setProperty("intParam", "123");
+ properties.setProperty("subIntParam", "987");
+
+ B b = new B();
+ ConfigUtil.configure(b, properties);
+ assertEquals("a", b.getStringParam());
+ assertEquals(123, b.getIntParam());
+ assertEquals(987, b.getSubIntParam());
+ }
+
+ public void test_no_defaults_required()
+ {
+ Properties properties = new Properties();
+
+ A a = new A();
+ try
+ {
+ ConfigUtil.configure(a, properties);
+ fail("Expected DeploymentException.");
+ }
+ catch(DeploymentException e)
+ {
+ assertEquals("Required property 'stringParam' is not configured on class 'class org.jboss.esb.deploy.config.digest.ConfigUtilTest$A.", e.getMessage());
+ }
+ }
+
+ public void test_no_defaults_notrequired() throws DeploymentException
+ {
+ Properties properties = new Properties();
+
+ C c = new C();
+ ConfigUtil.configure(c, properties);
+ assertEquals(null, c.stringParam);
+ }
+
+ public void test_no_defaults() throws DeploymentException
+ {
+ Properties properties = new Properties();
+
+ D d = new D();
+ ConfigUtil.configure(d, properties);
+ assertEquals("abcd", d.stringParam);
+ }
+
+ public void test_choice() throws DeploymentException
+ {
+ Properties properties = new Properties();
+
+ properties.setProperty("stringParam", "a");
+ E e = new E();
+ ConfigUtil.configure(e, properties);
+ assertEquals("a", e.stringParam);
+
+ properties.setProperty("stringParam", "b");
+ e = new E();
+ ConfigUtil.configure(e, properties);
+ assertEquals("b", e.stringParam);
+
+ properties.setProperty("stringParam", "c");
+ e = new E();
+ try
+ {
+ ConfigUtil.configure(e, properties);
+ }
+ catch(DeploymentException ex)
+ {
+ assertEquals("Value 'c' for paramater 'stringParam' is invalid. Valid choices for this paramater are: [a, b]", ex.getMessage());
+ }
+ }
+
+ public class A {
+ @Property
+ private String stringParam;
+ @Property
+ private int intParam;
+
+ public String getStringParam()
+ {
+ return stringParam;
+ }
+
+ public int getIntParam()
+ {
+ return intParam;
+ }
+ }
+
+ public class B extends A {
+ @Property
+ private int subIntParam;
+
+ public int getSubIntParam()
+ {
+ return subIntParam;
+ }
+ }
+
+ public class C {
+ @Property(use = Property.Use.OPTIONAL)
+ private String stringParam;
+ }
+
+ public class D {
+ @Property(defaultVal = "abcd")
+ private String stringParam;
+ }
+
+ public class E {
+ @Property(choice = {"a", "b"} )
+ private String stringParam;
+ }
+
+}
Property changes on: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/digest/ConfigUtilTest.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/digest/SetPropertyTest.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/digest/SetPropertyTest.java 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/digest/SetPropertyTest.java 2008-10-07 14:16:03 UTC (rev 23349)
@@ -20,20 +20,19 @@
*/
package org.jboss.esb.deploy.config.digest;
+import org.jboss.esb.deploy.config.AnnotatedResource;
+import org.jboss.esb.deploy.config.AnnotatedTestPropertiesResource;
+import org.jboss.esb.deploy.config.AnnotatedTestPropertiesResource2;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
+import org.junit.Test;
+import org.milyn.SmooksException;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
-import org.jboss.esb.deploy.config.AnnotatedResource;
-import org.jboss.esb.deploy.config.AnnotatedTestPropertiesResource;
-import org.jboss.esb.deploy.config.AnnotatedTestPropertiesResource2;
-import org.junit.Test;
-import org.milyn.SmooksException;
-
/**
* Test for {@link SetProperty}.
*
@@ -50,7 +49,7 @@
{
final AnnotatedResource annotatedResource = new AnnotatedResource();
final String expectedName = "Fletcher";
- setProperty.attemptAnnotationFieldSet(annotatedResource.getClass(), annotatedResource , "lastName", expectedName, fieldsSet);
+ setProperty.attemptAnnotationFieldSet(annotatedResource.getClass(), annotatedResource , "lastName", expectedName);
assertEquals( expectedName, annotatedResource.getLastName());
}
@@ -59,7 +58,7 @@
{
final AnnotatedResource annotatedResource = new AnnotatedResource();
final String expectedName = "Dr.Rosen";
- setProperty.attemptAnnotationFieldSet(annotatedResource.getClass(), annotatedResource , "userName", expectedName, fieldsSet);
+ setProperty.attemptAnnotationFieldSet(annotatedResource.getClass(), annotatedResource , "userName", expectedName);
assertEquals( expectedName, annotatedResource.getName() );
}
@@ -67,7 +66,7 @@
public void attemptAnnotationFieldSetNotAnnotated() throws IllegalAccessException
{
final AnnotatedResource annotatedResource = new AnnotatedResource();
- setProperty.attemptAnnotationFieldSet(annotatedResource.getClass(), annotatedResource , "password", "secret", fieldsSet);
+ setProperty.attemptAnnotationFieldSet(annotatedResource.getClass(), annotatedResource , "password", "secret");
assertNull("password is not annotated and should not have been set", annotatedResource.getPassword() );
}
@@ -81,7 +80,7 @@
final String propValue2 = "value2";
final String expectedName = "Dr.Rosen";
- setProperty.attemptAnnotationFieldSet(pojo.getClass(), pojo , "userName", expectedName, fieldsSet);
+ setProperty.attemptAnnotationFieldSet(pojo.getClass(), pojo , "userName", expectedName);
setProperty.attemptAnnotationPropertySet(pojo.getClass(), pojo , propKey1, propValue1);
setProperty.attemptAnnotationPropertySet(pojo.getClass(), pojo , propKey2, propValue2);
@@ -103,7 +102,7 @@
final String propValue2 = "value2";
final String expectedName = "Dr.Rosen";
- setProperty.attemptAnnotationFieldSet(pojo.getClass(), pojo , "userName", expectedName, fieldsSet);
+ setProperty.attemptAnnotationFieldSet(pojo.getClass(), pojo , "userName", expectedName);
setProperty.attemptAnnotationPropertySet(pojo.getClass(), pojo , propKey1, propValue1);
setProperty.attemptAnnotationPropertySet(pojo.getClass(), pojo , propKey2, propValue2);
@@ -120,7 +119,7 @@
{
final AnnotatedResource annotatedResource = new AnnotatedResource();
final String httpTransport = "Http";
- setProperty.attemptAnnotationFieldSet(annotatedResource.getClass(), annotatedResource , "transport", httpTransport, fieldsSet);
+ setProperty.attemptAnnotationFieldSet(annotatedResource.getClass(), annotatedResource , "transport", httpTransport);
assertEquals(httpTransport, annotatedResource.getTransport());
}
@@ -128,14 +127,14 @@
public void shouldThrowIfInvalidChoice() throws IllegalAccessException
{
final AnnotatedResource annotatedResource = new AnnotatedResource();
- setProperty.attemptAnnotationFieldSet(annotatedResource.getClass(), annotatedResource , "transport", "InvalidTransport", fieldsSet);
+ setProperty.attemptAnnotationFieldSet(annotatedResource.getClass(), annotatedResource , "transport", "InvalidTransport");
}
@Test
public void attemptAnnotationFieldSetWithDefaultValue() throws IllegalAccessException
{
final AnnotatedResource annotatedResource = new AnnotatedResource();
- setProperty.attemptAnnotationFieldSet(annotatedResource.getClass(), annotatedResource , "id", null, fieldsSet);
+ setProperty.attemptAnnotationFieldSet(annotatedResource.getClass(), annotatedResource , "id", null);
assertEquals(11, annotatedResource.getId() );
}
@@ -143,7 +142,7 @@
public void attemptAnnotationFieldSetWithBooleanDefaultValue() throws IllegalAccessException
{
final AnnotatedResource annotatedResource = new AnnotatedResource();
- setProperty.attemptAnnotationFieldSet(annotatedResource.getClass(), annotatedResource , "visible2", null, fieldsSet);
+ setProperty.attemptAnnotationFieldSet(annotatedResource.getClass(), annotatedResource , "visible2", null);
assertEquals(true, annotatedResource.isVisible2());
}
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-02.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-02.xml 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-02.xml 2008-10-07 14:16:03 UTC (rev 23349)
@@ -1,7 +1,12 @@
<jbossesb xmlns="http://www.jboss.org/jbossesb/xsd/jbossesb-5.0.xsd" xmlns:xprot="http://www.jboss.org/jbossesb/xsd/xprot/xprot.xsd">
<routing>
- <inRouters serviceCategory="service-cat" serviceName="service-a">
+ <inRouters>
<xprot:xprotInRouter name="inrouter1" xprotInAttribX="s" />
+ <filters>
+ <filter inRouter="inrouter1">
+ <to serviceCategory="service-cat" serviceName="service-a" />
+ </filter>
+ </filters>
</inRouters>
<outRouters serviceCategory="service-cat" serviceName="service-a">
<xprot:xprotOutRouter name="outrouter1" xprotOutAttribX="s"/>
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-03.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-03.xml 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-03.xml 2008-10-07 14:16:03 UTC (rev 23349)
@@ -6,8 +6,13 @@
</services>
<routing>
- <inRouters serviceCategory="service-cat" serviceName="service-a">
+ <inRouters>
<xprot:xprotInRouter name="inrouter1" xprotInAttribX="s" />
+ <filters>
+ <filter inRouter="inrouter1">
+ <to serviceCategory="service-cat" serviceName="service-a" />
+ </filter>
+ </filters>
</inRouters>
<outRouters serviceCategory="service-cat" serviceName="service-a">
<xprot:xprotOutRouter name="outrouter1" xprotOutAttribX="s"/>
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-inandoutrouters_01.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-inandoutrouters_01.xml 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-inandoutrouters_01.xml 2008-10-07 14:16:03 UTC (rev 23349)
@@ -2,7 +2,8 @@
<routing>
- <inRouters serviceCategory="service-cat" serviceName="service-a">
+ <inRouters>
+
<inRouter name="inrouter1" class="org.jboss.esb.deploy.config.MyInRouter">
<processors>
<processor class="org.jboss.esb.deploy.config.MyMessageTransformer">
@@ -28,9 +29,6 @@
</processors>
<property name="myparam">2</property>
</inRouter>
- </inRouters>
-
- <inRouters serviceCategory="service-cat" serviceName="service-b">
<inRouter name="inrouter3" class="org.jboss.esb.deploy.config.MyInRouter">
<processors>
<processor class="org.jboss.esb.deploy.config.MyMessageTransformer">
@@ -43,6 +41,22 @@
<property name="myparam">5</property>
<property name="myOtherParam">5</property>
</inRouter>
+
+ <filters>
+ <filter inRouter="inrouter1">
+ <to serviceCategory="service-cat" serviceName="service-a" />
+ </filter>
+ <filter inRouter="inrouter2">
+ <to serviceCategory="service-cat" serviceName="service-a" />
+ </filter>
+ <filter inRouter="inrouter3">
+ <to serviceCategory="service-cat" serviceName="service-b" />
+ </filter>
+ <filter inRouter="inrouter4">
+ <to serviceCategory="service-cat" serviceName="service-b" />
+ </filter>
+ </filters>
+
</inRouters>
<outRouters serviceCategory="service-cat" serviceName="service-a">
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-inrouters_01.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-inrouters_01.xml 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-inrouters_01.xml 2008-10-07 14:16:03 UTC (rev 23349)
@@ -2,7 +2,8 @@
<routing>
- <inRouters serviceCategory="service-cat" serviceName="service-a">
+ <inRouters>
+
<inRouter name="inrouter1" class="org.jboss.esb.deploy.config.MyInRouter">
<processors>
<processor class="org.jboss.esb.deploy.config.MyMessageTransformer">
@@ -28,9 +29,6 @@
</processors>
<property name="myparam">2</property>
</inRouter>
- </inRouters>
-
- <inRouters serviceCategory="service-cat" serviceName="service-b">
<inRouter name="inrouter3" class="org.jboss.esb.deploy.config.MyInRouter">
<processors>
<processor class="org.jboss.esb.deploy.config.MyMessageTransformer">
@@ -43,6 +41,22 @@
<property name="myparam">5</property>
<property name="myOtherParam">5</property>
</inRouter>
+
+ <filters>
+ <filter inRouter="inrouter1">
+ <to serviceCategory="service-cat" serviceName="service-a" />
+ </filter>
+ <filter inRouter="inrouter2">
+ <to serviceCategory="service-cat" serviceName="service-a" />
+ </filter>
+ <filter inRouter="inrouter3">
+ <to serviceCategory="service-cat" serviceName="service-b" />
+ </filter>
+ <filter inRouter="inrouter4">
+ <to serviceCategory="service-cat" serviceName="service-b" />
+ </filter>
+ </filters>
+
</inRouters>
</routing>
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-inrouters_02.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-inrouters_02.xml 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-inrouters_02.xml 2008-10-07 14:16:03 UTC (rev 23349)
@@ -3,18 +3,29 @@
<routing>
<!-- Test the replyTo and faultTo -->
- <inRouters serviceCategory="service-cat" serviceName="service-c">
- <inRouter name="inrouter5" class="org.jboss.esb.deploy.config.MyInRouter">
- <replyTo serviceCategory="cat" serviceName="s1"/>
- </inRouter>
- <inRouter name="inrouter6" class="org.jboss.esb.deploy.config.MyInRouter">
- <faultTo serviceCategory="cat" serviceName="s2"/>
- </inRouter>
- <inRouter name="inrouter7" class="org.jboss.esb.deploy.config.MyInRouter">
- <replyTo serviceCategory="cat" serviceName="s3"/>
- <faultTo serviceCategory="cat" serviceName="s4"/>
- </inRouter>
+ <inRouters>
+ <inRouter name="inrouter5" class="org.jboss.esb.deploy.config.MyInRouter" />
+ <inRouter name="inrouter6" class="org.jboss.esb.deploy.config.MyInRouter" />
+ <inRouter name="inrouter7" class="org.jboss.esb.deploy.config.MyInRouter" />
<inRouter name="inrouter8" class="org.jboss.esb.deploy.config.MyInRouter" />
+ <filters>
+ <filter inRouter="inrouter5">
+ <to serviceCategory="service-cat" serviceName="service-c" />
+ <replyTo serviceCategory="cat" serviceName="s1"/>
+ </filter>
+ <filter inRouter="inrouter6">
+ <to serviceCategory="service-cat" serviceName="service-c" />
+ <replyTo serviceCategory="cat" serviceName="s2"/>
+ </filter>
+ <filter inRouter="inrouter7">
+ <to serviceCategory="service-cat" serviceName="service-c" />
+ <replyTo serviceCategory="cat" serviceName="s3"/>
+ <faultTo serviceCategory="cat" serviceName="s4"/>
+ </filter>
+ <filter inRouter="inrouter8">
+ <to serviceCategory="service-cat" serviceName="service-c" />
+ </filter>
+ </filters>
</inRouters>
</routing>
Copied: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-inrouters_filters_01.xml (from rev 23293, labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-inrouters_02.xml)
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-inrouters_filters_01.xml (rev 0)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-inrouters_filters_01.xml 2008-10-07 14:16:03 UTC (rev 23349)
@@ -0,0 +1,22 @@
+<jbossesb xmlns="http://www.jboss.org/jbossesb/xsd/jbossesb-5.0.xsd">
+
+ <routing>
+
+ <inRouters>
+ <inRouter name="inrouter1" class="org.jboss.esb.deploy.config.MyInRouter" />
+ <filters>
+ <filter inRouter="inrouter1">
+ <to serviceCategory="A" serviceName="AA" />
+ <replyTo serviceCategory="B" serviceName="BB" />
+ <faultTo serviceCategory="C" serviceName="CC" />
+ </filter>
+ </filters>
+ </inRouters>
+
+ </routing>
+
+ <services>
+ <service serviceCategory="A" serviceName="A" serviceDescription="A" class="org.jboss.esb.TestService" />
+ </services>
+
+</jbossesb>
\ No newline at end of file
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-services_06.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-services_06.xml 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-services_06.xml 2008-10-07 14:16:03 UTC (rev 23349)
@@ -31,7 +31,7 @@
</services>
<routing>
- <inRouters serviceCategory="service-cat" serviceName="service-a">
+ <inRouters>
<inRouter name="inrouter3" class="org.jboss.esb.deploy.config.MyInRouter">
<processors>
<processor class="org.jboss.esb.deploy.config.MyMessageTransformer">
@@ -40,6 +40,11 @@
</processors>
<property name="myparam">4</property>
</inRouter>
+ <filters>
+ <filter inRouter="inrouter3">
+ <to serviceCategory="service-cat" serviceName="service-a" />
+ </filter>
+ </filters>
</inRouters>
</routing>
</jbossesb>
\ No newline at end of file
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-services_07.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-services_07.xml 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/config/jbossesb-services_07.xml 2008-10-07 14:16:03 UTC (rev 23349)
@@ -31,7 +31,7 @@
</services>
<routing>
- <inRouters serviceCategory="service-cat" serviceName="service-a">
+ <inRouters>
<inRouter name="inrouter3" class="org.jboss.esb.deploy.config.MyInRouter">
<processors>
<processor class="org.jboss.esb.deploy.config.MyMessageTransformer">
@@ -40,6 +40,13 @@
</processors>
<property name="myparam">4</property>
</inRouter>
+
+ <filters>
+ <filter inRouter="inrouter3">
+ <to serviceCategory="service-cat" serviceName="service-a" />
+ </filter>
+ </filters>
+
</inRouters>
<outRouters serviceCategory="service-cat" serviceName="service-b">
<outRouter name="outrouter3" class="org.jboss.esb.deploy.config.MyOutRouter">
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/lifecycle/01-inrouter-config.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/lifecycle/01-inrouter-config.xml 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/lifecycle/01-inrouter-config.xml 2008-10-07 14:16:03 UTC (rev 23349)
@@ -1,8 +1,13 @@
<jbossesb xmlns="http://www.jboss.org/jbossesb/xsd/jbossesb-5.0.xsd">
<routing>
- <inRouters serviceCategory="Service" serviceName="A">
+ <inRouters>
<inRouter name="inrouter" class="org.jboss.esb.TestInboundRouter" />
+ <filters>
+ <filter inRouter="inrouter">
+ <to serviceCategory="Service" serviceName="A" />
+ </filter>
+ </filters>
</inRouters>
</routing>
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/lifecycle/UndeployDispatcherDelayTest.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/lifecycle/UndeployDispatcherDelayTest.java 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/lifecycle/UndeployDispatcherDelayTest.java 2008-10-07 14:16:03 UTC (rev 23349)
@@ -68,7 +68,7 @@
Thread.sleep(300); // Allow the deployments to exchange deployment details
try
{
- final TestInboundRouter inrouter = (TestInboundRouter) DeploymentUtil.getInboundRouter(serviceNameA, "inrouter", inrouterDeployment).getRouter();
+ final TestInboundRouter inrouter = (TestInboundRouter) DeploymentUtil.getInboundRouter("inrouter", inrouterDeployment).getRouter();
TestService serviceA = (TestService) DeploymentUtil.getService(serviceNameA, serviceADeployment).getService();
TestService serviceB = (TestService) DeploymentUtil.getService(serviceNameB, serviceBDeployment).getService();
TestOutboundRouter outrouter = (TestOutboundRouter) DeploymentUtil.getOutboundRouter(serviceNameB, "outrouter", serviceBDeployment).getRouter();
@@ -108,7 +108,7 @@
// Make sure the time to undeploy reflects the delays
// caused by the sleeps in the services...
- assertTrue(timeToUndeploy > 4000);
+ assertTrue(timeToUndeploy > 3000);
// Check that the message has been routed across deployments, from the inrouter
// to the service instance and then to the outrouter...
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/lifecycle/jbossesb-deploy-01.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/lifecycle/jbossesb-deploy-01.xml 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/deploy/lifecycle/jbossesb-deploy-01.xml 2008-10-07 14:16:03 UTC (rev 23349)
@@ -11,13 +11,21 @@
</services>
<routing>
- <inRouters serviceCategory="service-cat" serviceName="service-a">
+ <inRouters>
<inRouter name="inrouter1" class="org.jboss.esb.deploy.config.MyInRouter" />
<inRouter name="inrouter2" class="org.jboss.esb.deploy.config.MyInRouter">
<processors>
<processor class="org.jboss.esb.deploy.config.MyMessageTransformer" />
</processors>
</inRouter>
+ <filters>
+ <filter inRouter="inrouter1">
+ <to serviceCategory="service-cat" serviceName="service-a" />
+ </filter>
+ <filter inRouter="inrouter2">
+ <to serviceCategory="service-cat" serviceName="service-a" />
+ </filter>
+ </filters>
</inRouters>
<outRouters serviceCategory="service-cat" serviceName="service-a">
<outRouter name="outrouter1" class="org.jboss.esb.deploy.config.MyOutRouter" />
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/dispatch/LocalDispatcherTest.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/dispatch/LocalDispatcherTest.java 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/dispatch/LocalDispatcherTest.java 2008-10-07 14:16:03 UTC (rev 23349)
@@ -42,7 +42,7 @@
runtime.deploy();
try {
- HelloInboundRouter inRouter = (HelloInboundRouter) DeploymentUtil.getInboundRouter(service, "inrouter1", runtime).getRouter();
+ HelloInboundRouter inRouter = (HelloInboundRouter) DeploymentUtil.getInboundRouter("inrouter1", runtime).getRouter();
HelloOutboundRouter outRouter = (HelloOutboundRouter) DeploymentUtil.getOutboundRouter(service, "outrouter1", runtime).getRouter();
assertEquals(null, outRouter.getHelloMessage());
@@ -60,7 +60,7 @@
runtime.deploy();
try {
- HelloInboundRouter inRouter = (HelloInboundRouter) DeploymentUtil.getInboundRouter(service, "inrouter1", runtime).getRouter();
+ HelloInboundRouter inRouter = (HelloInboundRouter) DeploymentUtil.getInboundRouter("inrouter1", runtime).getRouter();
HelloWorldService helloService = (HelloWorldService) DeploymentUtil.getService(service, runtime).getService();
HelloOutboundRouter outRouter = (HelloOutboundRouter) DeploymentUtil.getOutboundRouter(service, "outrouter1", runtime).getRouter();
@@ -83,7 +83,7 @@
runtime.deploy();
try {
- HelloInboundRouter inRouter = (HelloInboundRouter) DeploymentUtil.getInboundRouter(service, "inrouter1", runtime).getRouter();
+ HelloInboundRouter inRouter = (HelloInboundRouter) DeploymentUtil.getInboundRouter("inrouter1", runtime).getRouter();
HelloWorldService helloService = (HelloWorldService) DeploymentUtil.getService(service, runtime).getService();
HelloOutboundRouter outRouter = (HelloOutboundRouter) DeploymentUtil.getOutboundRouter(service, "outrouter1", runtime).getRouter();
@@ -103,7 +103,6 @@
Set conetxtSet = new HashSet();
conetxtSet.add(RestStringTransformer.invocationContext);
conetxtSet.add(RestStringTransformer.deploymentContext);
- conetxtSet.add(RestStringTransformer.addressingContext);
conetxtSet.add(HelloWorldService.invocationContext);
conetxtSet.add(HelloWorldService.deploymentContext);
conetxtSet.add(HelloWorldService.addressingContext);
@@ -113,7 +112,7 @@
assertEquals(3, conetxtSet.size());
assertTrue(conetxtSet.contains(RestStringTransformer.invocationContext));
assertTrue(conetxtSet.contains(RestStringTransformer.deploymentContext));
- assertTrue(conetxtSet.contains(RestStringTransformer.addressingContext));
+ assertTrue(conetxtSet.contains(HelloWorldService.addressingContext));
} finally {
runtime.undeploy();
}
@@ -126,7 +125,7 @@
runtime.deploy();
try {
- HelloInboundRouter inRouter = (HelloInboundRouter) DeploymentUtil.getInboundRouter(service, "inrouter1", runtime).getRouter();
+ HelloInboundRouter inRouter = (HelloInboundRouter) DeploymentUtil.getInboundRouter("inrouter1", runtime).getRouter();
HelloWorldService helloService = (HelloWorldService) DeploymentUtil.getService(service, runtime).getService();
HelloOutboundRouter outRouter = (HelloOutboundRouter) DeploymentUtil.getOutboundRouter(service, "outrouter1", runtime).getRouter();
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/dispatch/RestStringTransformer.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/dispatch/RestStringTransformer.java 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/dispatch/RestStringTransformer.java 2008-10-07 14:16:03 UTC (rev 23349)
@@ -20,7 +20,6 @@
package org.jboss.esb.dispatch;
import org.jboss.esb.annotations.Property;
-import org.jboss.esb.context.AddressingContext;
import org.jboss.esb.context.DeploymentContext;
import org.jboss.esb.context.InvocationContext;
import org.jboss.esb.message.Message;
@@ -35,13 +34,11 @@
@Property
private String newString;
public static InvocationContext invocationContext;
- public static AddressingContext addressingContext;
public static DeploymentContext deploymentContext;
public Message process(Message message) throws MessageProcessingException
{
invocationContext = InvocationContext.getContext();
- addressingContext = AddressingContext.getContext();
deploymentContext = DeploymentContext.getContext();
message.setPayload(newString);
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/dispatch/jbossesb-dispatch-no-service.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/dispatch/jbossesb-dispatch-no-service.xml 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/dispatch/jbossesb-dispatch-no-service.xml 2008-10-07 14:16:03 UTC (rev 23349)
@@ -1,8 +1,15 @@
<jbossesb xmlns="http://www.jboss.org/jbossesb/xsd/jbossesb-5.0.xsd">
<routing>
- <inRouters serviceCategory="hello" serviceName="hello">
+ <inRouters>
<inRouter name="inrouter1" class="org.jboss.esb.dispatch.HelloInboundRouter" />
+
+ <filters>
+ <filter inRouter="inrouter1">
+ <to serviceCategory="hello" serviceName="hello" />
+ </filter>
+ </filters>
+
</inRouters>
<outRouters serviceCategory="hello" serviceName="hello">
<outRouter name="outrouter1" class="org.jboss.esb.dispatch.HelloOutboundRouter" />
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/dispatch/jbossesb-dispatch-with-intransform.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/dispatch/jbossesb-dispatch-with-intransform.xml 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/dispatch/jbossesb-dispatch-with-intransform.xml 2008-10-07 14:16:03 UTC (rev 23349)
@@ -5,7 +5,7 @@
</services>
<routing>
- <inRouters serviceCategory="hello" serviceName="hello">
+ <inRouters>
<inRouter name="inrouter1" class="org.jboss.esb.dispatch.HelloInboundRouter">
<processors>
<processor class="org.jboss.esb.dispatch.RestStringTransformer">
@@ -13,6 +13,11 @@
</processor>
</processors>
</inRouter>
+ <filters>
+ <filter inRouter="inrouter1">
+ <to serviceCategory="hello" serviceName="hello" />
+ </filter>
+ </filters>
</inRouters>
<outRouters serviceCategory="hello" serviceName="hello">
<outRouter name="outrouter1" class="org.jboss.esb.dispatch.HelloOutboundRouter" />
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/dispatch/jbossesb-dispatch-with-outtransform.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/dispatch/jbossesb-dispatch-with-outtransform.xml 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/dispatch/jbossesb-dispatch-with-outtransform.xml 2008-10-07 14:16:03 UTC (rev 23349)
@@ -5,7 +5,7 @@
</services>
<routing>
- <inRouters serviceCategory="hello" serviceName="hello">
+ <inRouters>
<inRouter name="inrouter1" class="org.jboss.esb.dispatch.HelloInboundRouter">
<processors>
<processor class="org.jboss.esb.dispatch.RestStringTransformer">
@@ -13,6 +13,11 @@
</processor>
</processors>
</inRouter>
+ <filters>
+ <filter inRouter="inrouter1">
+ <to serviceCategory="hello" serviceName="hello" />
+ </filter>
+ </filters>
</inRouters>
<outRouters serviceCategory="hello" serviceName="hello">
<outRouter name="outrouter1" class="org.jboss.esb.dispatch.HelloOutboundRouter">
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/dispatch/jbossesb-dispatch-with-service.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/dispatch/jbossesb-dispatch-with-service.xml 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/dispatch/jbossesb-dispatch-with-service.xml 2008-10-07 14:16:03 UTC (rev 23349)
@@ -5,8 +5,13 @@
</services>
<routing>
- <inRouters serviceCategory="hello" serviceName="hello">
+ <inRouters>
<inRouter name="inrouter1" class="org.jboss.esb.dispatch.HelloInboundRouter" />
+ <filters>
+ <filter inRouter="inrouter1">
+ <to serviceCategory="hello" serviceName="hello" />
+ </filter>
+ </filters>
</inRouters>
<outRouters serviceCategory="hello" serviceName="hello">
<outRouter name="outrouter1" class="org.jboss.esb.dispatch.HelloOutboundRouter" />
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/federate/deployment-01.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/federate/deployment-01.xml 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/federate/deployment-01.xml 2008-10-07 14:16:03 UTC (rev 23349)
@@ -5,8 +5,13 @@
</services>
<routing>
- <inRouters serviceCategory="hello" serviceName="hello">
+ <inRouters>
<inRouter name="inrouter1" class="org.jboss.esb.dispatch.HelloInboundRouter" />
+ <filters>
+ <filter inRouter="inrouter1">
+ <to serviceCategory="hello" serviceName="hello" />
+ </filter>
+ </filters>
</inRouters>
<outRouters serviceCategory="hello" serviceName="hello">
<outRouter name="outrouter1" class="org.jboss.esb.dispatch.HelloOutboundRouter" />
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/federate/deployment-02.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/federate/deployment-02.xml 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/federate/deployment-02.xml 2008-10-07 14:16:03 UTC (rev 23349)
@@ -5,8 +5,13 @@
</services>
<routing>
- <inRouters serviceCategory="hello" serviceName="goodbye">
+ <inRouters>
<inRouter name="inrouter1" class="org.jboss.esb.dispatch.HelloInboundRouter" />
+ <filters>
+ <filter inRouter="inrouter1">
+ <to serviceCategory="hello" serviceName="goodbye" />
+ </filter>
+ </filters>
</inRouters>
<outRouters serviceCategory="hello" serviceName="hello">
<outRouter name="outrouter1" class="org.jboss.esb.dispatch.HelloOutboundRouter" />
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/federate/deployment-03.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/federate/deployment-03.xml 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/federate/deployment-03.xml 2008-10-07 14:16:03 UTC (rev 23349)
@@ -1,8 +1,13 @@
<jbossesb xmlns="http://www.jboss.org/jbossesb/xsd/jbossesb-5.0.xsd">
<routing>
- <inRouters serviceCategory="hello" serviceName="goodbye">
+ <inRouters>
<inRouter name="inrouter1" class="org.jboss.esb.dispatch.HelloInboundRouter" />
+ <filters>
+ <filter inRouter="inrouter1">
+ <to serviceCategory="hello" serviceName="goodbye" />
+ </filter>
+ </filters>
</inRouters>
<outRouters serviceCategory="hello" serviceName="hello">
<outRouter name="outrouter1" class="org.jboss.esb.dispatch.HelloOutboundRouter" />
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_001/01-inrouter-config.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_001/01-inrouter-config.xml 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_001/01-inrouter-config.xml 2008-10-07 14:16:03 UTC (rev 23349)
@@ -1,8 +1,13 @@
<jbossesb xmlns="http://www.jboss.org/jbossesb/xsd/jbossesb-5.0.xsd">
<routing>
- <inRouters serviceCategory="Service" serviceName="A">
+ <inRouters>
<inRouter name="inrouter" class="org.jboss.esb.TestInboundRouter" />
+ <filters>
+ <filter inRouter="inrouter">
+ <to serviceCategory="Service" serviceName="A" />
+ </filter>
+ </filters>
</inRouters>
</routing>
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_001/RoutingTest.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_001/RoutingTest.java 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_001/RoutingTest.java 2008-10-07 14:16:03 UTC (rev 23349)
@@ -64,7 +64,7 @@
Thread.sleep(300); // Allow the deployments to exchange deployment details
try
{
- TestInboundRouter inrouter = (TestInboundRouter) DeploymentUtil.getInboundRouter(serviceA, "inrouter", inrouterDeployment).getRouter();
+ TestInboundRouter inrouter = (TestInboundRouter) DeploymentUtil.getInboundRouter("inrouter", inrouterDeployment).getRouter();
TestService service = (TestService) DeploymentUtil.getService(serviceA, serviceDeployment).getService();
TestOutboundRouter outrouter = (TestOutboundRouter) DeploymentUtil.getOutboundRouter(serviceA, "outrouter", outrouterDeployment).getRouter();
@@ -124,7 +124,7 @@
Thread.sleep(300); // Allow the deployments to exchange deployment details
try
{
- TestInboundRouter inrouter = (TestInboundRouter) DeploymentUtil.getInboundRouter(serviceA, "inrouter", inrouterDeployment).getRouter();
+ TestInboundRouter inrouter = (TestInboundRouter) DeploymentUtil.getInboundRouter("inrouter", inrouterDeployment).getRouter();
TestService service = (TestService) DeploymentUtil.getService(serviceA, serviceDeployment).getService();
TestOutboundRouter outrouter = (TestOutboundRouter) DeploymentUtil.getOutboundRouter(serviceA, "outrouter", outrouterDeployment).getRouter();
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_002/01-inrouter-config.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_002/01-inrouter-config.xml 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_002/01-inrouter-config.xml 2008-10-07 14:16:03 UTC (rev 23349)
@@ -1,8 +1,13 @@
<jbossesb xmlns="http://www.jboss.org/jbossesb/xsd/jbossesb-5.0.xsd">
<routing>
- <inRouters serviceCategory="Service" serviceName="A">
+ <inRouters>
<inRouter name="inrouter" class="org.jboss.esb.TestInboundRouter" />
+ <filters>
+ <filter inRouter="inrouter">
+ <to serviceCategory="Service" serviceName="A" />
+ </filter>
+ </filters>
</inRouters>
</routing>
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_002/RoutingTest.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_002/RoutingTest.java 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_002/RoutingTest.java 2008-10-07 14:16:03 UTC (rev 23349)
@@ -66,7 +66,7 @@
Thread.sleep(300); // Allow the deployments to exchange deployment details
try
{
- TestInboundRouter inrouter = (TestInboundRouter) DeploymentUtil.getInboundRouter(serviceNameA, "inrouter", inrouterDeployment).getRouter();
+ TestInboundRouter inrouter = (TestInboundRouter) DeploymentUtil.getInboundRouter("inrouter", inrouterDeployment).getRouter();
TestService serviceA = (TestService) DeploymentUtil.getService(serviceNameA, serviceDeployment).getService();
TestService serviceB = (TestService) DeploymentUtil.getService(serviceNameB, serviceDeployment).getService();
TestOutboundRouter outrouter = (TestOutboundRouter) DeploymentUtil.getOutboundRouter(serviceNameB, "outrouter", outrouterDeployment).getRouter();
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_003/01-inrouter-config.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_003/01-inrouter-config.xml 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_003/01-inrouter-config.xml 2008-10-07 14:16:03 UTC (rev 23349)
@@ -1,8 +1,13 @@
<jbossesb xmlns="http://www.jboss.org/jbossesb/xsd/jbossesb-5.0.xsd">
<routing>
- <inRouters serviceCategory="Service" serviceName="A">
+ <inRouters>
<inRouter name="inrouter" class="org.jboss.esb.TestInboundRouter" />
+ <filters>
+ <filter inRouter="inrouter">
+ <to serviceCategory="Service" serviceName="A" />
+ </filter>
+ </filters>
</inRouters>
</routing>
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_003/RoutingTest.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_003/RoutingTest.java 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_003/RoutingTest.java 2008-10-07 14:16:03 UTC (rev 23349)
@@ -65,7 +65,7 @@
Thread.sleep(300); // Allow the deployments to exchange deployment details
try
{
- TestInboundRouter inrouter = (TestInboundRouter) DeploymentUtil.getInboundRouter(serviceNameA, "inrouter", inrouterDeployment).getRouter();
+ TestInboundRouter inrouter = (TestInboundRouter) DeploymentUtil.getInboundRouter("inrouter", inrouterDeployment).getRouter();
TestService serviceA = (TestService) DeploymentUtil.getService(serviceNameA, serviceADeployment).getService();
TestService serviceB = (TestService) DeploymentUtil.getService(serviceNameB, serviceBDeployment).getService();
TestOutboundRouter outrouter = (TestOutboundRouter) DeploymentUtil.getOutboundRouter(serviceNameB, "outrouter", serviceBDeployment).getRouter();
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_004/01-inrouter-config.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_004/01-inrouter-config.xml 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_004/01-inrouter-config.xml 2008-10-07 14:16:03 UTC (rev 23349)
@@ -1,8 +1,13 @@
<jbossesb xmlns="http://www.jboss.org/jbossesb/xsd/jbossesb-5.0.xsd">
<routing>
- <inRouters serviceCategory="Service" serviceName="A">
+ <inRouters>
<inRouter name="inrouter" class="org.jboss.esb.TestInboundRouter" />
+ <filters>
+ <filter inRouter="inrouter">
+ <to serviceCategory="Service" serviceName="A" />
+ </filter>
+ </filters>
</inRouters>
</routing>
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_004/RoutingTest.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_004/RoutingTest.java 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_004/RoutingTest.java 2008-10-07 14:16:03 UTC (rev 23349)
@@ -57,7 +57,7 @@
Thread.sleep(300); // Allow the deployments to exchange deployment details
try
{
- TestInboundRouter inrouter = (TestInboundRouter) DeploymentUtil.getInboundRouter(serviceNameA, "inrouter", inrouterDeployment).getRouter();
+ TestInboundRouter inrouter = (TestInboundRouter) DeploymentUtil.getInboundRouter("inrouter", inrouterDeployment).getRouter();
TestOutboundRouter outrouter = (TestOutboundRouter) DeploymentUtil.getOutboundRouter(serviceNameA, "outrouter", outrouterDeployment).getRouter();
inrouter.sendMessage("Hi there!!");
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_005/01-inrouter-config.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_005/01-inrouter-config.xml 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_005/01-inrouter-config.xml 2008-10-07 14:16:03 UTC (rev 23349)
@@ -1,8 +1,13 @@
<jbossesb xmlns="http://www.jboss.org/jbossesb/xsd/jbossesb-5.0.xsd">
<routing>
- <inRouters serviceCategory="Service" serviceName="A">
+ <inRouters>
<inRouter name="inrouter" class="org.jboss.esb.TestInboundRouter" />
+ <filters>
+ <filter inRouter="inrouter">
+ <to serviceCategory="Service" serviceName="A" />
+ </filter>
+ </filters>
</inRouters>
</routing>
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_005/RoutingTest.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_005/RoutingTest.java 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_005/RoutingTest.java 2008-10-07 14:16:03 UTC (rev 23349)
@@ -49,7 +49,7 @@
inrouterDeployment.deploy();
try
{
- TestInboundRouter inrouter = (TestInboundRouter) DeploymentUtil.getInboundRouter(serviceNameA, "inrouter", inrouterDeployment).getRouter();
+ TestInboundRouter inrouter = (TestInboundRouter) DeploymentUtil.getInboundRouter("inrouter", inrouterDeployment).getRouter();
try
{
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_006/RoutingTest.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_006/RoutingTest.java 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_006/RoutingTest.java 2008-10-07 14:16:03 UTC (rev 23349)
@@ -69,7 +69,7 @@
Thread.sleep(300); // Allow the deployments to exchange deployment details
try
{
- TestInboundRouter inrouter = (TestInboundRouter) DeploymentUtil.getInboundRouter(serviceNameA, "inrouter", deployment1).getRouter();
+ TestInboundRouter inrouter = (TestInboundRouter) DeploymentUtil.getInboundRouter("inrouter", deployment1).getRouter();
TestService serviceA = (TestService) DeploymentUtil.getService(serviceNameA, deployment1).getService();
TestService serviceB = (TestService) DeploymentUtil.getService(serviceNameB, deployment2).getService();
TestService serviceC = (TestService) DeploymentUtil.getService(serviceNameC, deployment3).getService();
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_007/RoutingTest.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_007/RoutingTest.java 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_007/RoutingTest.java 2008-10-07 14:16:03 UTC (rev 23349)
@@ -70,7 +70,7 @@
Thread.sleep(300); // Allow the deployments to exchange deployment details
try
{
- TestInboundRouter inrouter = (TestInboundRouter) DeploymentUtil.getInboundRouter(serviceNameA, "inrouter", deployment1).getRouter();
+ TestInboundRouter inrouter = (TestInboundRouter) DeploymentUtil.getInboundRouter("inrouter", deployment1).getRouter();
TestService serviceA = (TestService) DeploymentUtil.getService(serviceNameA, deployment1).getService();
TestService serviceF = (TestService) DeploymentUtil.getService(serviceNameF, deployment1).getService();
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_008/01-deployment.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_008/01-deployment.xml 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_008/01-deployment.xml 2008-10-07 14:16:03 UTC (rev 23349)
@@ -1,10 +1,14 @@
<jbossesb xmlns="http://www.jboss.org/jbossesb/xsd/jbossesb-5.0.xsd">
<routing>
- <inRouters serviceCategory="Service" serviceName="A">
- <inRouter name="inrouter" class="org.jboss.esb.TestInboundRouter">
- <replyTo serviceCategory="Service" serviceName="B" />
- </inRouter>
+ <inRouters>
+ <inRouter name="inrouter" class="org.jboss.esb.TestInboundRouter" />
+ <filters>
+ <filter inRouter="inrouter">
+ <to serviceCategory="Service" serviceName="A" />
+ <replyTo serviceCategory="Service" serviceName="B" />
+ </filter>
+ </filters>
</inRouters>
</routing>
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_008/RoutingTest.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_008/RoutingTest.java 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_008/RoutingTest.java 2008-10-07 14:16:03 UTC (rev 23349)
@@ -70,7 +70,7 @@
Thread.sleep(300); // Allow the deployments to exchange deployment details
try
{
- TestInboundRouter inrouter = (TestInboundRouter) DeploymentUtil.getInboundRouter(serviceNameA, "inrouter", deployment1).getRouter();
+ TestInboundRouter inrouter = (TestInboundRouter) DeploymentUtil.getInboundRouter("inrouter", deployment1).getRouter();
TestService serviceA = (TestService) DeploymentUtil.getService(serviceNameA, deployment2).getService();
TestService serviceB = (TestService) DeploymentUtil.getService(serviceNameB, deployment3).getService();
TestOutboundRouter outrouter = (TestOutboundRouter) DeploymentUtil.getOutboundRouter(serviceNameA, "outrouter", deployment2).getRouter();
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_009/01-deployment.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_009/01-deployment.xml 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_009/01-deployment.xml 2008-10-07 14:16:03 UTC (rev 23349)
@@ -5,10 +5,14 @@
</services>
<routing>
- <inRouters serviceCategory="Service" serviceName="A">
- <inRouter name="inrouter" class="org.jboss.esb.TestInboundRouter">
- <replyTo serviceCategory="Service" serviceName="B" />
- </inRouter>
+ <inRouters>
+ <inRouter name="inrouter" class="org.jboss.esb.TestInboundRouter" />
+ <filters>
+ <filter inRouter="inrouter">
+ <to serviceCategory="Service" serviceName="A" />
+ <replyTo serviceCategory="Service" serviceName="B" />
+ </filter>
+ </filters>
</inRouters>
</routing>
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_009/RoutingTest.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_009/RoutingTest.java 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_009/RoutingTest.java 2008-10-07 14:16:03 UTC (rev 23349)
@@ -70,7 +70,7 @@
Thread.sleep(300); // Allow the deployments to exchange deployment details
try
{
- TestInboundRouter inrouter = (TestInboundRouter) DeploymentUtil.getInboundRouter(serviceNameA, "inrouter", deployment1).getRouter();
+ TestInboundRouter inrouter = (TestInboundRouter) DeploymentUtil.getInboundRouter("inrouter", deployment1).getRouter();
TestService serviceA = (TestService) DeploymentUtil.getService(serviceNameA, deployment1).getService();
TestService serviceB = (TestService) DeploymentUtil.getService(serviceNameB, deployment3).getService();
TestOutboundRouter outrouter = (TestOutboundRouter) DeploymentUtil.getOutboundRouter(serviceNameA, "outrouter", deployment2).getRouter();
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_010/01-deployment.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_010/01-deployment.xml 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_010/01-deployment.xml 2008-10-07 14:16:03 UTC (rev 23349)
@@ -1,11 +1,19 @@
<jbossesb xmlns="http://www.jboss.org/jbossesb/xsd/jbossesb-5.0.xsd">
+ <routing>
+ <inRouters>
+ <inRouter name="inrouter" class="org.jboss.esb.TestInboundRouter" />
+ <filters>
+ <filter inRouter="inrouter">
+ <to serviceCategory="Service" serviceName="A" />
+ <replyTo serviceCategory="Service" serviceName="B" />
+ </filter>
+ </filters>
+ </inRouters>
+ </routing>
+
<services>
- <service serviceCategory="Service" serviceName="A" serviceDescription="A Service" class="org.jboss.esb.TestService" mep="In-Out">
- <inRouter name="inrouter" class="org.jboss.esb.TestInboundRouter">
- <replyTo serviceCategory="Service" serviceName="B" />
- </inRouter>
- </service>
+ <service serviceCategory="Service" serviceName="A" serviceDescription="A Service" class="org.jboss.esb.TestService" mep="In-Out" />
<service serviceCategory="Service" serviceName="B" serviceDescription="B Service" class="org.jboss.esb.TestService" />
</services>
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_010/RoutingTest.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_010/RoutingTest.java 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_010/RoutingTest.java 2008-10-07 14:16:03 UTC (rev 23349)
@@ -62,7 +62,7 @@
Thread.sleep(300); // Allow the deployments to exchange deployment details
try
{
- TestInboundRouter inrouter = (TestInboundRouter) DeploymentUtil.getInboundRouter(serviceNameA, "inrouter", deployment1).getRouter();
+ TestInboundRouter inrouter = (TestInboundRouter) DeploymentUtil.getInboundRouter("inrouter", deployment1).getRouter();
TestService serviceA = (TestService) DeploymentUtil.getService(serviceNameA, deployment1).getService();
TestService serviceB = (TestService) DeploymentUtil.getService(serviceNameB, deployment1).getService();
TestOutboundRouter outrouter = (TestOutboundRouter) DeploymentUtil.getOutboundRouter(serviceNameA, "outrouter", deployment2).getRouter();
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_011/01-deployment.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_011/01-deployment.xml 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_011/01-deployment.xml 2008-10-07 14:16:03 UTC (rev 23349)
@@ -1,11 +1,20 @@
<jbossesb xmlns="http://www.jboss.org/jbossesb/xsd/jbossesb-5.0.xsd">
+ <routing>
+ <inRouters>
+ <inRouter name="inrouter" class="org.jboss.esb.TestInboundRouter" />
+ <filters>
+ <filter inRouter="inrouter">
+ <to serviceCategory="Service" serviceName="A" />
+ <faultTo serviceCategory="Service" serviceName="B" />
+ </filter>
+ </filters>
+ </inRouters>
+ </routing>
+
<services>
<service serviceCategory="Service" serviceName="A" serviceDescription="A Service" class="org.jboss.esb.TestService" mep="In-Out">
- <inRouter name="inrouter" class="org.jboss.esb.TestInboundRouter">
- <faultTo serviceCategory="Service" serviceName="B" />
- </inRouter>
<outRouter name="outrouter" class="org.jboss.esb.TestOutboundRouter" />
</service>
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_011/RoutingTest.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_011/RoutingTest.java 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_011/RoutingTest.java 2008-10-07 14:16:03 UTC (rev 23349)
@@ -56,7 +56,7 @@
deployment1.deploy();
try
{
- TestInboundRouter inrouter = (TestInboundRouter) DeploymentUtil.getInboundRouter(serviceNameA, "inrouter", deployment1).getRouter();
+ TestInboundRouter inrouter = (TestInboundRouter) DeploymentUtil.getInboundRouter("inrouter", deployment1).getRouter();
TestService serviceA = (TestService) DeploymentUtil.getService(serviceNameA, deployment1).getService();
TestService serviceB = (TestService) DeploymentUtil.getService(serviceNameB, deployment1).getService();
TestOutboundRouter outrouter = (TestOutboundRouter) DeploymentUtil.getOutboundRouter(serviceNameA, "outrouter", deployment1).getRouter();
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_012/RoutingTest.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_012/RoutingTest.java 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_012/RoutingTest.java 2008-10-07 14:16:03 UTC (rev 23349)
@@ -55,7 +55,7 @@
deployment1.deploy();
try
{
- TestInboundRouter inrouter = (TestInboundRouter) DeploymentUtil.getInboundRouter(serviceNameA, "inrouter", deployment1).getRouter();
+ TestInboundRouter inrouter = (TestInboundRouter) DeploymentUtil.getInboundRouter("inrouter", deployment1).getRouter();
TestService serviceA = (TestService) DeploymentUtil.getService(serviceNameA, deployment1).getService();
MockDeadLetterService dlService = (MockDeadLetterService) DeploymentUtil.getService(DeadLetterPersistanceService.SERVICE_NAME, deployment1).getService();
String faultString = "A Runtime Exception - should route to Dead Letter Service.";
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_013/RoutingTest.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_013/RoutingTest.java 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_013/RoutingTest.java 2008-10-07 14:16:03 UTC (rev 23349)
@@ -59,7 +59,7 @@
deployment1.deploy();
try
{
- TestInboundRouter inrouter = (TestInboundRouter) DeploymentUtil.getInboundRouter(serviceNameA, "inrouter", deployment1).getRouter();
+ TestInboundRouter inrouter = (TestInboundRouter) DeploymentUtil.getInboundRouter("inrouter", deployment1).getRouter();
TestService serviceA = (TestService) DeploymentUtil.getService(serviceNameA, deployment1).getService();
MockDeadLetterService dlService = (MockDeadLetterService) DeploymentUtil.getService(DeadLetterPersistanceService.SERVICE_NAME, deployment1).getService();
String faultString = "A Service Exception - should route to Dead Letter Service because there's no faultTo address.";
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_014/RoutingTest.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_014/RoutingTest.java 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/routing/scenario_014/RoutingTest.java 2008-10-07 14:16:03 UTC (rev 23349)
@@ -59,7 +59,7 @@
deployment1.deploy();
try
{
- TestInboundRouter inrouter = (TestInboundRouter) DeploymentUtil.getInboundRouter(serviceNameA, "inrouter", deployment1).getRouter();
+ TestInboundRouter inrouter = (TestInboundRouter) DeploymentUtil.getInboundRouter("inrouter", deployment1).getRouter();
TestService serviceA = (TestService) DeploymentUtil.getService(serviceNameA, deployment1).getService();
TestOutboundRouter outrouter = (TestOutboundRouter) DeploymentUtil.getOutboundRouter(serviceNameA, "outrouter", deployment1).getRouter();
MockDeadLetterService dlService = (MockDeadLetterService) DeploymentUtil.getService(DeadLetterPersistanceService.SERVICE_NAME, deployment1).getService();
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/schedule/schedule-listener-01.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/schedule/schedule-listener-01.xml 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/schedule/schedule-listener-01.xml 2008-10-07 14:16:03 UTC (rev 23349)
@@ -8,14 +8,11 @@
</resources>
<services>
- <service serviceCategory="hello" serviceName="hello" serviceDescription="A Service" class="org.jboss.esb.dispatch.HelloWorldService" />
- </services>
-
- <routing>
- <inRouters serviceCategory="hello" serviceName="hello">
+ <service serviceCategory="hello" serviceName="hello" serviceDescription="A Service" class="org.jboss.esb.dispatch.HelloWorldService">
<inRouter name="inrouter1" class="org.jboss.esb.schedule.MockScheduledInboundRouter">
<property name="scheduleResourceId">schedule1</property>
</inRouter>
- </inRouters>
- </routing>
+ </service>
+ </services>
+
</jbossesb>
\ No newline at end of file
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/schedule/schedule-listener-02.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/schedule/schedule-listener-02.xml 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/schedule/schedule-listener-02.xml 2008-10-07 14:16:03 UTC (rev 23349)
@@ -5,10 +5,15 @@
-->
<routing>
- <inRouters serviceCategory="hello" serviceName="hello">
+ <inRouters>
<inRouter name="inrouter1" class="org.jboss.esb.schedule.MockScheduledInboundRouter">
<property name="scheduleResourceId">schedule1</property>
</inRouter>
+ <filters>
+ <filter inRouter="inrouter1">
+ <to serviceCategory="hello" serviceName="hello" />
+ </filter>
+ </filters>
</inRouters>
</routing>
Modified: labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/schedule/schedule-listener-03.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/schedule/schedule-listener-03.xml 2008-10-07 14:13:57 UTC (rev 23348)
+++ labs/jbossesb/workspace/skeagh/runtime/src/test/java/org/jboss/esb/schedule/schedule-listener-03.xml 2008-10-07 14:16:03 UTC (rev 23349)
@@ -9,10 +9,15 @@
</resources>
<routing>
- <inRouters serviceCategory="hello" serviceName="hello">
+ <inRouters>
<inRouter name="inrouter1" class="org.jboss.esb.schedule.MockScheduledInboundRouter">
<property name="scheduleResourceId">schedule1</property>
</inRouter>
+ <filters>
+ <filter inRouter="inrouter1">
+ <to serviceCategory="hello" serviceName="hello" />
+ </filter>
+ </filters>
</inRouters>
</routing>
</jbossesb>
\ No newline at end of file
More information about the jboss-svn-commits
mailing list