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

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Oct 8 03:13:08 EDT 2008


Author: beve
Date: 2008-10-08 03:13:07 -0400 (Wed, 08 Oct 2008)
New Revision: 23364

Modified:
   labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/routing/ServiceInvoker.java
   labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/routing/ServiceRouter.java
Log:
checkstyle cleanup


Modified: labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/routing/ServiceInvoker.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/routing/ServiceInvoker.java	2008-10-08 07:09:15 UTC (rev 23363)
+++ labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/routing/ServiceInvoker.java	2008-10-08 07:13:07 UTC (rev 23364)
@@ -81,14 +81,14 @@
      *
      * @param message The message to be sent.
      * @param to Target Service.
-     * @throws RoutingException Error routing to service.
+     * @return true If the message was sucessfully sent.
      */
-    public boolean send(Message message, ServiceName to)
+    public final boolean send(final Message message, final ServiceName to)
     {
         AddressingContext addressing = new AddressingContext();
 
         addressing.setTo(to);
-        
+
         return send(message, addressing);
     }
 
@@ -97,18 +97,18 @@
      *
      * @param message The message to be sent.
      * @param addressing Addressing data.
-     * @throws RoutingException Error routing to service.
+     * @return true If the message was sucessfully sent.
      */
-    public boolean send(Message message, AddressingContext addressing)
+    public final boolean send(final Message message, final AddressingContext addressing)
     {
-        if(addressing.getTo() == null)
+        if (addressing.getTo() == null)
         {
             logger.error("Invalid AddressingContext configuration.  The 'to' service name must be specified.");
             return false;
         }
 
         // The "to" service name should not be this service...
-        if(addressing.getTo().equals(addressing.getFrom()))
+        if (addressing.getTo().equals(addressing.getFrom()))
         {
             logger.error("Invalid AddressingContext configuration.  The 'to' and 'from' service names (" + addressing.getTo() + ") cannot be the same.");
             return false;
@@ -117,7 +117,7 @@
         // Work out whether or not the target service is local,
         // or on another deployment...
         ServiceConfig localServiceDeployment = DeploymentUtil.getService(addressing.getTo(), deploymentRuntime);
-        if(localServiceDeployment != null && localServiceDeployment.isRoutable())
+        if (localServiceDeployment != null && localServiceDeployment.isRoutable())
         {
             return routeLocal(message, addressing);
         }
@@ -131,7 +131,7 @@
      * Route the message to a local Service.
      * @param message The message.
      * @param dispatchAddressingContext The {@link org.jboss.esb.context.AddressingContext} for the dispatch.
-     * @throws RoutingException Exception during invocation.
+     * @return true If the routing succeeded.
      */
     private boolean routeLocal(final Message message, final AddressingContext dispatchAddressingContext)
     {
@@ -149,7 +149,7 @@
                 BusInboundRouter inRouter = routingContext.getBusInRouters().get(dispatchAddressingContext.getTo());
                 InvocationContext dispatchInvocationContext = new InvocationContext(thisInvocationContext.getInvocationParameters());
 
-                if(eventLog.propagate())
+                if (eventLog.propagate())
                 {
                     ProcessingEventLog.setEventLog(eventLog, dispatchInvocationContext);
                 }
@@ -169,7 +169,7 @@
 
                 // And dispatch the message clone...
                 inRouter.dispatch(clone, dispatchInvocationContext);
-                
+
                 return dispatchInvocationContext.getFaultContext().getFault() == null;
             }
             finally
@@ -190,7 +190,7 @@
      * Route the message to a Service by a Bus.
      * @param message The message.
      * @param invokeAddressingContext The {@link AddressingContext} for the invocation.
-     * @throws RoutingException Exception during invocation.
+     * @return true If routing succeeded. Otherwise false.
      */
     private boolean routeByBus(final Message message, final AddressingContext invokeAddressingContext)
     {
@@ -208,14 +208,14 @@
         {
             Iterator<Map.Entry<String,DeploymentMonitor>> monitors = busDeployment.getDeploymentMonitors().entrySet().iterator();
 
-            while(monitors.hasNext())
+            while (monitors.hasNext())
             {
                 Map.Entry<String, DeploymentMonitor> entry = monitors.next();
                 String deploymentId = entry.getKey();
                 DeploymentMonitor monitor = entry.getValue();
 
                 // Is the deployment online and does it host the target service...
-                if(monitor.isOnline() && monitor.hasService(invokeAddressingContext.getTo()))
+                if (monitor.isOnline() && monitor.hasService(invokeAddressingContext.getTo()))
                 {
                     return monitor.send(busMessage, deploymentId, !monitors.hasNext());
                 }

Modified: labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/routing/ServiceRouter.java
===================================================================
--- labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/routing/ServiceRouter.java	2008-10-08 07:09:15 UTC (rev 23363)
+++ labs/jbossesb/workspace/skeagh/runtime/src/main/java/org/jboss/esb/routing/ServiceRouter.java	2008-10-08 07:13:07 UTC (rev 23364)
@@ -25,8 +25,6 @@
 import org.jboss.esb.context.DeploymentContext;
 import org.jboss.esb.deploy.DeploymentException;
 import org.jboss.esb.message.Message;
-import org.jboss.esb.routing.OutboundRouter;
-import org.jboss.esb.routing.RoutingException;
 import org.jboss.esb.service.ServiceName;
 
 /**
@@ -95,18 +93,19 @@
 
     /**
      * Initialize the router.
+     * @throws DeploymentException If an error occurs during initialization.
      */
     @Initialize
-    public void initialize() throws DeploymentException
+    public final void initialize() throws DeploymentException
     {
         serviceInvoker = new ServiceInvoker(deploymentContext);
 
         toServiceName = new ServiceName(toCategory, toService);
-        if(faultToCategory != null && faultToService != null)
+        if (faultToCategory != null && faultToService != null)
         {
             faultToServiceName = new ServiceName(faultToCategory, faultToService);
         }
-        if(replyToCategory != null && replyToService != null)
+        if (replyToCategory != null && replyToService != null)
         {
             replyToServiceName = new ServiceName(replyToCategory, replyToService);
         }




More information about the jboss-svn-commits mailing list