[jboss-svn-commits] JBL Code SVN: r12786 - in labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message: util and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Sat Jun 23 04:29:28 EDT 2007


Author: mark.little at jboss.com
Date: 2007-06-23 04:29:28 -0400 (Sat, 23 Jun 2007)
New Revision: 12786

Added:
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/util/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/util/Type.java
Log:
Added util to help with fault determination.

Added: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/util/Type.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/util/Type.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/util/Type.java	2007-06-23 08:29:28 UTC (rev 12786)
@@ -0,0 +1,49 @@
+package org.jboss.soa.esb.message.util;
+
+import org.jboss.soa.esb.message.Message;
+
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., 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-2006,
+ * @author mark.little at jboss.com
+ */
+
+/**
+ * Provide some helper routines for common requirements.
+ */
+
+public class Type
+{
+	/**
+	 * Is this Message a Fault message?
+	 * 
+	 * @param msg the message to check.
+	 * @return <code>true</code> if it contains a fault, <code>false</code> otherwise.
+	 */
+	
+	public static final boolean isFaultMessage (Message msg)
+	{
+		if (msg != null)
+		{
+			if (msg.getFault() != null)
+				return (boolean) ((msg.getFault().getCode() != null) || (msg.getFault().getReason() != null));
+		}
+		
+		return false;
+	}
+}
\ No newline at end of file




More information about the jboss-svn-commits mailing list