[jboss-svn-commits] JBL Code SVN: r12111 - labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed May 23 21:32:28 EDT 2007
Author: kurt.stam at jboss.com
Date: 2007-05-23 21:32:27 -0400 (Wed, 23 May 2007)
New Revision: 12111
Added:
labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/MessageFilter.java
Removed:
labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/ContentBasedFilter.java
Log:
Renaming it, to conform to the EIP name.
Deleted: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/ContentBasedFilter.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/ContentBasedFilter.java 2007-05-24 01:07:14 UTC (rev 12110)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/ContentBasedFilter.java 2007-05-24 01:32:27 UTC (rev 12111)
@@ -1,83 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-/**
- * Routes the Message argument to a fixed list of services ([category,name])
- * @author kstam at redhat.com
- * @since Version 4.2
- */
-package org.jboss.soa.esb.actions;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.services.registry.RegistryException;
-import org.jboss.soa.esb.services.routing.MessageRouter;
-import org.jboss.soa.esb.services.routing.MessageRouterException;
-
-public class ContentBasedFilter extends ContentBasedRouter
-{
- public static final String ROUTE_TO_TAG = "route-to";
- private Logger log = Logger.getLogger(this.getClass());
-
- public ContentBasedFilter(ConfigTree config) throws ConfigurationException, RegistryException, MessageRouterException
- {
- super(config);
- }
- /**
- * Inspect the content of the message using a rule set
- * Router the message to one or more destinations, using the ContentBasedRouter to figure out
- * to which destinations it is going to be routed too.
- *
- * @param message
- * @return Message
- * @throws ActionProcessingException
- */
- public Message process(Message message) throws ActionProcessingException
- {
- try {
- List<Object> objectList = _mapper.createObjectList(message, _messagePathList);
- List<String> destinations = _cbr.route(_ruleSet, _ruleLanguage, _ruleReload, message, objectList);
- Collection<String[]> outgoingDestinations = new ArrayList<String[]>();
- for (String destination : destinations) {
- if (_destinations.containsKey(destination)) {
- outgoingDestinations.add(_destinations.get(destination));
- }
- }
- if (outgoingDestinations.size()>0) {
- MessageRouter.deliverMessages(outgoingDestinations, message);
- } else if (destinations.size() > 0) {
- log.debug("No destinations where found, the Message is filtered");
- }
- } catch (MessageRouterException mre) {
- throw new ActionProcessingException(mre.getMessage(), mre);
- }
- return message;
- }
-
-
-}
Copied: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/MessageFilter.java (from rev 12110, labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/ContentBasedFilter.java)
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/MessageFilter.java (rev 0)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/MessageFilter.java 2007-05-24 01:32:27 UTC (rev 12111)
@@ -0,0 +1,83 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+/**
+ * Routes the Message argument to a fixed list of services ([category,name])
+ * @author kstam at redhat.com
+ * @since Version 4.2
+ */
+package org.jboss.soa.esb.actions;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.services.routing.MessageRouter;
+import org.jboss.soa.esb.services.routing.MessageRouterException;
+
+public class MessageFilter extends ContentBasedRouter
+{
+ public static final String ROUTE_TO_TAG = "route-to";
+ private Logger log = Logger.getLogger(this.getClass());
+
+ public MessageFilter(ConfigTree config) throws ConfigurationException, RegistryException, MessageRouterException
+ {
+ super(config);
+ }
+ /**
+ * Inspect the content of the message using a rule set
+ * Router the message to one or more destinations, using the ContentBasedRouter to figure out
+ * to which destinations it is going to be routed too.
+ *
+ * @param message
+ * @return Message
+ * @throws ActionProcessingException
+ */
+ public Message process(Message message) throws ActionProcessingException
+ {
+ try {
+ List<Object> objectList = _mapper.createObjectList(message, _messagePathList);
+ List<String> destinations = _cbr.route(_ruleSet, _ruleLanguage, _ruleReload, message, objectList);
+ Collection<String[]> outgoingDestinations = new ArrayList<String[]>();
+ for (String destination : destinations) {
+ if (_destinations.containsKey(destination)) {
+ outgoingDestinations.add(_destinations.get(destination));
+ }
+ }
+ if (outgoingDestinations.size()>0) {
+ MessageRouter.deliverMessages(outgoingDestinations, message);
+ } else if (destinations.size() > 0) {
+ log.debug("No destinations where found, the Message is filtered");
+ }
+ } catch (MessageRouterException mre) {
+ throw new ActionProcessingException(mre.getMessage(), mre);
+ }
+ return message;
+ }
+
+
+}
More information about the jboss-svn-commits
mailing list