[jboss-svn-commits] JBL Code SVN: r15837 - labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Oct 15 07:53:38 EDT 2007


Author: tfennelly
Date: 2007-10-15 07:53:38 -0400 (Mon, 15 Oct 2007)
New Revision: 15837

Modified:
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/Notifier.java
Log:
Formatting only - to make it more readable.

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/Notifier.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/Notifier.java	2007-10-15 11:15:55 UTC (rev 15836)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/Notifier.java	2007-10-15 11:53:38 UTC (rev 15837)
@@ -22,108 +22,98 @@
 
 package org.jboss.soa.esb.actions;
 
-import java.util.ArrayList;
-import java.util.List;
-
 import org.apache.log4j.Logger;
 import org.jboss.soa.esb.helpers.ConfigTree;
 import org.jboss.soa.esb.message.Message;
 import org.jboss.soa.esb.message.body.content.BytesBody;
 import org.jboss.soa.esb.notification.NotificationList;
 
+import java.util.ArrayList;
+import java.util.List;
+
 /**
- * Stand alone action class that replaces the NotificationHandler EJB (beta 1) 
+ * Stand alone action class that replaces the NotificationHandler EJB (beta 1)
+ *
  * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
  * @since Version 4.0
  */
-public class Notifier implements ActionLifecycle
-{
-	public Notifier(ConfigTree config)
-	{
-		_config = config;
-	} //________________________________
-	
-        /**
-         * Initialise the action instance.
-         * <p/>
-         * This method is called after the action instance has been instantiated so that
-         * configuration options can be validated.
-         * 
-         * @throws ActionLifecycleException for errors during initialisation.
-         */
-        public void initialise()
-            throws ActionLifecycleException
-        {
-            if (null==_config)
-            {
-                _notifyOK = _notifyError = new ConfigTree[]{};
-            }
-            else
-            {
-                _notifyOK       = getNotificationList("ok");
-                _notifyError= getNotificationList("err");
-            }
+public class Notifier implements ActionLifecycle {
+    public Notifier(ConfigTree config) {
+        _config = config;
+    } //________________________________
+
+    /**
+     * Initialise the action instance.
+     * <p/>
+     * This method is called after the action instance has been instantiated so that
+     * configuration options can be validated.
+     *
+     * @throws ActionLifecycleException for errors during initialisation.
+     */
+    public void initialise()
+            throws ActionLifecycleException {
+        if (null == _config) {
+            _notifyOK = _notifyError = new ConfigTree[]{};
+        } else {
+            _notifyOK = getNotificationList("ok");
+            _notifyError = getNotificationList("err");
         }
+    }
 
-        /**
-         * Destroy the action instance.
-         * <p/>
-         * This method is called prior to the release of the action instance.  All
-         * resources associated with this action instance should be released as the
-         * instance will no longer be used.
-         */
-        public void destroy()
-            throws ActionLifecycleException
-        {
+    /**
+     * Destroy the action instance.
+     * <p/>
+     * This method is called prior to the release of the action instance.  All
+     * resources associated with this action instance should be released as the
+     * instance will no longer be used.
+     */
+    public void destroy()
+            throws ActionLifecycleException {
+    }
+
+    /**
+     * This is equivalent to a No Operation
+     *
+     * @param message
+     * @return - this method will always return arg0 unchanged
+     */
+    public Message process(Message message) {
+        return message;
+    } //________________________________
+
+    public void notifyOK(Message message) {
+        NotificationList.notifyAll(_notifyOK, message);
+    } //________________________________
+
+    public void notifyError(Message message, final Throwable th) {
+        NotificationList.notifyAll(_notifyError, message);
+    } //________________________________
+
+    public String messageAsString(Message message) {
+        byte[] ba = null;
+        return (null == message) ? "<null message>"
+                : (null == (ba = (byte[]) message.getBody().get(BytesBody.BYTES_LOCATION))) ? "<null body content>"
+                : new String(ba);
+    } //________________________________
+
+    private ConfigTree[] getNotificationList(String type) {
+        List<ConfigTree> list = new ArrayList<ConfigTree>();
+        if (null != type)
+            type = type.toLowerCase();
+
+        for (ConfigTree tree : _config.getChildren(NotificationList.ELEMENT)) {
+            String sType = tree.getAttribute(NotificationList.TYPE);
+            if (null == sType)
+                continue;
+            if (null == type || sType.toLowerCase().equals(type))
+                list.add(tree);
         }
-        
-	/**
-	 * This is equivalent to a No Operation
-	 * @param message
-	 * @return - this method will always return arg0 unchanged
-	 */
-	public Message process 	(Message message) 
-	{
-		return message;
-	} //________________________________
-	
-	public void notifyOK 	(Message message) 
-	{
-		NotificationList.notifyAll(_notifyOK, message); 
-	} //________________________________
-	public void notifyError (Message message, final Throwable th) 
-	{ 
-		NotificationList.notifyAll(_notifyError, message); 
-	} //________________________________
-	
-	public String messageAsString (Message message) 
-	{ 
-		byte[] ba = null;
-		return (null==message) ? "<null message>"
-			:(null==(ba=(byte[]) message.getBody().get(BytesBody.BYTES_LOCATION))) ? "<null body content>"
-			: new String(ba); 
-	} //________________________________
-	
-	private ConfigTree[] getNotificationList(String type)
-	{
-		List<ConfigTree> list = new ArrayList<ConfigTree>();
-		if (null!=type)
-			type = type.toLowerCase();
-		
-		for (ConfigTree tree : _config.getChildren(NotificationList.ELEMENT))
-		{
-			String sType = tree.getAttribute(NotificationList.TYPE);
-			if (null==sType)
-				continue;
-			if (null==type || sType.toLowerCase().equals(type))
-				list.add(tree);
-		}
-		
-		ConfigTree[] array = new ConfigTree[list.size()];
-		return list.toArray(array);
-	} //________________________________
-	
-	protected ConfigTree 	_config;
-	protected ConfigTree[]	_notifyOK	,_notifyError;
-	protected static Logger	_logger = Logger.getLogger(Notifier.class);
+
+        ConfigTree[] array = new ConfigTree[list.size()];
+        return list.toArray(array);
+    } //________________________________
+
+    protected ConfigTree _config;
+    protected ConfigTree[] _notifyOK, _notifyError;
+    protected static Logger _logger = Logger.getLogger(Notifier.class);
 } //____________________________________________________________________________




More information about the jboss-svn-commits mailing list