[jboss-svn-commits] JBL Code SVN: r22487 - labs/jbossesb/workspace/skeagh/api/routing/src/main/java/org/jboss/esb/routing.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Sun Sep 7 13:22:19 EDT 2008


Author: beve
Date: 2008-09-07 13:22:19 -0400 (Sun, 07 Sep 2008)
New Revision: 22487

Added:
   labs/jbossesb/workspace/skeagh/api/routing/src/main/java/org/jboss/esb/routing/PayloadExctractor.java
   labs/jbossesb/workspace/skeagh/api/routing/src/main/java/org/jboss/esb/routing/PayloadExtractorException.java
Log:
Added a PayloadExtractor interface.


Added: labs/jbossesb/workspace/skeagh/api/routing/src/main/java/org/jboss/esb/routing/PayloadExctractor.java
===================================================================
--- labs/jbossesb/workspace/skeagh/api/routing/src/main/java/org/jboss/esb/routing/PayloadExctractor.java	                        (rev 0)
+++ labs/jbossesb/workspace/skeagh/api/routing/src/main/java/org/jboss/esb/routing/PayloadExctractor.java	2008-09-07 17:22:19 UTC (rev 22487)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2008, Red Hat Middleware
+ * LLC, and individual contributors 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.
+ */
+package org.jboss.esb.routing;
+
+import org.jboss.esb.message.Message;
+
+/**
+ * Payload extractor is indended for extracting the payload/content from
+ * a specific transport and populating ESB {@link Message} instance with
+ * that data.
+ *
+ * @author <a href="mailto:dbevenius at redhat.com">Daniel Bevenius</a>
+ *
+ */
+public interface PayloadExctractor<T>
+{
+    /**
+     * Extracts the payload from type T and populates a {@link Message} instance.
+     *
+     * @param t - the type from which data should be extracted.
+     * @return Message - and instance of {@link Message} whos body content consist of the extracted data.
+     */
+    Message extractPayload( final T t ) throws PayloadExtractorException;
+
+}

Added: labs/jbossesb/workspace/skeagh/api/routing/src/main/java/org/jboss/esb/routing/PayloadExtractorException.java
===================================================================
--- labs/jbossesb/workspace/skeagh/api/routing/src/main/java/org/jboss/esb/routing/PayloadExtractorException.java	                        (rev 0)
+++ labs/jbossesb/workspace/skeagh/api/routing/src/main/java/org/jboss/esb/routing/PayloadExtractorException.java	2008-09-07 17:22:19 UTC (rev 22487)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2008, Red Hat Middleware
+ * LLC, and individual contributors 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.
+ */
+package org.jboss.esb.routing;
+
+/**
+ * Exception that indicated that an exception occurred while trying
+ * to extract the payload from a transport.
+ *
+ * @author <a href="mailto:dbevenius at redhat.com">Daniel Bevenius</a>
+ *
+ */
+public class PayloadExtractorException extends Exception
+{
+    private static final long serialVersionUID = 3246930484310092568L;
+
+    public PayloadExtractorException()
+    {
+        super();
+    }
+
+    public PayloadExtractorException(String message, Throwable cause)
+    {
+        super(message, cause);
+    }
+
+    public PayloadExtractorException(String message)
+    {
+        super(message);
+    }
+
+    public PayloadExtractorException(Throwable cause)
+    {
+        super(cause);
+    }
+
+}




More information about the jboss-svn-commits mailing list