[jboss-svn-commits] JBL Code SVN: r23476 - in labs/jbossesb/workspace/skeagh: api/src and 22 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu Oct 16 09:36:50 EDT 2008
Author: tfennelly
Date: 2008-10-16 09:36:49 -0400 (Thu, 16 Oct 2008)
New Revision: 23476
Added:
labs/jbossesb/workspace/skeagh/api/osgi.bnd
labs/jbossesb/workspace/skeagh/api/src/
labs/jbossesb/workspace/skeagh/api/src/main/
labs/jbossesb/workspace/skeagh/api/src/main/java/
labs/jbossesb/workspace/skeagh/api/src/main/java/org/
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/annotations/
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/annotations/AnnotationConstants.java
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/annotations/Initialize.java
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/annotations/Properties.java
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/annotations/Property.java
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/annotations/Uninitialize.java
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/annotations/package.html
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/context/
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/context/AddressingContext.java
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/context/DeploymentContext.java
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/context/ESBContext.java
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/context/FaultContext.java
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/context/InvocationContext.java
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/context/ResourceLocator.java
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/context/package.html
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/exception/
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/exception/JBossESBException.java
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/exception/package.html
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/message/
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/message/Message.java
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/message/MessageProcessingException.java
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/message/MessageProcessor.java
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/message/doc-files/
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/message/doc-files/4.x-to-5.x-devnotes.html
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/message/package.html
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/package.html
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/routing/
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/routing/FilterEvaluator.java
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/routing/InboundRouter.java
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/routing/MessageDispatcher.java
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/routing/OutboundRouter.java
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/routing/RoutingException.java
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/routing/package.html
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/service/
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/service/Service.java
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/service/ServiceException.java
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/service/ServiceMEP.java
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/service/ServiceName.java
labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/service/package.html
labs/jbossesb/workspace/skeagh/api/src/main/java/overview.html
labs/jbossesb/workspace/skeagh/api/src/main/resources/
labs/jbossesb/workspace/skeagh/api/src/test/
labs/jbossesb/workspace/skeagh/api/src/test/java/
labs/jbossesb/workspace/skeagh/api/src/test/java/org/
labs/jbossesb/workspace/skeagh/api/src/test/java/org/jboss/
labs/jbossesb/workspace/skeagh/api/src/test/java/org/jboss/esb/
labs/jbossesb/workspace/skeagh/api/src/test/java/org/jboss/esb/api/
labs/jbossesb/workspace/skeagh/api/src/test/java/org/jboss/esb/api/service/
labs/jbossesb/workspace/skeagh/api/src/test/java/org/jboss/esb/api/service/ServiceNameTest.java
labs/jbossesb/workspace/skeagh/api/src/test/resources/
Removed:
labs/jbossesb/workspace/skeagh/api/routing/
labs/jbossesb/workspace/skeagh/api/service/
Modified:
labs/jbossesb/workspace/skeagh/api/pom.xml
labs/jbossesb/workspace/skeagh/container/osgi/api/pom.xml
labs/jbossesb/workspace/skeagh/runtime/pom.xml
Log:
consolidating the api modules
Added: labs/jbossesb/workspace/skeagh/api/osgi.bnd
===================================================================
--- labs/jbossesb/workspace/skeagh/api/osgi.bnd (rev 0)
+++ labs/jbossesb/workspace/skeagh/api/osgi.bnd 2008-10-16 13:36:49 UTC (rev 23476)
@@ -0,0 +1,9 @@
+#-----------------------------------------------------------------
+# Use this file to add customized Bnd instructions for the bundle
+#-----------------------------------------------------------------
+
+Export-Package: org.jboss.esb.api.annotations.*, \
+org.jboss.esb.api.context.*, \
+org.jboss.esb.api.message.*, \
+org.jboss.esb.api.exception.*, \
+org.jboss.esb.api.service.*
Modified: labs/jbossesb/workspace/skeagh/api/pom.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/api/pom.xml 2008-10-16 13:23:19 UTC (rev 23475)
+++ labs/jbossesb/workspace/skeagh/api/pom.xml 2008-10-16 13:36:49 UTC (rev 23476)
@@ -7,16 +7,11 @@
<artifactId>jbossesb</artifactId>
<version>5.0-SNAPSHOT</version>
</parent>
+ <name>JBoss ESB - Public API</name>
<groupId>jboss.jbossesb</groupId>
- <artifactId>api</artifactId>
- <packaging>pom</packaging>
- <version>5.0-SNAPSHOT</version>
- <name>Jboss ESB API (Base POM)</name>
+ <artifactId>jbossesb-api</artifactId>
+ <version>${jboss.esb.version}</version>
<url>http://www.jboss.org/jbossesb/</url>
+ <packaging>jar</packaging>
- <modules>
- <module>service</module>
- <module>routing</module>
- </modules>
-
</project>
Added: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/annotations/AnnotationConstants.java
===================================================================
--- labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/annotations/AnnotationConstants.java (rev 0)
+++ labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/annotations/AnnotationConstants.java 2008-10-16 13:36:49 UTC (rev 23476)
@@ -0,0 +1,27 @@
+package org.jboss.esb.api.annotations;
+
+/**
+* Annotation constants.
+*
+* @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
+*/
+public final class AnnotationConstants
+{
+ /**
+ * Private constructor to prevent instanitiation.
+ */
+ private AnnotationConstants()
+ {
+ throw new AssertionError("Should not be able to call this private constructor.");
+ }
+
+ /**
+ * "null" default annotation value.
+ */
+ public static final String NULL_STRING = "##NULL";
+
+ /**
+ * Unassigned default.
+ */
+ public static final String UNASSIGNED = "org.jboss.esb.annotation.AnnotationConstants##UNASSIGNED";
+}
Property changes on: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/annotations/AnnotationConstants.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/annotations/Initialize.java
===================================================================
--- labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/annotations/Initialize.java (rev 0)
+++ labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/annotations/Initialize.java 2008-10-16 13:36:49 UTC (rev 23476)
@@ -0,0 +1,37 @@
+/*
+ * 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.api.annotations;
+
+import java.lang.annotation.*;
+
+/**
+ * Initialization method annotation.
+ * <p/>
+ * Can be used by any ESB component ({@link org.jboss.esb.api.service.Service} etc)
+ * to flag that component as requiring deployment-time initialization via that method (zero-arg).
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+ at Documented
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target({ ElementType.METHOD })
+public @interface Initialize
+{
+}
Property changes on: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/annotations/Initialize.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/annotations/Properties.java
===================================================================
--- labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/annotations/Properties.java (rev 0)
+++ labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/annotations/Properties.java 2008-10-16 13:36:49 UTC (rev 23476)
@@ -0,0 +1,70 @@
+/*
+ * 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.api.annotations;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Configuration paramater field annotation.
+ * <p/>
+ * This annotation can be uses to cause all properties that
+ * exist in a configuration to be added to a specified Properties instance.
+ * Any field in a class that does not have a {@link Property} annotation
+ * specified will be added to the Properties instance.
+ *
+ * <h3>Usage</h3>
+ * <pre>{@code
+ * @Properties
+ * private String properties;
+ * </pre>}
+ *
+ *@author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
+ */
+ at Documented
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target({ ElementType.FIELD })
+public @interface Properties
+{
+ /**
+ * Paramater required or optional. <p/> Defaults to required.
+ */
+ Use use() default Use.REQUIRED;
+
+ /**
+ * Configuration paramater use.
+ */
+ public static enum Use
+ {
+ /**
+ * Parameter is required.
+ */
+ REQUIRED,
+
+ /**
+ * Parameter is optional.
+ */
+ OPTIONAL,
+ }
+}
Property changes on: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/annotations/Properties.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/annotations/Property.java
===================================================================
--- labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/annotations/Property.java (rev 0)
+++ labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/annotations/Property.java 2008-10-16 13:36:49 UTC (rev 23476)
@@ -0,0 +1,117 @@
+/*
+ * 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.api.annotations;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Configuration paramater field annotation.
+ * <p/>
+ * <p/>
+ * <h3>Usage</h3>
+ * Where the paramater name is the same as the field name:
+ * <pre>{@code
+ * @Property
+ * private int maxDigits;
+ * </pre>}
+ * Where the paramater name is NOT the same as the field name:
+ * <pre>{@code
+ * @Property(name="max-digits")
+ * private int maxDigits;
+ * </pre>}
+ *
+ * @author <a href="mailto:tom.fennelly at gmail.com">tom.fennelly at gmail.com</a>
+ */
+ at Documented
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target({ ElementType.FIELD })
+public @interface Property
+{
+
+ /**
+ * The paramater name as defined in the resource configuration. If not
+ * defined, the name defaults to the name of the field.
+ */
+ String name() default AnnotationConstants.NULL_STRING;
+
+ /**
+ * Paramater required or optional. <p/> Defaults to required.
+ */
+ Use use() default Use.REQUIRED;
+
+ /**
+ * The default paramater value.
+ */
+ String defaultVal() default AnnotationConstants.UNASSIGNED;
+
+ /**
+ * Paramater choice values.
+ */
+ String[] choice() default AnnotationConstants.NULL_STRING;
+
+ /**
+ * Configuration paramater use.
+ */
+ public static enum Use
+ {
+ /**
+ * Parameter is required.
+ */
+ REQUIRED,
+
+ /**
+ * Parameter is optional.
+ */
+ 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;
+ }
+ }
+}
Property changes on: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/annotations/Property.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/annotations/Uninitialize.java
===================================================================
--- labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/annotations/Uninitialize.java (rev 0)
+++ labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/annotations/Uninitialize.java 2008-10-16 13:36:49 UTC (rev 23476)
@@ -0,0 +1,37 @@
+/*
+ * 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.api.annotations;
+
+import java.lang.annotation.*;
+
+/**
+ * Uninitialization method annotation.
+ * <p/>
+ * Can be used by any ESB component ({@link org.jboss.esb.api.service.Service} etc)
+ * to flag that component as requiring undeployment-time uninitialization via that method (zero-arg).
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+ at Documented
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target({ ElementType.METHOD })
+public @interface Uninitialize
+{
+}
Property changes on: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/annotations/Uninitialize.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/annotations/package.html
===================================================================
--- labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/annotations/package.html (rev 0)
+++ labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/annotations/package.html 2008-10-16 13:36:49 UTC (rev 23476)
@@ -0,0 +1,8 @@
+<html>
+<head></head>
+<body>
+Configuration Annotations.
+
+<h2>Package Specification</h2>
+</body>
+</html>
Added: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/context/AddressingContext.java
===================================================================
--- labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/context/AddressingContext.java (rev 0)
+++ labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/context/AddressingContext.java 2008-10-16 13:36:49 UTC (rev 23476)
@@ -0,0 +1,164 @@
+/*
+ * 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.api.context;
+
+import org.jboss.esb.api.service.ServiceName;
+
+import java.io.Serializable;
+
+/**
+ * Message Addressing Context.
+ *
+ * @author <a href="mailto:Kevin.Conner at jboss.com">Kevin Conner</a>
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ * @author <a href="mailto:dbevenius at redhat.com">Daniel Bevenius</a>
+ * @author <a href="mailto:tom.fennelly at jboss.com">Tom Fennelly</a>
+ */
+public class AddressingContext implements Serializable
+{
+ /**
+ * "To" ServiceName for the message associated with the current context.
+ */
+ private ServiceName to;
+ /**
+ * "From" ServiceName for the message associated with the current context.
+ */
+ private ServiceName from;
+ /**
+ * "ReplyTo" ServiceName for the message associated with the current context.
+ */
+ private ServiceName replyTo;
+ /**
+ * "FaultTo" ServiceName for the message associated with the current context.
+ */
+ private ServiceName faultTo;
+ /**
+ * Context ThreadLocal.
+ */
+ private static ThreadLocal<AddressingContext> contextTL = new ThreadLocal<AddressingContext>();
+
+ /**
+ * Set the {@link AddressingContext} associated with the current thread.
+ *
+ * @param context The {@link AddressingContext} associated with the current thread.
+ */
+ public static void setContext(final AddressingContext context)
+ {
+ if (context != null)
+ {
+ contextTL.set(context);
+ } else
+ {
+ contextTL.remove();
+ }
+ }
+
+ /**
+ * Get the {@link AddressingContext} associated with the message currently
+ * being processed.
+ *
+ * @return The {@link AddressingContext} associated with the message currently
+ * being processed.
+ */
+ public static AddressingContext getContext()
+ {
+ return contextTL.get();
+ }
+
+ /**
+ * 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 "From" address.
+ *
+ * @return The "From" address.
+ */
+ public final ServiceName getFrom()
+ {
+ return from;
+ }
+
+ /**
+ * Set the "To" address.
+ *
+ * @param from The "To" address.
+ */
+ public final void setFrom(final ServiceName from)
+ {
+ this.from = from;
+ }
+
+ /**
+ * 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;
+ }
+}
Property changes on: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/context/AddressingContext.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/context/DeploymentContext.java
===================================================================
--- labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/context/DeploymentContext.java (rev 0)
+++ labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/context/DeploymentContext.java 2008-10-16 13:36:49 UTC (rev 23476)
@@ -0,0 +1,133 @@
+/*
+ * 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.api.context;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+/**
+ * Deployment Context.
+ * <p/>
+ * Mutable context scoped around a deployment runtime instance .
+ * <p/>
+ * Deployment resources are handled explicitly because we need to manage
+ * their lifecycle.
+ *
+ * @author <a href="mailto:Kevin.Conner at jboss.com">Kevin Conner</a>
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ * @author <a href="mailto:dbevenius at redhat.com">Daniel Bevenius</a>
+ * @author <a href="mailto:tom.fennelly at jboss.com">Tom Fennelly</a>
+ */
+public class DeploymentContext implements ESBContext
+{
+ /**
+ * List of deployment resource objects.
+ * <p/>
+ * Deployment resources are handled explicitly and are immutable.
+ */
+ private Map<String, Object> resources = new LinkedHashMap<String, Object>();
+ /**
+ * Context Data Map.
+ */
+ private Map<Object, Object> contextMap = new LinkedHashMap<Object, Object>();
+ /**
+ * Context ThreadLocal.
+ */
+ private static ThreadLocal<DeploymentContext> contextTL = new ThreadLocal<DeploymentContext>();
+
+ /**
+ * Set the {@link DeploymentContext} associated with the current thread.
+ *
+ * @param context The {@link DeploymentContext} associated with the current thread.
+ */
+ public static void setContext(final DeploymentContext context)
+ {
+ if (context != null)
+ {
+ contextTL.set(context);
+ } else
+ {
+ contextTL.remove();
+ }
+ }
+
+ /**
+ * Get the {@link DeploymentContext} associated with the current thread.
+ *
+ * @return The {@link DeploymentContext} associated with the current thread.
+ */
+ public static DeploymentContext getContext()
+ {
+ return contextTL.get();
+ }
+
+ /**
+ * Set the list of deployment resources on the context.
+ *
+ * @param resources A list of deployment resources associated with this deployment.
+ */
+ public final void setResources(final Map<String, Object> resources)
+ {
+ this.resources = resources;
+ }
+
+ /**
+ * Get the deployment resource Object from the context using the supplied id.
+ *
+ * @param id The resource ID.
+ * @return The resource object, otherwise null.
+ */
+ public final Object getResource(final String id)
+ {
+ return resources.get(id);
+ }
+
+ /**
+ * Get the Object from the context using the supplied key.
+ *
+ * @param key The context key.
+ * @return The Object bound under the supplied context key, otherwise null.
+ */
+ public final Object getContextObject(final Object key)
+ {
+ return contextMap.get(key);
+ }
+
+ /**
+ * Set the value Object into the context using the supplied key.
+ *
+ * @param key The context key.
+ * @param value The value object to be set in the context.
+ */
+ public final void setContextObject(final Object key, final Object value)
+ {
+ contextMap.put(key, value);
+ }
+
+ /**
+ * Get the context Map.
+ *
+ * @return The context Map.
+ */
+ public final Map<Object, Object> getAll()
+ {
+ return contextMap;
+ }
+}
Property changes on: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/context/DeploymentContext.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/context/ESBContext.java
===================================================================
--- labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/context/ESBContext.java (rev 0)
+++ labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/context/ESBContext.java 2008-10-16 13:36:49 UTC (rev 23476)
@@ -0,0 +1,58 @@
+/*
+ * 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.api.context;
+
+import java.util.Map;
+
+/**
+ * ESB Context.
+ *
+ * @author <a href="mailto:Kevin.Conner at jboss.com">Kevin Conner</a>
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ * @author <a href="mailto:dbevenius at redhat.com">Daniel Bevenius</a>
+ * @author <a href="mailto:tom.fennelly at jboss.com">Tom Fennelly</a>
+ */
+public interface ESBContext
+{
+
+ /**
+ * Get an object from the context.
+ *
+ * @param key The context object key.
+ * @return The Object instance, or null if the Object is not bound to the
+ * context instance.
+ */
+ Object getContextObject(final Object key);
+
+ /**
+ * Set an object on the context.
+ *
+ * @param key The context object key.
+ * @param value The object instance.
+ */
+ void setContextObject(final Object key, final Object value);
+
+ /**
+ * Get all the context objects.
+ *
+ * @return The context Map.
+ */
+ Map<Object, Object> getAll();
+}
Property changes on: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/context/ESBContext.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/context/FaultContext.java
===================================================================
--- labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/context/FaultContext.java (rev 0)
+++ labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/context/FaultContext.java 2008-10-16 13:36:49 UTC (rev 23476)
@@ -0,0 +1,124 @@
+/*
+ * 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.api.context;
+
+import org.jboss.esb.api.message.Message;
+import org.jboss.esb.api.service.ServiceName;
+
+import java.io.Serializable;
+
+/**
+ * Fault Context.
+ * <p/>
+ * Stores fault context data. Check for the existance of a fault by calling
+ * {@link #getFault()}. This method will return any fault, or
+ * null if no fault occured.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">Tom Fennelly</a>
+ */
+public class FaultContext implements Serializable
+{
+ /**
+ * The fault.
+ */
+ private Throwable fault;
+ /**
+ * The fault recipient.
+ */
+ private ServiceName faultRecipient;
+ /**
+ * The fault message.
+ */
+ private Message faultMessage;
+
+ /**
+ * Get the fault.
+ *
+ * @return The fault, or null if no fault has occured.
+ */
+ public final Throwable getFault()
+ {
+ return fault;
+ }
+
+ /**
+ * Set the fault.
+ *
+ * @param fault The fault.
+ */
+ public final void setFault(final Throwable fault)
+ {
+ if (this.fault == null)
+ {
+ this.fault = fault;
+ }
+ }
+
+ /**
+ * Get the fault recipient.
+ * <p/>
+ * This is the name of the service to which the fault was routed.
+ *
+ * @return The fault recipient.
+ */
+ public final ServiceName getFaultRecipient()
+ {
+ return faultRecipient;
+ }
+
+ /**
+ * Set the fault recipient.
+ * <p/>
+ * This is the name of the service to which the fault was routed.
+ *
+ * @param faultRecipient The fault recipient.
+ */
+ public final void setFaultRecipient(final ServiceName faultRecipient)
+ {
+ this.faultRecipient = faultRecipient;
+ }
+
+ /**
+ * Get the fault message.
+ * <p/>
+ * The message at the point in time when the fault occured.
+ *
+ * @return The fault message.
+ */
+ public final Message getFaultMessage()
+ {
+ return faultMessage;
+ }
+
+ /**
+ * Set the fault message.
+ * <p/>
+ * The message at the point in time when the fault occured.
+ *
+ * @param faultMessage The fault message.
+ */
+ public final void setFaultMessage(final Message faultMessage)
+ {
+ if (this.faultMessage == null)
+ {
+ this.faultMessage = faultMessage;
+ }
+ }
+}
\ No newline at end of file
Property changes on: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/context/FaultContext.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/context/InvocationContext.java
===================================================================
--- labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/context/InvocationContext.java (rev 0)
+++ labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/context/InvocationContext.java 2008-10-16 13:36:49 UTC (rev 23476)
@@ -0,0 +1,158 @@
+/*
+ * 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.api.context;
+
+import java.io.Serializable;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+/**
+ * InvocationContext Context.
+ * <p/>
+ * Mutable context scoped around a ServiceInvocation.
+ *
+ * @author <a href="mailto:Kevin.Conner at jboss.com">Kevin Conner</a>
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ * @author <a href="mailto:dbevenius at redhat.com">Daniel Bevenius</a>
+ * @author <a href="mailto:tom.fennelly at jboss.com">Tom Fennelly</a>
+ */
+public class InvocationContext implements ESBContext, Serializable
+{
+ /**
+ * Context ThreadLocal.
+ */
+ private static ThreadLocal<InvocationContext> contextTL = new ThreadLocal<InvocationContext>();
+ /**
+ * Context Data Map.
+ */
+ private Map<Object, Object> contextMap = new LinkedHashMap<Object, Object>();
+ /**
+ * Invocation Parameters.
+ */
+ private Map<String, String> invocationParameters = new LinkedHashMap<String, String>();
+ /**
+ * Fault context.
+ */
+ private FaultContext faultContext = new FaultContext();
+
+ /**
+ * Public default constructor.
+ */
+ public InvocationContext()
+ {
+ }
+
+ /**
+ * Public constructor.
+ * <p/>
+ * The invocation parameters pass along with the
+ * {@link org.jboss.esb.api.message.Message}.
+ *
+ * @param invocationParameters The invocation parameters.
+ */
+ public InvocationContext(final Map<String, String> invocationParameters)
+ {
+ this.invocationParameters = invocationParameters;
+ }
+
+ /**
+ * Set the {@link InvocationContext} associated with the current thread.
+ *
+ * @param context The {@link InvocationContext} associated with the current thread.
+ */
+ public static void setContext(final InvocationContext context)
+ {
+ if (context != null)
+ {
+ contextTL.set(context);
+ }
+ else
+ {
+ contextTL.remove();
+ }
+ }
+
+ /**
+ * Get the {@link InvocationContext} associated with the message currently
+ * being processed.
+ *
+ * @return The {@link InvocationContext} associated with the message currently
+ * being processed.
+ */
+ public static InvocationContext getContext()
+ {
+ return contextTL.get();
+ }
+
+ /**
+ * Get the Object from the context using the supplied key.
+ *
+ * @param key The context key.
+ * @return The Object bound under the supplied context key, otherwise false.
+ */
+ public final Object getContextObject(final Object key)
+ {
+ return contextMap.get(key);
+ }
+
+ /**
+ * Set the value Object into the context using the supplied key.
+ *
+ * @param key The context key.
+ * @param value The value object to be set in the context.
+ */
+ public final void setContextObject(final Object key, final Object value)
+ {
+ contextMap.put(key, value);
+ }
+
+ /**
+ * Get the context Map.
+ *
+ * @return The context Map.
+ */
+ public final Map<Object, Object> getAll()
+ {
+ return contextMap;
+ }
+
+ /**
+ * Get the invocation parameters provided with the initial
+ * service invocation.
+ * <p/>
+ * These parameters pass along with the {@link org.jboss.esb.api.message.Message}
+ *
+ * @return The invocation parameters.
+ */
+ public final Map<String, String> getInvocationParameters()
+ {
+ return invocationParameters;
+ }
+
+ /**
+ * Get the fault context.
+ *
+ * @return The fault context.
+ */
+ public final FaultContext getFaultContext()
+ {
+ return faultContext;
+ }
+}
Property changes on: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/context/InvocationContext.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/context/ResourceLocator.java
===================================================================
--- labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/context/ResourceLocator.java (rev 0)
+++ labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/context/ResourceLocator.java 2008-10-16 13:36:49 UTC (rev 23476)
@@ -0,0 +1,70 @@
+/*
+ * 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.api.context;
+
+import java.io.InputStream;
+
+/**
+ * A ResourceLocator is intended to be used by any code in the ESB
+ * that needs to access resources from a deployment.
+ * <p/>
+ * Different implementations can use different means to retreive
+ * the resources.
+ *
+ * @author <a href="mailto:dbevenius at jboss.com">Daniel Bevenius</a>
+ *
+ */
+public interface ResourceLocator
+{
+ /**
+ * Load the specified class.
+ *
+ * @param className The name of the class to load.
+ * @return The specified class.
+ * @throws ClassNotFoundException If the class cannot be found.
+ */
+ Class<?> forName(final String className) throws ClassNotFoundException;
+
+ /**
+ * Load the specified class using the passed in class's classloader.
+ *
+ * @param className The name of the class to load.
+ * @param caller The class of the caller.
+ * @return The specified class.
+ * @throws ClassNotFoundException If the class cannot be found.
+ */
+ Class<?> forName(final String className, final Class<?> caller) throws ClassNotFoundException;
+
+ /**
+ * Get a resource from the callers classpath.
+ *
+ * @param resourceName - the name of the resource to be retrieved.
+ * @param caller - the class of the caller. The classes classloader will be used to search for the resource.
+ * @return InputStream - the InputStream for the resource.
+ */
+ InputStream getResourceAsStream(final String resourceName, final Class<?> caller);
+
+ /**
+ * Get the underlying classloader.
+ * @return The underlying ClassLoader.
+ */
+ ClassLoader getClassLoader();
+}
Property changes on: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/context/ResourceLocator.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/context/package.html
===================================================================
--- labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/context/package.html (rev 0)
+++ labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/context/package.html 2008-10-16 13:36:49 UTC (rev 23476)
@@ -0,0 +1,8 @@
+<html>
+<head></head>
+<body>
+ESB Context.
+
+<h2>Package Specification</h2>
+</body>
+</html>
\ No newline at end of file
Added: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/exception/JBossESBException.java
===================================================================
--- labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/exception/JBossESBException.java (rev 0)
+++ labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/exception/JBossESBException.java 2008-10-16 13:36:49 UTC (rev 23476)
@@ -0,0 +1,54 @@
+/*
+ * 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.api.exception;
+
+/**
+ * Base JBossESB Exception.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class JBossESBException extends Exception
+{
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Public Constructor.
+ *
+ * @param message Exception message.
+ */
+ public JBossESBException(final String message)
+ {
+ super(message);
+ }
+
+ /**
+ * Public Constructor.
+ *
+ * @param message Exception message.
+ * @param cause Exception cause.
+ */
+ public JBossESBException(final String message, final Throwable cause)
+ {
+ super(message, cause);
+ }
+}
Property changes on: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/exception/JBossESBException.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/exception/package.html
===================================================================
--- labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/exception/package.html (rev 0)
+++ labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/exception/package.html 2008-10-16 13:36:49 UTC (rev 23476)
@@ -0,0 +1,8 @@
+<html>
+<head></head>
+<body>
+ESB Service Exception classes.
+
+<h2>Package Specification</h2>
+</body>
+</html>
\ No newline at end of file
Added: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/message/Message.java
===================================================================
--- labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/message/Message.java (rev 0)
+++ labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/message/Message.java 2008-10-16 13:36:49 UTC (rev 23476)
@@ -0,0 +1,170 @@
+/*
+ * 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.api.message;
+
+import java.io.Serializable;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+/**
+ * JBoss ESB Message.
+ * <p/>
+ * <b>Note</b>: <i>For those moving from JBossESB 4.x, please read the
+ * <a href="doc-files/4.x-to-5.x-devnotes.html#message">4.x to 5.x Developer Notes</a></i>.
+ *
+ * @author <a href="mailto:Kevin.Conner at jboss.com">Kevin Conner</a>
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ * @author <a href="mailto:dbevenius at redhat.com">Daniel Bevenius</a>
+ * @author <a href="mailto:tom.fennelly at jboss.com">Tom Fennelly</a>
+ */
+public class Message implements Serializable
+{
+ // TODO: Make Externalizable
+
+ /**
+ * Primary Payload.
+ * <p/>
+ * Don't change this to be Serializable. The Message only needs to be
+ * Serializable if it needs to go onto a Bus, which is not always the case.
+ */
+ private Object payload;
+ /**
+ * Attachments.
+ * <p/>
+ * Don't change these to be Serializable. The Message only needs to be
+ * Serializable if it needs to go onto a Bus, which is not always the case.
+ */
+ private Map<String, Object> attachments = new LinkedHashMap<String, Object>();
+
+ /**
+ * Public default constructor.
+ */
+ public Message()
+ {
+ }
+
+ /**
+ * Public default constructor.
+ *
+ * @param payload Message payload.
+ */
+ public Message(final Object payload)
+ {
+ /*
+ * Don't change this to be Serializable. The Message only needs to be
+ * Serializable if it needs to go onto a Bus, which is not always the case.
+ */
+ this.payload = payload;
+ }
+
+ /**
+ * Get the primary payload Object.
+ *
+ * @return The primary payload Object.
+ */
+ public final Object getPayload()
+ {
+ /*
+ * Don't change this to be Serializable. The Message only needs to be
+ * Serializable if it needs to go onto a Bus, which is not always the case.
+ */
+ return payload;
+ }
+
+ /**
+ * Set the primary payload Object.
+ *
+ * @param payload The primary payload Object.
+ */
+ public final void setPayload(final Object payload)
+ {
+ /*
+ * Don't change this to be Serializable. The Message only needs to be
+ * Serializable if it needs to go onto a Bus, which is not always the case.
+ */
+ this.payload = payload;
+ }
+
+ /**
+ * Get the message attachments.
+ *
+ * @return Message attachments.
+ */
+ public final Map<String, Object> getAttachments()
+ {
+ /*
+ * Don't change these to be Serializable. The Message only needs to be
+ * Serializable if it needs to go onto a Bus, which is not always the case.
+ */
+ return attachments;
+ }
+
+ /**
+ * Set the message attachments.
+ *
+ * @param attachments Message attachments.
+ */
+ public final void setAttachments(final Map<String, Object> attachments)
+ {
+ /*
+ * Don't change these to be Serializable. The Message only needs to be
+ * Serializable if it needs to go onto a Bus, which is not always the case.
+ */
+ this.attachments = attachments;
+ }
+
+ /**
+ * Create a shallow clone of the message.
+ *
+ * @return A Shallow clone of the message.
+ */
+ public final Object clone()
+ {
+ Message clone = new Message(payload);
+ clone.getAttachments().putAll(getAttachments());
+ return clone;
+ }
+
+ /**
+ * Object hash.
+ * <p/>
+ * Finalizing this method.
+ *
+ * @return The Object hash (as per the {@link Object} class implementation).
+ */
+ public final int hashCode()
+ {
+ return super.hashCode();
+ }
+
+ /**
+ * Object equals.
+ * <p/>
+ * Finalizing this method.
+ *
+ * @param obj The object to be compared against.
+ * @return True if the Object is equal (as per the {@link Object} class implementation),
+ * otherwise false.
+ */
+ public final boolean equals(final Object obj)
+ {
+ return super.equals(obj);
+ }
+}
Property changes on: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/message/Message.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/message/MessageProcessingException.java
===================================================================
--- labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/message/MessageProcessingException.java (rev 0)
+++ labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/message/MessageProcessingException.java 2008-10-16 13:36:49 UTC (rev 23476)
@@ -0,0 +1,52 @@
+/*
+ * 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.api.message;
+
+import org.jboss.esb.api.exception.JBossESBException;
+
+/**
+ * Message Processing Exception.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class MessageProcessingException extends JBossESBException
+{
+
+ /**
+ * Public Constructor.
+ *
+ * @param message Exception message.
+ */
+ public MessageProcessingException(final String message)
+ {
+ super(message);
+ }
+
+ /**
+ * Public Constructor.
+ *
+ * @param message Exception message.
+ * @param cause Exception cause.
+ */
+ public MessageProcessingException(final String message, final Throwable cause)
+ {
+ super(message, cause);
+ }
+}
Property changes on: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/message/MessageProcessingException.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/message/MessageProcessor.java
===================================================================
--- labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/message/MessageProcessor.java (rev 0)
+++ labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/message/MessageProcessor.java 2008-10-16 13:36:49 UTC (rev 23476)
@@ -0,0 +1,37 @@
+/*
+ * 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.api.message;
+
+/**
+ * Message Processor Interface.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public interface MessageProcessor
+{
+ /**
+ * Process the message.
+ *
+ * @param message The message to be processed.
+ * @return Message The message object.
+ * @throws MessageProcessingException An exception occured while processing the message.
+ */
+ Message process(final Message message) throws MessageProcessingException;
+}
Property changes on: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/message/MessageProcessor.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/message/doc-files/4.x-to-5.x-devnotes.html
===================================================================
--- labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/message/doc-files/4.x-to-5.x-devnotes.html (rev 0)
+++ labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/message/doc-files/4.x-to-5.x-devnotes.html 2008-10-16 13:36:49 UTC (rev 23476)
@@ -0,0 +1,49 @@
+<html>
+<head>
+ <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" TITLE="Style"/>
+</head>
+<body>
+<h2>Notes for JBossESB 4.x Developers Moving to JBossESB 5.x</h2>
+This page contains notes for developers moving from JBossESB 4.x to JBossESB 5.x.
+
+<h3 id="message">Message Changes</h3>
+One of the big changes in the 5.x API is the <a href="../Message.html">Message</a>.
+The message in JBossESB 5.x is a simple POJO, contrasting with the complex/confusing
+structure defined in the 4.x API.
+<p/>
+The main points of difference are:
+<table border="1" cellpadding="3" cellspacing="0" width="100%">
+ <tr class="TableHeadingColor">
+ <th>4.x</th>
+ <th>5.x</th>
+ </tr>
+ <tr>
+ <td>Multiple named message payload locations in the message "Body".</td>
+ <td>Single "Primary" message payload located directly on the Message (unnamed).
+ If your message contains multiple Objects, then the primary payload
+ would be a Collection.
+ </td>
+ </tr>
+ <tr>
+ <td>Contextual info (e.g. Addressing/Call info) passed around with the Message.</td>
+ <td>Contextual info not available on the Message. This information can be
+ accessed via the classes defined in the <a
+ href="../../context/package-summary.html">org.jboss.esb.api.context</a> package.
+ </td>
+ </tr>
+ <tr>
+ <td>Contextual information getting stored on the Message, causing "pollution" of
+ the Message.
+ </td>
+ <td>Proper "Context" objects are now available through the <a href="../../context/package-summary.html">org.jboss.esb.api.context</a>
+ package. No need to polute the Message.
+ </td>
+ </tr>
+ <tr>
+ <td>Serialization parameters were defined on the Message.</td>
+ <td>Serialization is a completely orthogonal function.</td>
+ </tr>
+</table>
+
+</body>
+</html>
\ No newline at end of file
Added: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/message/package.html
===================================================================
--- labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/message/package.html (rev 0)
+++ labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/message/package.html 2008-10-16 13:36:49 UTC (rev 23476)
@@ -0,0 +1,8 @@
+<html>
+<head></head>
+<body>
+ESB Message.
+
+<h2>Package Specification</h2>
+</body>
+</html>
\ No newline at end of file
Added: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/package.html
===================================================================
--- labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/package.html (rev 0)
+++ labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/package.html 2008-10-16 13:36:49 UTC (rev 23476)
@@ -0,0 +1,8 @@
+<html>
+<head></head>
+<body>
+JBoss ESB Public API.
+
+<h2>Package Specification</h2>
+</body>
+</html>
\ No newline at end of file
Added: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/routing/FilterEvaluator.java
===================================================================
--- labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/routing/FilterEvaluator.java (rev 0)
+++ labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/routing/FilterEvaluator.java 2008-10-16 13:36:49 UTC (rev 23476)
@@ -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.api.routing;
+
+import org.jboss.esb.api.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/src/main/java/org/jboss/esb/api/routing/FilterEvaluator.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/routing/InboundRouter.java
===================================================================
--- labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/routing/InboundRouter.java (rev 0)
+++ labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/routing/InboundRouter.java 2008-10-16 13:36:49 UTC (rev 23476)
@@ -0,0 +1,68 @@
+/*
+ * 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.api.routing;
+
+/**
+ * Inbound Router.
+ * <h3>Deployment Context</h3>
+ * An instance can have its associated {@link org.jboss.esb.api.context.DeploymentContext}
+ * set by simply defining a property by the name "deploymentContext" e.g.
+ * <pre>
+ * public MyRouter implements InboundRouter {
+ * {@link org.jboss.esb.api.context.DeploymentContext} deploymentContext;
+ * }
+ * </pre>
+ * The framework will inject the value.
+ * <h3>Service Name</h3>
+ * An instance can have its associated {@link org.jboss.esb.api.service.ServiceName}
+ * set by simply defining a property by the name "serviceName" e.g.
+ * <pre>
+ * public MyRouter implements InboundRouter {
+ * {@link org.jboss.esb.api.service.ServiceName} serviceName;
+ * }
+ * </pre>
+ * The framework will inject the value.
+ * <h3>Configuration Name</h3>
+ * An instance can have its associated configuration name (name, id etc from the configuration)
+ * set by simply defining a property by the name "objectName" e.g.
+ * <pre>
+ * public MyRouter implements InboundRouter {
+ * String objectName;
+ * }
+ * </pre>
+ * The framework will inject the value.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public interface InboundRouter
+{
+ // TODO: Add support for filtering inbound messages, allowing sharing/reuse of inbound endpoints across 1+ services
+
+ /**
+ * Set the {@link MessageDispatcher} for the router.
+ * <p/>
+ * Implementations use the dispatcher to dispatch messages to the
+ * consuming Service. The ESB runtime handles the details of delivering the
+ * message to the interested Service.
+ *
+ * @param dispatcher The {@link MessageDispatcher} instance.
+ */
+ void setDispatcher(MessageDispatcher dispatcher);
+}
Property changes on: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/routing/InboundRouter.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/routing/MessageDispatcher.java
===================================================================
--- labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/routing/MessageDispatcher.java (rev 0)
+++ labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/routing/MessageDispatcher.java 2008-10-16 13:36:49 UTC (rev 23476)
@@ -0,0 +1,59 @@
+/*
+ * 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.api.routing;
+
+import org.jboss.esb.api.context.InvocationContext;
+import org.jboss.esb.api.message.Message;
+
+/**
+ * Message Dispatcher.
+ * <p/>
+ * An implementation of this class is injected into every {@link InboundRouter}
+ * instance, which uses it to dispatch the Messages it is receiving to the
+ * target Service that is interested in them. Basically, it's a mechanism
+ * for allowing the router to forward the Message to the core ESB runtime for
+ * dispatch to the target Service.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public interface MessageDispatcher
+{
+ /**
+ * Dispatch the message to the target service.
+ *
+ * @param message The message to be dispatched.
+ * @param invocationContext The InvocationContext for the message dispatch.
+ */
+ void dispatch(Message message, InvocationContext invocationContext);
+
+ /**
+ * Is the dispatcher instance processing messages.
+ * <p/>
+ * This is required by the undeploy process. After uninitializing
+ * all {@link InboundRouter} instances, the undeploy waits untill
+ * all dispatchers have completed processing all their messages before
+ * continuing with the undeploy (uninitializing all other components
+ * and resources).
+ *
+ * @return True if the dispatcher has active messages that it is
+ * processing, otherwise false.
+ */
+ boolean isProcessingMessages();
+}
Property changes on: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/routing/MessageDispatcher.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/routing/OutboundRouter.java
===================================================================
--- labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/routing/OutboundRouter.java (rev 0)
+++ labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/routing/OutboundRouter.java 2008-10-16 13:36:49 UTC (rev 23476)
@@ -0,0 +1,67 @@
+/*
+ * 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.api.routing;
+
+import org.jboss.esb.api.message.Message;
+
+/**
+ * Outbound Router.
+ * <h3>Deployment Context</h3>
+ * An instance can have its associated {@link org.jboss.esb.api.context.DeploymentContext}
+ * set by simply defining a property by the name "deploymentContext" e.g.
+ * <pre>
+ * public MyRouter implements OutboundRouter {
+ * {@link org.jboss.esb.api.context.DeploymentContext} deploymentContext;
+ * }
+ * </pre>
+ * The framework will inject the value.
+ * <h3>Service Name</h3>
+ * An instance can have its associated {@link org.jboss.esb.api.service.ServiceName}
+ * set by simply defining a property by the name "serviceName" e.g.
+ * <pre>
+ * public MyRouter implements OutboundRouter {
+ * {@link org.jboss.esb.api.service.ServiceName} serviceName;
+ * }
+ * </pre>
+ * The framework will inject the value.
+ * <h3>Configuration Name</h3>
+ * An instance can have its associated configuration name (name, id etc from the configuration)
+ * set by simply defining a property by the name "objectName" e.g.
+ * <pre>
+ * public MyRouter implements OutboundRouter {
+ * String objectName;
+ * }
+ * </pre>
+ * The framework will inject the value.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public interface OutboundRouter
+{
+ // TODO: Add support for filtering outbound messages. Content based routing??
+
+ /**
+ * Route the message.
+ *
+ * @param message The message to be routed.
+ * @throws RoutingException An exception occured while routing the message.
+ */
+ void route(Message message) throws RoutingException;
+}
\ No newline at end of file
Property changes on: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/routing/OutboundRouter.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/routing/RoutingException.java
===================================================================
--- labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/routing/RoutingException.java (rev 0)
+++ labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/routing/RoutingException.java 2008-10-16 13:36:49 UTC (rev 23476)
@@ -0,0 +1,51 @@
+/*
+ * 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.api.routing;
+
+import org.jboss.esb.api.exception.JBossESBException;
+
+/**
+ * Routing exception.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class RoutingException extends JBossESBException
+{
+ /**
+ * Public Constructor.
+ *
+ * @param message Exception message.
+ */
+ public RoutingException(final String message)
+ {
+ super(message);
+ }
+
+ /**
+ * Public Constructor.
+ *
+ * @param message Exception message.
+ * @param cause Exception cause.
+ */
+ public RoutingException(final String message, final Throwable cause)
+ {
+ super(message, cause);
+ }
+}
Property changes on: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/routing/RoutingException.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/routing/package.html
===================================================================
--- labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/routing/package.html (rev 0)
+++ labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/routing/package.html 2008-10-16 13:36:49 UTC (rev 23476)
@@ -0,0 +1,8 @@
+<html>
+<head></head>
+<body>
+ESB Message Routing.
+
+<h2>Package Specification</h2>
+</body>
+</html>
\ No newline at end of file
Added: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/service/Service.java
===================================================================
--- labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/service/Service.java (rev 0)
+++ labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/service/Service.java 2008-10-16 13:36:49 UTC (rev 23476)
@@ -0,0 +1,57 @@
+/*
+ * 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.api.service;
+
+import org.jboss.esb.api.message.Message;
+import org.jboss.esb.api.message.MessageProcessor;
+
+/**
+ * ESB Service interface.
+ * <h3>Deployment Context</h3>
+ * An instance can have its associated {@link org.jboss.esb.api.context.DeploymentContext}
+ * set by simply defining a property by the name "deploymentContext" e.g.
+ * <pre>
+ * public MyService implements Service {
+ * {@link org.jboss.esb.api.context.DeploymentContext} deploymentContext;
+ * }
+ * </pre>
+ * The framework will inject the value.
+ * <h3>Service Name</h3>
+ * An instance can have its associated {@link org.jboss.esb.api.service.ServiceName}
+ * set by simply defining a property by the name "serviceName" e.g.
+ * <pre>
+ * public MyService implements Service {
+ * {@link org.jboss.esb.api.service.ServiceName} serviceName;
+ * }
+ * </pre>
+ * The framework will inject the value.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public interface Service extends MessageProcessor
+{
+ /**
+ * Service process method.
+ * @param message The message to be processed.
+ * @return The resultant {@link Message}.
+ * @throws ServiceException Service exception processing the message.
+ */
+ Message process(final Message message) throws ServiceException;
+}
\ No newline at end of file
Property changes on: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/service/Service.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/service/ServiceException.java
===================================================================
--- labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/service/ServiceException.java (rev 0)
+++ labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/service/ServiceException.java 2008-10-16 13:36:49 UTC (rev 23476)
@@ -0,0 +1,51 @@
+/*
+ * 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.api.service;
+
+import org.jboss.esb.api.message.MessageProcessingException;
+
+/**
+ * Service Exception.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class ServiceException extends MessageProcessingException
+{
+ /**
+ * Public Constructor.
+ *
+ * @param message Exception message.
+ */
+ public ServiceException(final String message)
+ {
+ super(message);
+ }
+
+ /**
+ * Public Constructor.
+ *
+ * @param message Exception message.
+ * @param cause Exception cause.
+ */
+ public ServiceException(final String message, final Throwable cause)
+ {
+ super(message, cause);
+ }
+}
Property changes on: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/service/ServiceException.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/service/ServiceMEP.java
===================================================================
--- labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/service/ServiceMEP.java (rev 0)
+++ labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/service/ServiceMEP.java 2008-10-16 13:36:49 UTC (rev 23476)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2008, JBoss Inc.
+ */
+package org.jboss.esb.api.service;
+
+/**
+ * Service Message Exchange Pattern (MEP) enumeration.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public enum ServiceMEP
+{
+ /**
+ * Service only accepts messages. Doesn't support 'replyTo'.
+ */
+ InOnly,
+ /**
+ * Service only sends messages. Doesn't support invocation.
+ * <p/>
+ * An example of such a service might be a scheduled Service that
+ * periodically queries a DB, from which it generates a message
+ * and sends it to another Service or OutboundRouter.
+ */
+ OutOnly,
+ /**
+ * Service accepts messages. Supports 'replyTo'.
+ */
+ InOut;
+}
\ No newline at end of file
Property changes on: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/service/ServiceMEP.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/service/ServiceName.java
===================================================================
--- labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/service/ServiceName.java (rev 0)
+++ labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/service/ServiceName.java 2008-10-16 13:36:49 UTC (rev 23476)
@@ -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.api.service;
+
+import org.jboss.esb.api.annotations.Property;
+
+import java.io.Serializable;
+
+/**
+ * Service Name.
+ *
+ * @author <a href="mailto:Kevin.Conner at jboss.com">Kevin Conner</a>
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ * @author <a href="mailto:dbevenius at redhat.com">Daniel Bevenius</a>
+ * @author <a href="mailto:tom.fennelly at jboss.com">Tom Fennelly</a>
+ */
+public final class ServiceName implements Serializable
+{
+
+ /**
+ * Service Category.
+ */
+ @Property
+ private String category = null;
+ /**
+ * Service Name.
+ */
+ @Property
+ private String name = null;
+
+ /**
+ * Private default constructor.
+ * <p/>
+ * This private constructor is provided so that this class can still be
+ * created reflectively.
+ */
+ @SuppressWarnings("unused")
+ private ServiceName()
+ {
+ }
+
+ /**
+ * Public constructor.
+ *
+ * @param category Service Category.
+ * @param name Service Name.
+ */
+ public ServiceName(final String category, final String name)
+ {
+ isNotNullAndNotEmpty(category, "category");
+ isNotNullAndNotEmpty(name, "name");
+
+ this.category = category;
+ this.name = name;
+ }
+
+ /**
+ * Get the Service Category.
+ *
+ * @return Service Category.
+ */
+ public String getCategory()
+ {
+ return category;
+ }
+
+ /**
+ * Get the Service Name.
+ *
+ * @return The Service Name.
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * ServiceName toString.
+ *
+ * @return The Service Category and Name concatenated.
+ */
+ @Override
+ public String toString()
+ {
+ return (category + ":" + name);
+ }
+
+ /**
+ * Equals method.
+ *
+ * @param obj Object to compare against.
+ * @return True if the object is a ServiceName with the same category and name values, otherwise false.
+ */
+ @Override
+ public boolean equals(final Object obj)
+ {
+ if (obj == null)
+ {
+ return false;
+ } else if (obj == this)
+ {
+ return true;
+ } else if (!(obj instanceof ServiceName))
+ {
+ return false;
+ }
+
+ return (obj.hashCode() == hashCode());
+ }
+
+ /**
+ * Object hash method.
+ *
+ * @return Object hash value.
+ */
+ @Override
+ public int hashCode()
+ {
+ return toString().hashCode();
+ }
+
+ /**
+ * Assert that the argument is neither null nor empty.
+ *
+ * @param arg Argument.
+ * @param argName Argument name.
+ * @return The supplied "arg" argument.
+ * @throws IllegalArgumentException Argument is null or empty.
+ */
+ private void isNotNullAndNotEmpty(final String arg, final String argName) throws IllegalArgumentException
+ {
+ if (arg == null || arg.trim().equals(""))
+ {
+ throw new IllegalArgumentException("null or empty '" + argName
+ + "' arg in method call.");
+ }
+ }
+}
Property changes on: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/service/ServiceName.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/service/package.html
===================================================================
--- labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/service/package.html (rev 0)
+++ labs/jbossesb/workspace/skeagh/api/src/main/java/org/jboss/esb/api/service/package.html 2008-10-16 13:36:49 UTC (rev 23476)
@@ -0,0 +1,8 @@
+<html>
+<head></head>
+<body>
+ESb Service.
+
+<h2>Package Specification</h2>
+</body>
+</html>
\ No newline at end of file
Added: labs/jbossesb/workspace/skeagh/api/src/main/java/overview.html
===================================================================
--- labs/jbossesb/workspace/skeagh/api/src/main/java/overview.html (rev 0)
+++ labs/jbossesb/workspace/skeagh/api/src/main/java/overview.html 2008-10-16 13:36:49 UTC (rev 23476)
@@ -0,0 +1,9 @@
+<html>
+<head></head>
+<body>
+JBoss ESB Public API.
+
+<h1>Overview</h1>
+This is the Core API for JBoss ESB.
+</body>
+</html>
\ No newline at end of file
Added: labs/jbossesb/workspace/skeagh/api/src/test/java/org/jboss/esb/api/service/ServiceNameTest.java
===================================================================
--- labs/jbossesb/workspace/skeagh/api/src/test/java/org/jboss/esb/api/service/ServiceNameTest.java (rev 0)
+++ labs/jbossesb/workspace/skeagh/api/src/test/java/org/jboss/esb/api/service/ServiceNameTest.java 2008-10-16 13:36:49 UTC (rev 23476)
@@ -0,0 +1,54 @@
+/*
+ * 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.api.service;
+
+import junit.framework.TestCase;
+
+import java.util.HashMap;
+
+/**
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class ServiceNameTest extends TestCase
+{
+
+ public void test()
+ {
+ ServiceName sa1 = new ServiceName("ca", "na");
+ ServiceName sa2 = new ServiceName("ca", "na");
+ ServiceName sb1 = new ServiceName("cb", "nb");
+ ServiceName sb2 = new ServiceName("cb", "nb");
+ HashMap<ServiceName, String> map = new HashMap<ServiceName, String>();
+
+ assertFalse(sa1.equals(null));
+ assertFalse(sa1.equals("astring"));
+ assertFalse(sa1.equals(sb1));
+
+ assertEquals(sa1.hashCode(), sa2.hashCode());
+ assertTrue(sa1.equals(sa2));
+
+ map.put(sa1, "sa");
+ map.put(sb1, "sb");
+ assertEquals("sa", map.get(sa1));
+ assertEquals("sa", map.get(sa2));
+ assertEquals("sb", map.get(sb1));
+ assertEquals("sb", map.get(sb2));
+ }
+}
Property changes on: labs/jbossesb/workspace/skeagh/api/src/test/java/org/jboss/esb/api/service/ServiceNameTest.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: labs/jbossesb/workspace/skeagh/container/osgi/api/pom.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/container/osgi/api/pom.xml 2008-10-16 13:23:19 UTC (rev 23475)
+++ labs/jbossesb/workspace/skeagh/container/osgi/api/pom.xml 2008-10-16 13:36:49 UTC (rev 23476)
@@ -17,14 +17,9 @@
<dependencies>
<dependency>
<groupId>jboss.jbossesb</groupId>
- <artifactId>jbossesb-api-service</artifactId>
+ <artifactId>jbossesb-api</artifactId>
<version>${jboss.esb.version}</version>
</dependency>
- <dependency>
- <groupId>jboss.jbossesb</groupId>
- <artifactId>jbossesb-api-routing</artifactId>
- <version>${jboss.esb.version}</version>
- </dependency>
</dependencies>
</project>
Modified: labs/jbossesb/workspace/skeagh/runtime/pom.xml
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/pom.xml 2008-10-16 13:23:19 UTC (rev 23475)
+++ labs/jbossesb/workspace/skeagh/runtime/pom.xml 2008-10-16 13:36:49 UTC (rev 23476)
@@ -22,14 +22,9 @@
</dependency>
<dependency>
<groupId>jboss.jbossesb</groupId>
- <artifactId>jbossesb-api-service</artifactId>
+ <artifactId>jbossesb-api</artifactId>
<version>${jboss.esb.version}</version>
</dependency>
- <dependency>
- <groupId>jboss.jbossesb</groupId>
- <artifactId>jbossesb-api-routing</artifactId>
- <version>${jboss.esb.version}</version>
- </dependency>
<dependency>
<groupId>jboss</groupId>
More information about the jboss-svn-commits
mailing list