axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From whitl...@apache.org
Subject cvs commit: xml-axis-wsif/java/src/org/apache/wsif WSIFConstants.java
Date Fri, 19 Jul 2002 14:39:38 GMT
whitlock    2002/07/19 07:39:38

  Modified:    java/src/org/apache/wsif/logging Tr.java MessageLogger.java
               java/src/org/apache/wsif/base WSIFDefaultPort.java
                        WSIFServiceImpl.java
                        WSIFDefaultCorrelationService.java
               java/src/org/apache/wsif/util
                        WSIFCorrelationServiceLocator.java WSIFUtils.java
               java/src/org/apache/wsif/providers/soap/apachesoap
                        WSIFOperation_ApacheSOAP.java
               java/src/org/apache/wsif/providers/jms
                        WSIFOperation_Jms.java
               java/src/org/apache/wsif/providers/java
                        WSIFOperation_Java.java
               java/src/org/apache/wsif/providers/ejb
                        WSIFOperation_EJB.java
               java/src/org/apache/wsif WSIFConstants.java
  Removed:     java/src/org/apache/wsif/logging JavaUtilities.java
                        DefaultMessageLogger.java TraceLogger.java
                        JLogTraceLogger.java JLogMessageLogger.java
                        Catalog.java DefaultTraceLogger.java
                        JLogFormatter.java
               java/test/logging MessageLogJunitTest.java
                        TraceLogJunitTest.java
  Log:
  Support commons-logging
  
  Revision  Changes    Path
  1.6       +299 -105  xml-axis-wsif/java/src/org/apache/wsif/logging/Tr.java
  
  Index: Tr.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/src/org/apache/wsif/logging/Tr.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Tr.java	18 Jul 2002 12:28:20 -0000	1.5
  +++ Tr.java	19 Jul 2002 14:39:36 -0000	1.6
  @@ -57,6 +57,8 @@
   
   package org.apache.wsif.logging;
   
  +import java.io.PrintWriter;
  +import java.io.StringWriter;
   import java.util.Collection;
   import javax.wsdl.Binding;
   import javax.wsdl.BindingOperation;
  @@ -66,17 +68,25 @@
   import javax.wsdl.PortType;
   import javax.wsdl.Service;
   
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogFactory;
  +
   /**
    * @author Mark Whitlock <whitlock@apache.org>
    */
   public class Tr {
  -    public static boolean ON = false;
  +    private static Log log = LogFactory.getLog("wsif");
  +    public static boolean ON = log.isDebugEnabled();
  +
  +    private final static String ENTRY = "ENTRY";
  +    private final static String EXIT = "EXIT ";
  +    private final static String EXCEPTION = "EXCEPTION";
       
  -    static {
  -        if (TraceLogger.getGeneralTraceLogger().isLogging(0))
  -            ON = true;
  -    }
  +    private static int depth = 0;
   
  +    /**
  +     * Private constructor ensures no one can instantiate this class.
  +     */
       private Tr() {
           super();
       }
  @@ -88,12 +98,7 @@
           try {
               if (!ON)
                   return;
  -            String hc = "static";
  -            if (that != null)
  -                hc = Integer.toHexString(that.hashCode());
  -            Object[] parms = new Object[] { hc };
  -            checkWsdl(parms);
  -            TraceLogger.getGeneralTraceLogger().entry(parms);
  +            traceIt(that, ENTRY, false, null);
           } catch (Exception e) {
               exceptionInTrace(e);
           }
  @@ -106,12 +111,7 @@
           try {
               if (!ON)
                   return;
  -            String hc = "static";
  -            if (that != null)
  -                hc = Integer.toHexString(that.hashCode());
  -            Object[] parms = new Object[] { hc, p1 };
  -            checkWsdl(parms);
  -            TraceLogger.getGeneralTraceLogger().entry(parms);
  +            traceIt(that, ENTRY, false, new Object[] { p1 });
           } catch (Exception e) {
               exceptionInTrace(e);
           }
  @@ -124,12 +124,7 @@
           try {
               if (!ON)
                   return;
  -            String hc = "static";
  -            if (that != null)
  -                hc = Integer.toHexString(that.hashCode());
  -            Object[] parms = new Object[] { hc, p1, p2 };
  -            checkWsdl(parms);
  -            TraceLogger.getGeneralTraceLogger().entry(parms);
  +            traceIt(that, ENTRY, false, new Object[] { p1, p2 });
           } catch (Exception e) {
               exceptionInTrace(e);
           }
  @@ -139,12 +134,7 @@
           try {
               if (!ON)
                   return;
  -            String hc = "static";
  -            if (that != null)
  -                hc = Integer.toHexString(that.hashCode());
  -            Object[] parms = new Object[] { hc, p1, p2, p3 };
  -            checkWsdl(parms);
  -            TraceLogger.getGeneralTraceLogger().entry(parms);
  +            traceIt(that, ENTRY, false, new Object[] { p1, p2, p3 });
           } catch (Exception e) {
               exceptionInTrace(e);
           }
  @@ -159,12 +149,7 @@
           try {
               if (!ON)
                   return;
  -            String hc = "static";
  -            if (that != null)
  -                hc = Integer.toHexString(that.hashCode());
  -            Object[] parms = new Object[] { hc, p1, p2, p3, p4 };
  -            checkWsdl(parms);
  -            TraceLogger.getGeneralTraceLogger().entry(parms);
  +            traceIt(that, ENTRY, false, new Object[] { p1, p2, p3, p4 });
           } catch (Exception e) {
               exceptionInTrace(e);
           }
  @@ -180,12 +165,7 @@
           try {
               if (!ON)
                   return;
  -            String hc = "static";
  -            if (that != null)
  -                hc = Integer.toHexString(that.hashCode());
  -            Object[] parms = new Object[] { hc, p1, p2, p3, p4, p5 };
  -            checkWsdl(parms);
  -            TraceLogger.getGeneralTraceLogger().entry(parms);
  +            traceIt(that, ENTRY, false, new Object[] { p1, p2, p3, p4, p5 });
           } catch (Exception e) {
               exceptionInTrace(e);
           }
  @@ -202,12 +182,7 @@
           try {
               if (!ON)
                   return;
  -            String hc = "static";
  -            if (that != null)
  -                hc = Integer.toHexString(that.hashCode());
  -            Object[] parms = new Object[] { hc, p1, p2, p3, p4, p5, p6 };
  -            checkWsdl(parms);
  -            TraceLogger.getGeneralTraceLogger().entry(parms);
  +            traceIt(that, ENTRY, false, new Object[] { p1, p2, p3, p4, p5, p6 });
           } catch (Exception e) {
               exceptionInTrace(e);
           }
  @@ -225,12 +200,7 @@
           try {
               if (!ON)
                   return;
  -            String hc = "static";
  -            if (that != null)
  -                hc = Integer.toHexString(that.hashCode());
  -            Object[] parms = new Object[] { hc, p1, p2, p3, p4, p5, p6, p7 };
  -            checkWsdl(parms);
  -            TraceLogger.getGeneralTraceLogger().entry(parms);
  +            traceIt(that, ENTRY, false, new Object[] { p1, p2, p3, p4, p5, p6, p7 });
           } catch (Exception e) {
               exceptionInTrace(e);
           }
  @@ -249,12 +219,192 @@
           try {
               if (!ON)
                   return;
  -            String hc = "static";
  -            if (that != null)
  -                hc = Integer.toHexString(that.hashCode());
  -            Object[] parms = new Object[] { hc, p1, p2, p3, p4, p5, p6, p7, p8 };
  -            checkWsdl(parms);
  -            TraceLogger.getGeneralTraceLogger().entry(parms);
  +            traceIt(that, ENTRY, false, new Object[] { p1, p2, p3, p4, p5, p6, p7, p8 });
  +        } catch (Exception e) {
  +            exceptionInTrace(e);
  +        }
  +    }
  +
  +    public static void entry(
  +        Object that,
  +        Object p1,
  +        Object p2,
  +        Object p3,
  +        Object p4,
  +        Object p5,
  +        Object p6,
  +        Object p7,
  +        Object p8,
  +        Object p9) {
  +        try {
  +            if (!ON)
  +                return;
  +            traceIt(
  +                that,
  +                ENTRY,
  +                false,
  +                new Object[] {
  +                    p1,
  +                    p2,
  +                    p3,
  +                    p4,
  +                    p5,
  +                    p6,
  +                    p7,
  +                    p8,
  +                    p9 });
  +        } catch (Exception e) {
  +            exceptionInTrace(e);
  +        }
  +    }
  +
  +    public static void entry(
  +        Object that,
  +        Object p1,
  +        Object p2,
  +        Object p3,
  +        Object p4,
  +        Object p5,
  +        Object p6,
  +        Object p7,
  +        Object p8,
  +        Object p9,
  +        Object p10) {
  +        try {
  +            if (!ON)
  +                return;
  +            traceIt(
  +                that,
  +                ENTRY,
  +                false,
  +                new Object[] {
  +                    p1,
  +                    p2,
  +                    p3,
  +                    p4,
  +                    p5,
  +                    p6,
  +                    p7,
  +                    p8,
  +                    p9,
  +                    p10 });
  +        } catch (Exception e) {
  +            exceptionInTrace(e);
  +        }
  +    }
  +
  +    public static void entry(
  +        Object that,
  +        Object p1,
  +        Object p2,
  +        Object p3,
  +        Object p4,
  +        Object p5,
  +        Object p6,
  +        Object p7,
  +        Object p8,
  +        Object p9,
  +        Object p10,
  +        Object p11) {
  +        try {
  +            if (!ON)
  +                return;
  +            traceIt(
  +                that,
  +                ENTRY,
  +                false,
  +                new Object[] {
  +                    p1,
  +                    p2,
  +                    p3,
  +                    p4,
  +                    p5,
  +                    p6,
  +                    p7,
  +                    p8,
  +                    p9,
  +                    p10,
  +                    p11 });
  +        } catch (Exception e) {
  +            exceptionInTrace(e);
  +        }
  +    }
  +
  +    public static void entry(
  +        Object that,
  +        Object p1,
  +        Object p2,
  +        Object p3,
  +        Object p4,
  +        Object p5,
  +        Object p6,
  +        Object p7,
  +        Object p8,
  +        Object p9,
  +        Object p10,
  +        Object p11,
  +        Object p12) {
  +        try {
  +            if (!ON)
  +                return;
  +            traceIt(
  +                that,
  +                ENTRY,
  +                false,
  +                new Object[] {
  +                    p1,
  +                    p2,
  +                    p3,
  +                    p4,
  +                    p5,
  +                    p6,
  +                    p7,
  +                    p8,
  +                    p9,
  +                    p10,
  +                    p11,
  +                    p12 });
  +        } catch (Exception e) {
  +            exceptionInTrace(e);
  +        }
  +    }
  +
  +    public static void entry(
  +        Object that,
  +        Object p1,
  +        Object p2,
  +        Object p3,
  +        Object p4,
  +        Object p5,
  +        Object p6,
  +        Object p7,
  +        Object p8,
  +        Object p9,
  +        Object p10,
  +        Object p11,
  +        Object p12,
  +        Object p13) {
  +        try {
  +            if (!ON)
  +                return;
  +            traceIt(
  +                that,
  +                ENTRY,
  +                false,
  +                new Object[] {
  +                    p1,
  +                    p2,
  +                    p3,
  +                    p4,
  +                    p5,
  +                    p6,
  +                    p7,
  +                    p8,
  +                    p9,
  +                    p10,
  +                    p11,
  +                    p12,
  +                    p13 });
           } catch (Exception e) {
               exceptionInTrace(e);
           }
  @@ -279,12 +429,11 @@
           try {
               if (!ON)
                   return;
  -            String hc = "static";
  -            if (that != null)
  -                hc = Integer.toHexString(that.hashCode());
  -            Object[] parms =
  +            traceIt(
  +                that,
  +                ENTRY,
  +                false,
                   new Object[] {
  -                    hc,
                       p1,
                       p2,
                       p3,
  @@ -298,9 +447,7 @@
                       p11,
                       p12,
                       p13,
  -                    p14 };
  -            checkWsdl(parms);
  -            TraceLogger.getGeneralTraceLogger().entry(parms);
  +                    p14 });
           } catch (Exception e) {
               exceptionInTrace(e);
           }
  @@ -320,16 +467,17 @@
           Object p10,
           Object p11,
           Object p12,
  -        Object p13) {
  +        Object p13,
  +        Object p14,
  +        Object p15) {
           try {
               if (!ON)
                   return;
  -            String hc = "static";
  -            if (that != null)
  -                hc = Integer.toHexString(that.hashCode());
  -            Object[] parms =
  +            traceIt(
  +                that,
  +                ENTRY,
  +                false,
                   new Object[] {
  -                    hc,
                       p1,
                       p2,
                       p3,
  @@ -342,9 +490,9 @@
                       p10,
                       p11,
                       p12,
  -                    p13 };
  -            checkWsdl(parms);
  -            TraceLogger.getGeneralTraceLogger().entry(parms);
  +                    p13,
  +                    p14,
  +                    p15 });
           } catch (Exception e) {
               exceptionInTrace(e);
           }
  @@ -354,16 +502,7 @@
           try {
               if (!ON)
                   return;
  -
  -            Object[] parms2 = new Object[parms.length + 1];
  -            String hc = "static";
  -            if (that != null)
  -                hc = Integer.toHexString(that.hashCode());
  -            parms2[0] = hc;
  -            for (int i = 0; i < parms.length; i++)
  -                parms2[i + 1] = parms[i];
  -
  -            TraceLogger.getGeneralTraceLogger().entry(parms);
  +            traceIt(that,ENTRY,true,parms);
           } catch (Exception e) {
               exceptionInTrace(e);
           }
  @@ -385,7 +524,7 @@
           try {
               if (!ON)
                   return;
  -            TraceLogger.getGeneralTraceLogger().exit(null);
  +            traceIt(null,EXIT,false,null);
           } catch (Exception e) {
               exceptionInTrace(e);
           }
  @@ -398,7 +537,7 @@
           try {
               if (!ON)
                   return;
  -            TraceLogger.getGeneralTraceLogger().exit(checkWsdl(returnValue));
  +            traceIt(null, EXIT, false, new Object[] { returnValue });
           } catch (Exception e) {
               exceptionInTrace(e);
           }
  @@ -423,27 +562,17 @@
           try {
               if (!ON)
                   return;
  -            TraceLogger.getGeneralTraceLogger().exit(returnValue);
  -        } catch (Exception e) {
  -            exceptionInTrace(e);
  -        }
  -    }
  -
  -    public static void exception(Exception exception) {
  -        try {
  -            if (!ON)
  -                return;
  -            Tr.exception(0,exception);
  +            traceIt(null, EXIT, true, new Object[] { returnValue });
           } catch (Exception e) {
               exceptionInTrace(e);
           }
       }
   
  -    public static void exception(long type, Exception exception) {
  +    public static void exception(Throwable exception) {
           try {
               if (!ON)
                   return;
  -            TraceLogger.getGeneralTraceLogger().exception(type, exception);
  +            log.debug(EXCEPTION, exception);
           } catch (Exception e) {
               exceptionInTrace(e);
           }
  @@ -451,10 +580,7 @@
   
       public static void exceptionInTrace(Exception exception) {
           try {
  -            TraceLogger.getGeneralTraceLogger().trace(
  -                0,
  -                "****** Exception in WSIF trace statement ******");
  -            TraceLogger.getGeneralTraceLogger().exception(0, exception);
  +            log.debug("****** Exception in WSIF trace statement ******",exception);
           } catch (Exception e) {
               exceptionInTrace(e);
           }
  @@ -592,6 +718,8 @@
       }
   
       private static void checkWsdl(Object[] parms) {
  +        if (parms == null)
  +            return;
           for (int i = 0; i < parms.length; i++)
               parms[i] = checkWsdl(parms[i]);
       }
  @@ -661,6 +789,72 @@
           if (o != null)
               str = str + "," + Integer.toHexString(o.hashCode()) + ")";
           return str;
  +    }
  +
  +    private static String getMethodName() {
  +        Exception e = new Exception();
  +        StringWriter sw = new StringWriter();
  +        PrintWriter pw = new PrintWriter(sw);
  +        e.printStackTrace(pw);
  +        String stack = sw.getBuffer().toString();
  +
  +        int idx = stack.indexOf("org.apache.wsif.logging");
  +        while (idx != -1) {
  +            stack = stack.substring(idx + 12);
  +            idx = stack.indexOf("org.apache.wsif.logging");
  +        }
  +
  +        idx = stack.indexOf("org.apache.wsif");
  +        stack = stack.substring(idx);
  +
  +        idx = stack.indexOf("(");
  +        stack = stack.substring(0, idx);
  +
  +        String previous = stack;
  +        idx = stack.indexOf(".");
  +        while (idx != -1) {
  +            previous = stack;
  +            stack = stack.substring(idx + 1);
  +            idx = stack.indexOf(".");
  +        }
  +        return previous;
  +    }
  +    
  +    private static void traceIt(
  +        Object that,
  +        String type,
  +        boolean expandWsdl,
  +        Object[] parms) {
  +
  +        if (!expandWsdl)
  +            checkWsdl(parms);
  +
  +        StringBuffer sb = new StringBuffer(type);
  +
  +        if (type.equals(EXIT))
  +            depth--;
  +        for (int i = 0; i <= depth; i++)
  +            sb.append(" ");
  +        if (type.equals(ENTRY))
  +            depth++;
  +
  +        sb.append(getMethodName());
  +        if (that != null) {
  +            sb.append("<");
  +            sb.append(Integer.toHexString(that.hashCode()));
  +            sb.append(">");
  +        }
  +        sb.append("(");
  +
  +        if (parms != null)
  +            for (int i = 0; i < parms.length; i++) {
  +                if (i != 0)
  +                    sb.append(", ");
  +                sb.append(parms[i] == null ? "<null>" : parms[i].toString());
  +            }
  +        sb.append(")");
  +
  +        log.debug(sb);
       }
   
   }
  
  
  
  1.3       +123 -101  xml-axis-wsif/java/src/org/apache/wsif/logging/MessageLogger.java
  
  Index: MessageLogger.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/src/org/apache/wsif/logging/MessageLogger.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MessageLogger.java	9 Jul 2002 10:37:12 -0000	1.2
  +++ MessageLogger.java	19 Jul 2002 14:39:37 -0000	1.3
  @@ -57,131 +57,153 @@
   
   package org.apache.wsif.logging;
   
  +import java.util.Locale;
  +import java.text.MessageFormat;
  +import java.util.MissingResourceException;
  +import java.util.ResourceBundle;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogFactory;
  +
   /**
  - * Interface for message loggers. Each component should create its own MessageLogger instance
  - * using the {@link #newMessageLogger(String)} factory method. It is recommended not to use
  - * the {@link #text(long,String)} method as it will bypass the message catalog lookup.
  - * When using this method, make sure the string passed as parameter was loaded through an
  - * appropriate message catalog.
  - * @author <a href="mailto:fussi@de.ibm.com">Erich Fussi</a>
    * @author Mark Whitlock <whitlock@apache.org>
    */
  -public abstract class MessageLogger {
  +public class MessageLogger {
  +    private static Log log = LogFactory.getLog("wsif");
  +
       /**
  -     * Default message catalog used when logging messages.
  +     * Message resource bundle.
        */
  -    public static final String MSG_CATALOG = Catalog.MESSAGES_FILE;
  +    private static ResourceBundle messages = null;
   
       /**
  -     * Creates a message logger object. The JLog logger already has a console handler
  -     * associated with it. If in addition messages should be written to a file, use the
  -     * {@link #addFileHandler} method.
  -     * @param component
  -     *    The main class of the component that is logging.
  -     * @return
  -     *    A new message logger object.
  +     * Private constructor so no one can instantiate this class.
        */
  -    public static MessageLogger newMessageLogger(String component) {
  -        return newMessageLogger(component, MSG_CATALOG);
  +    private MessageLogger() {
  +    	Tr.entry(this);
  +    	Tr.exit();
       }
   
  -    /**
  -     * Creates a message logger object.
  -     * @param component
  -     *    The main class of the component that is logging.
  -     * @param catalog
  -     *    The message catalog to use.
  -     * @return
  -     *    A new message logger object.
  -     */
  -    public static MessageLogger newMessageLogger(
  -        String component,
  -        String catalog) {
  -        String className = component;
  +    public static void log(String key) {
  +    	Tr.entry(null,key);
           try {
  -            return new JLogMessageLogger("@product@", component, className, catalog);
  -        } catch (Throwable ignored) {
  +            logIt(key.charAt(key.length() - 1), getMessage(key));
  +        } catch (MissingResourceException mre) {
  +            Tr.exception(mre);
  +            handleMissingResourceException(mre, key, null);
           }
  -
  -        return new DefaultMessageLogger("@product@", component, className, catalog);
  -    }
  -
  -    protected void finalize() throws Throwable {
  -        destroy();
  -        super.finalize();
  +        Tr.exit();
       }
   
       /**
  -     * Cleans up all resources connected with this message logger.
  +     * Logs the message with the given key.  If an argument is 
  +     * specified in the message (in the format of "{0}") then 
  +     * fill in that argument with the value of var.
        */
  -    public void destroy() {
  +    public static void log(String key, Object var) {
  +    	Tr.entry(null,key,var);
  +        String[] args = { var == null ? "<null>" : var.toString()};
  +        try {
  +            logIt(
  +                key.charAt(key.length() - 1),
  +                MessageFormat.format(getMessage(key), args));
  +        } catch (MissingResourceException mre) {
  +            Tr.exception(mre);
  +            handleMissingResourceException(mre, key, args);
  +        }
  +        Tr.exit();
       }
   
       /**
  -     * Registers a new file handler with this logger. Note that this has no effect when running
  -     * within WebSphere. In that case the messages will always be written to
  -     * <code>&lt;WASDir&gt;/logs/actvity.log</code>.
  -     * @param fileName
  -     *    The name of the output file.
  +     * Logs the message with the given key.  If arguments are 
  +     * specified in the message (in the format of "{0} {1}") 
  +     * then fill them in with the values of var1 and var2, respectively.
        */
  -    public abstract void addFileHandler(String fileName);
  -
  -    /**
  -     * Logs a message, by key, with no parameters.
  -     * @param type
  -     *    The type of the record.
  -     * @param key
  -     *    The message key.
  -     */
  -    public void message(long type, String key) {
  -        message(type, key, null);
  +    public static void log(String key, Object var1, Object var2) {
  +    	Tr.entry(null,key,var1,var2);
  +        String[] args = {
  +            var1 == null ? "<null>" : var1.toString(),
  +            var2 == null ? "<null>" : var2.toString()};
  +        try {
  +            logIt(
  +                key.charAt(key.length() - 1),
  +                MessageFormat.format(getMessage(key), args));
  +        } catch (MissingResourceException mre) {
  +            Tr.exception(mre);
  +            handleMissingResourceException(mre, key, args);
  +        }
  +        Tr.exit();
       }
   
       /**
  -     * Logs a message, by key, with one parameter.
  -     * @param type
  -     *    The type of the record.
  -     * @param key
  -     *    The message key.
  -     * @param parm1
  -     *     An element to be inserted into the message.
  -     */
  -    public void message(long type, String key, Object parm1) {
  -        message(type, key, new Object[] { parm1 });
  -    }
  +     * Logs the message with the given key.  Replace each "{X}" 
  +     * in the message with vars[X].  If there are more vars than 
  +     * {X}'s, then the extra vars are ignored.  If there are more {X}'s
  +     * than vars, then a java.text.ParseException (subclass of 
  +     * RuntimeException) is thrown.
  +     */
  +    public static void log(String key, Object[] vars) {
  +    	Tr.entry(null,key,vars);
  +        String[] args;
  +        if (vars == null) {
  +            args = new String[1];
  +            args[0] = "<null>";
  +        } else {
  +            args = new String[vars.length];
  +            for (int i = 0; i < vars.length; i++)
  +                args[i] = (vars[i] == null ? "<null>" : vars[i].toString());
  +        }
   
  -    /**
  -     * Logs a message, by key, with two parameters.
  -     * @param type
  -     *    The type of the record.
  -     * @param key
  -     *    The message key.
  -     * @param parm1
  -     *     An element to be inserted into the message.
  -     * @param parm2
  -     *     An element to be inserted into the message.
  -     */
  -    public void message(long type, String key, Object parm1, Object parm2) {
  -        message(type, key, new Object[] { parm1, parm2 });
  +        try {
  +            logIt(
  +                key.charAt(key.length() - 1),
  +                MessageFormat.format(getMessage(key), args));
  +        } catch (MissingResourceException mre) {
  +            Tr.exception(mre);
  +            handleMissingResourceException(mre, key, args);
  +        }
  +        Tr.exit();
       }
   
       /**
  -     * Logs a message, by key, with an array of parameters.
  -     * @param type
  -     *    The type of the record.
  -     * @param key
  -     *    The message key.
  -     * @param parms
  -     *     An array of elements to be inserted into the message.
  -     */
  -    public abstract void message(long type, String key, Object[] parms);
  -
  -    /**
  -     * Logs a text message with no parameters.
  -     * @param type
  -     *    The type of the record.
  -     * @param text
  -     *    The message text.
  -     */
  -    public abstract void text(long type, String text);
  -}
  \ No newline at end of file
  +     * Get the message with the given key.  
  +     * Load the ResourceBundle here instead of in a static initialiser so it
  +     * won't be loaded if we never log a message.
  +     */
  +    private static String getMessage(String key) {
  +        if (messages == null)
  +            messages = ResourceBundle.getBundle("org.apache.wsif.catalog.Messages");
  +
  +        return messages.getString(key);
  +    }
  +
  +    private static void logIt(char severity, String text) {
  +        if (severity == 'I')
  +            log.info(text);
  +        else if (severity == 'W')
  +            log.warn(text);
  +        else if (severity == 'F')
  +            log.fatal(text);
  +        else // default is error (shouldn't happen)
  +            log.error(text);
  +    }
  +
  +    private static void handleMissingResourceException(
  +        MissingResourceException mre,
  +        String key,
  +        String[] args) {
  +
  +        StringBuffer sb = new StringBuffer("WSIF: Unable to display message ");
  +        sb.append(key);
  +        if (args != null && args.length > 0) {
  +            sb.append(" with arguments ");
  +            for (int i = 0; i < args.length; i++) {
  +                if (i != 0)
  +                    sb.append(", ");
  +                sb.append(args[i]);
  +            }
  +        }
  +        sb.append(" because WSIF MessageLogger caught ");
  +        sb.append(mre.toString());
  +        log.error(sb.toString());
  +    }
  +}
  
  
  
  1.3       +1 -1      xml-axis-wsif/java/src/org/apache/wsif/base/WSIFDefaultPort.java
  
  Index: WSIFDefaultPort.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/src/org/apache/wsif/base/WSIFDefaultPort.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- WSIFDefaultPort.java	25 Jun 2002 16:59:42 -0000	1.2
  +++ WSIFDefaultPort.java	19 Jul 2002 14:39:37 -0000	1.3
  @@ -89,7 +89,7 @@
     	    try {
     	        close();
     	    } catch (WSIFException ex) {
  -            Tr.exception( WSIFConstants.TYPE_EVENT, ex );
  +            Tr.exception( ex );
     	    }
           super.finalize();
     	    Tr.exit();
  
  
  
  1.12      +19 -47    xml-axis-wsif/java/src/org/apache/wsif/base/WSIFServiceImpl.java
  
  Index: WSIFServiceImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/src/org/apache/wsif/base/WSIFServiceImpl.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- WSIFServiceImpl.java	19 Jul 2002 12:34:17 -0000	1.11
  +++ WSIFServiceImpl.java	19 Jul 2002 14:39:37 -0000	1.12
  @@ -109,7 +109,6 @@
   import org.w3c.dom.Element;
   
   import com.ibm.wsdl.extensions.PopulatedExtensionRegistry;
  -import com.ibm.wsdl.util.StringUtils;
   import com.ibm.wsdl.util.xml.QNameUtils;
   
   /**
  @@ -421,15 +420,8 @@
           if (preferredPort != null && myPortsMap.get(preferredPort) != null) {
               wp = getPort(this.preferredPort);
           } else {
  -            if (preferredPort != null) {
  -                MessageLogger messageLog =
  -                    MessageLogger.newMessageLogger("WSIF", "org.apache.wsif.catalog.Messages");
  -                messageLog.message(
  -                    WSIFConstants.TYPE_INFO,
  -                    "WSIF.0011I",
  -                    new Object[] { preferredPort });
  -                messageLog.destroy();
  -            }
  +            if (preferredPort != null)
  +                MessageLogger.log("WSIF.0011I",preferredPort);
               wp = getPort(null);
           }
           Tr.exit(wp);
  @@ -614,23 +606,13 @@
                   Iterator ps = sun.misc.Service.providers(WSIF_DYNAMIC_PROVIDER_CLASS);
                   ArrayList al2 = new ArrayList();
                   while (ps.hasNext()) {
  -                	Object obj = ps.next();
  -                    if (obj instanceof org.apache.wsif.spi.WSIFProvider) {
  +                    Object obj = ps.next();
  +                    if (obj instanceof org.apache.wsif.spi.WSIFProvider)
                           al2.add(obj);
  -                    } else {
  -                        MessageLogger messageLog =
  -                            MessageLogger.newMessageLogger(
  -                                "WSIF",
  -                                "org.apache.wsif.catalog.Messages");
  -                        messageLog.message(
  -                            WSIFConstants.TYPE_WARNING,
  +                    else
  +                        MessageLogger.log(
                               "WSIF.0003W",
  -                            new Object[] {
  -                                (obj == null)
  -                                    ? null
  -                                    : obj.getClass().getName()});
  -                        messageLog.destroy();
  -                    }
  +                            (obj == null) ? null : obj.getClass().getName());
                   }
                   return al2;
               }
  @@ -754,13 +736,7 @@
           for (int i = 1; i < providers.length; i++) {
               providerNames += ", " + providers[i].getClass().getName();
           }
  -        MessageLogger messageLog =
  -            MessageLogger.newMessageLogger("WSIF", "org.apache.wsif.catalog.Messages");
  -        messageLog.message(
  -            WSIFConstants.TYPE_WARNING,
  -            "WSIF.0006W",
  -            new Object[] { uri, providerNames });
  -        messageLog.destroy();
  +        MessageLogger.log("WSIF.0006W",uri, providerNames);
       }
   
       /**
  @@ -769,16 +745,14 @@
        * @param uri   the namespaceURI with multiple WSIFProviders 
        * @param providers  an array of the providers supporting the namespaceURI 
        */
  -    private static void issueChosenProviderMsg(String uri, WSIFProvider provider) {
  -        MessageLogger messageLog =
  -            MessageLogger.newMessageLogger("WSIF", "org.apache.wsif.catalog.Messages");
  -        messageLog.message(
  -            WSIFConstants.TYPE_WARNING,
  +    private static void issueChosenProviderMsg(
  +        String uri,
  +        WSIFProvider provider) {
  +
  +        MessageLogger.log(
               "WSIF.0007I",
  -            new Object[] {
  -                provider == null ? "null" : provider.getClass().getName(),
  -                uri });
  -        messageLog.destroy();
  +            provider == null ? "null" : provider.getClass().getName(),
  +            uri);
       }
   
       /**
  @@ -1183,13 +1157,11 @@
                   }
               } else {
                   // Log message
  -                MessageLogger messageLog =
  -                    MessageLogger.newMessageLogger("WSIF", "org.apache.wsif.catalog.Messages");
  -                messageLog.message(
  -                    WSIFConstants.TYPE_ERROR,
  +                MessageLogger.log(
                       "WSIF.0004E",
  -                    new Object[] { opType, portType.getQName().getLocalPart()});
  -                messageLog.destroy();
  +                    opType,
  +                    portType.getQName().getLocalPart());
  +
                   // End message
                   throw new WSIFException(
                       "operation type "
  
  
  
  1.3       +1 -7      xml-axis-wsif/java/src/org/apache/wsif/base/WSIFDefaultCorrelationService.java
  
  Index: WSIFDefaultCorrelationService.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/src/org/apache/wsif/base/WSIFDefaultCorrelationService.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- WSIFDefaultCorrelationService.java	18 Jun 2002 07:59:18 -0000	1.2
  +++ WSIFDefaultCorrelationService.java	19 Jul 2002 14:39:37 -0000	1.3
  @@ -180,19 +180,13 @@
       private synchronized void remove(ArrayList expiredKeys) {
           Tr.entry(this, expiredKeys);
           if (expiredKeys != null && correlatorStore != null) {
  -            MessageLogger messageLog =
  -                MessageLogger.newMessageLogger("WSIF", "org.apache.wsif.catalog.Messages");
               Serializable id;
               for (Iterator i = expiredKeys.iterator(); i.hasNext();) {
                   id = (Serializable) i.next();
                   correlatorStore.remove(id);
                   timeouts.remove(id);
  -                messageLog.message(
  -                    WSIFConstants.TYPE_WARNING,
  -                    "WSIF.0008W",
  -                    new Object[] { id });
  +                MessageLogger.log("WSIF.0008W",id);
               }
  -            messageLog.destroy();
           }
           Tr.exit();
       }
  
  
  
  1.3       +2 -8      xml-axis-wsif/java/src/org/apache/wsif/util/WSIFCorrelationServiceLocator.java
  
  Index: WSIFCorrelationServiceLocator.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/src/org/apache/wsif/util/WSIFCorrelationServiceLocator.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- WSIFCorrelationServiceLocator.java	12 Jun 2002 10:27:22 -0000	1.2
  +++ WSIFCorrelationServiceLocator.java	19 Jul 2002 14:39:37 -0000	1.3
  @@ -103,20 +103,14 @@
                   cs = (WSIFCorrelationService) o;
               }
           } catch (Exception ex) {
  -            Tr.exception(WSIFConstants.TYPE_EVENT, ex);
  +            Tr.exception(ex);
           } finally {
               if (cs == null) {
                   cs = new WSIFDefaultCorrelationService();
               }
           }
   
  -        MessageLogger messageLog =
  -            MessageLogger.newMessageLogger("WSIF", "org.apache.wsif.catalog.Messages");
  -        messageLog.message(
  -            WSIFConstants.TYPE_INFO,
  -            "WSIF.0009I",
  -            cs.getClass().getName());
  -        messageLog.destroy();
  +        MessageLogger.log("WSIF.0009I", cs.getClass().getName());
   
           Tr.exit(cs);
           return cs;
  
  
  
  1.9       +14 -33    xml-axis-wsif/java/src/org/apache/wsif/util/WSIFUtils.java
  
  Index: WSIFUtils.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/src/org/apache/wsif/util/WSIFUtils.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- WSIFUtils.java	10 Jul 2002 13:26:50 -0000	1.8
  +++ WSIFUtils.java	19 Jul 2002 14:39:37 -0000	1.9
  @@ -150,6 +150,7 @@
                           true,
                           Thread.currentThread().getContextClassLoader());
                   } catch (Throwable ignored) {
  +                	Tr.exception(ignored);
                   }
                   return null;
               }
  @@ -205,6 +206,7 @@
               Method m = initContextClass.getMethod("lookup", lookupSig);
               ws = (WSIFService) m.invoke(ic, lookupArgs);
           } catch (Exception e) {
  +        	Tr.exception(e);
               throw new WSIFException(
                   "Exception while looking up JNDI factory: " + e.getMessage(),
                   e);
  @@ -454,17 +456,8 @@
               Tr.exitExpandWsdl(def);
               return def;
           } catch (WSDLException e) {
  -            // Log message
  -            MessageLogger messageLog =
  -                MessageLogger.newMessageLogger(
  -                    "WSIF",
  -                    "org.apache.wsif.catalog.Messages");
  -            messageLog.message(
  -                WSIFConstants.TYPE_ERROR,
  -                "WSIF.0002E",
  -                new Object[] { wsdlLoc });
  -            messageLog.destroy();
  -            // End message
  +            Tr.exception(e);
  +            MessageLogger.log("WSIF.0002E", wsdlLoc);
               throw e;
           }
       }
  @@ -524,17 +517,8 @@
               Tr.exitExpandWsdl(def);
               return def;
           } catch (WSDLException e) {
  -            // Log message
  -            MessageLogger messageLog =
  -                MessageLogger.newMessageLogger(
  -                    "WSIF",
  -                    "org.apache.wsif.catalog.Messages");
  -            messageLog.message(
  -                WSIFConstants.TYPE_ERROR,
  -                "WSIF.0002E",
  -                new Object[] { documentBase });
  -            messageLog.destroy();
  -            // End message
  +            Tr.exception(e);
  +            MessageLogger.log("WSIF.0002E", documentBase);
               throw e;
           }
       }
  @@ -581,17 +565,8 @@
               Tr.exitExpandWsdl(def);
               return def;
           } catch (WSDLException e) {
  -            // Log message
  -            MessageLogger messageLog =
  -                MessageLogger.newMessageLogger(
  -                    "WSIF",
  -                    "org.apache.wsif.catalog.Messages");
  -            messageLog.message(
  -                WSIFConstants.TYPE_ERROR,
  -                "WSIF.0002E",
  -                new Object[] { wsdlLoc });
  -            messageLog.destroy();
  -            // End message
  +            Tr.exception(e);
  +            MessageLogger.log("WSIF.0002E", wsdlLoc);
               throw e;
           }
       }
  @@ -751,6 +726,7 @@
           try {
               def = WSIFUtils.readWSDL(contextURL, location);
           } catch (WSDLException e) {
  +        	Tr.exception(e);
               throw new WSIFException("Problem reading WSDL document.", e);
           }
           Tr.exitExpandWsdl(def);
  @@ -770,6 +746,7 @@
           try {
               def = WSIFUtils.readWSDL(contextURL, new StringReader(content));
           } catch (WSDLException e) {
  +        	Tr.exception(e);
               throw new WSIFException("Problem reading WSDL document.", e);
           }
           Tr.exitExpandWsdl(def);
  @@ -862,6 +839,7 @@
                       .loadClass(formatHandlerShortName + FORMAT_HANDLER)
                       .newInstance();
           } catch (ClassNotFoundException exn1) {
  +        	Tr.exception(exn1);
               try {
                   ClassLoader cl = Thread.currentThread().getContextClassLoader();
                   formatHandler =
  @@ -870,12 +848,14 @@
                               formatHandlerShortName + ELEMENT_FORMAT_HANDLER)
                           .newInstance();
               } catch (ClassNotFoundException exn2) {
  +  	        	Tr.exception(exn2);
                   try {
                       formatHandler =
                           (WSIFFormatHandler) Class
                               .forName(formatHandlerShortName + FORMAT_HANDLER)
                               .newInstance();
                   } catch (ClassNotFoundException exn3) {
  +		        	Tr.exception(exn3);
                       //try {
                       formatHandler =
                           (WSIFFormatHandler) Class
  @@ -1026,6 +1006,7 @@
                   if (segments.get(0).equals(url.getProtocol()))
                       segments.remove(0);
               } catch (MalformedURLException exn) {
  +	        	Tr.exception(exn);
               }
           }
           Tr.exit(segments);
  
  
  
  1.15      +35 -26    xml-axis-wsif/java/src/org/apache/wsif/providers/soap/apachesoap/WSIFOperation_ApacheSOAP.java
  
  Index: WSIFOperation_ApacheSOAP.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/src/org/apache/wsif/providers/soap/apachesoap/WSIFOperation_ApacheSOAP.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- WSIFOperation_ApacheSOAP.java	10 Jul 2002 13:01:02 -0000	1.14
  +++ WSIFOperation_ApacheSOAP.java	19 Jul 2002 14:39:37 -0000	1.15
  @@ -309,6 +309,7 @@
                   try {
                       types[i] = (Class) mapOfUserTypes.get(qname);
                   } catch (Throwable ignored) {
  +                	Tr.exception(ignored);
                   }
                   if (types[i] == null) {
                       types[i] = (Class) smr.queryJavaType(qname, inputEncodingStyle);
  @@ -350,6 +351,7 @@
                   try {
                       returnType = (Class) mapOfUserTypes.get(qname);
                   } catch (Throwable ignored) {
  +                	Tr.exception(ignored);
                   }
   
                   if (returnType == null) {
  @@ -493,15 +495,10 @@
                   System.err.println("invoking operation " + getName() + " on " + locationUri);
               resp = call.invoke(locationUri, getSoapActionURI());
           } catch (SOAPException e) {
  +            Tr.exception(e);
  +
               // Log message
  -            MessageLogger messageLog =
  -                MessageLogger.newMessageLogger("WSIF", "org.apache.wsif.catalog.Messages");
  -            messageLog.message(
  -                WSIFConstants.TYPE_ERROR,
  -                "WSIF.0005E",
  -                new Object[] { "ApacheSOAP", getName()});
  -            messageLog.destroy();
  -            // End message
  +            MessageLogger.log("WSIF.0005E", "ApacheSOAP", getName());
   
               throw new WSIFException(
                   "SOAPException: " + e.getFaultCode() + e.getMessage(),
  @@ -579,7 +576,9 @@
                   try {
                       partSerializer = (PartSerializer) tmp.getClass().newInstance();
                   } catch (InstantiationException e) {
  +                	Tr.exception(e);
                   } catch (IllegalAccessException e) {
  +                	Tr.exception(e);
                   }
                   partSerializer.setPart(part);
                   Part modelPart = operation.getInput().getMessage().getPart(partName);
  @@ -623,6 +622,7 @@
               // receive response envelope
               env = msg.receiveEnvelope();
           } catch (SOAPException exn) {
  +           	Tr.exception(exn);
               WSIFException e = new WSIFException("SOAP Exception: " + exn.getMessage());
               e.setTargetException(exn);
               throw e;
  @@ -662,7 +662,9 @@
                   try {
                       partSerializer = (PartSerializer) tmp.getClass().newInstance();
                   } catch (InstantiationException e) {
  +                	Tr.exception(e);
                   } catch (IllegalAccessException e) {
  +                	Tr.exception(e);
                   }
                   partSerializer.setPartQName(partType);
                   partSerializer.unmarshall(null, null, element, null, null);
  @@ -849,6 +851,7 @@
               return resp;
   
           } catch (Exception ex) {
  +           	Tr.exception(ex);
               throw new WSIFException(ex.getMessage());
           }
       }
  @@ -1176,24 +1179,27 @@
        * This sets up any context property values in the transport
        */
       private void setTransportContext(SOAPTransport t) {
  -       if ( context == null 
  -       || !(t instanceof SOAPJMSConnection) ) {
  -          return;
  -       }
  -       String partName;
  -       HashMap jmsProps = new HashMap();
  -       for (Iterator i = context.getPartNames(); i.hasNext(); ) {
  -          partName = (String)i.next();
  -          if ( partName.startsWith( WSIFConstants.CONTEXT_JMS_PREFIX ) ) {
  -             try {
  -                jmsProps.put( partName.substring( WSIFConstants.CONTEXT_JMS_PREFIX.length() ), 
  -                              context.getObjectPart( partName ) );
  -             } catch (WSIFException ex) {}
  -          } 
  -       }
  -       if ( jmsProps.size() > 0 ) {
  -          ((SOAPJMSConnection) t).setJmsProperties( jmsProps );
  -       }
  +        if (context == null || !(t instanceof SOAPJMSConnection)) {
  +            return;
  +        }
  +        String partName;
  +        HashMap jmsProps = new HashMap();
  +        for (Iterator i = context.getPartNames(); i.hasNext();) {
  +            partName = (String) i.next();
  +            if (partName.startsWith(WSIFConstants.CONTEXT_JMS_PREFIX)) {
  +                try {
  +                    jmsProps.put(
  +                        partName.substring(
  +                            WSIFConstants.CONTEXT_JMS_PREFIX.length()),
  +                        context.getObjectPart(partName));
  +                } catch (WSIFException ex) {
  +                    Tr.exception(ex);
  +                }
  +            }
  +        }
  +        if (jmsProps.size() > 0) {
  +            ((SOAPJMSConnection) t).setJmsProperties(jmsProps);
  +        }
       }
   
       /**
  @@ -1220,6 +1226,7 @@
                   addHTTPHeader(call, name, (String) o);
               }
           } catch (WSIFException ex) {
  +           	Tr.exception(ex);
               addHTTPHeader(call, name, null);
           }
   
  @@ -1230,6 +1237,7 @@
                   addHTTPHeader(call, name, (String) o);
               }
           } catch (WSIFException ex) {
  +           	Tr.exception(ex);
               addHTTPHeader(call, name, null);
           }
   
  @@ -1240,6 +1248,7 @@
                   addSOAPHeader(call, name, (List) o);
               }
           } catch (WSIFException ex) {
  +           	Tr.exception(ex);
           }
       }
   
  
  
  
  1.12      +84 -59    xml-axis-wsif/java/src/org/apache/wsif/providers/jms/WSIFOperation_Jms.java
  
  Index: WSIFOperation_Jms.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/src/org/apache/wsif/providers/jms/WSIFOperation_Jms.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- WSIFOperation_Jms.java	10 Jul 2002 14:04:35 -0000	1.11
  +++ WSIFOperation_Jms.java	19 Jul 2002 14:39:37 -0000	1.12
  @@ -196,17 +196,19 @@
               receiveJmsMessage(response, output, fault, jmsDest);
   
           } catch (Exception ex) {
  +            Tr.exception(ex);
  +
               // Log message
  -            MessageLogger messageLog =
  -                MessageLogger.newMessageLogger("WSIF", "org.apache.wsif.catalog.Messages");
  -            messageLog.message(
  -                WSIFConstants.TYPE_ERROR,
  +            MessageLogger.log(
                   "WSIF.0005E",
  -                new Object[] { "Jms", fieldBindingOperation.getName()});
  -            messageLog.destroy();
  +                "Jms",
  +                fieldBindingOperation.getName());
   
               throw new WSIFException(
  -                this +" : Could not invoke '" + fieldBindingOperation.getName() + "'",
  +                this
  +                    + " : Could not invoke '"
  +                    + fieldBindingOperation.getName()
  +                    + "'",
                   ex);
           }
   
  @@ -291,17 +293,19 @@
                  }
               }
           } catch (Exception ex) {
  +            Tr.exception(ex);
  +
               // Log message
  -            MessageLogger messageLog =
  -                MessageLogger.newMessageLogger("WSIF", "org.apache.wsif.catalog.Messages");
  -            messageLog.message(
  -                WSIFConstants.TYPE_ERROR,
  +            MessageLogger.log(
                   "WSIF.0005E",
  -                new Object[] { "Jms", fieldBindingOperation.getName()});
  -            messageLog.destroy();
  +                "Jms",
  +                fieldBindingOperation.getName());
   
               throw new WSIFException(
  -                this +" : Could not invoke '" + fieldBindingOperation.getName() + "'",
  +                this
  +                    + " : Could not invoke '"
  +                    + fieldBindingOperation.getName()
  +                    + "'",
                   ex);
           }
   
  @@ -334,17 +338,19 @@
               receiveJmsMessage(responseObject, output, fault, jmsDest);
   
           } catch (Exception ex) {
  +            Tr.exception(ex);
  +
               // Log message
  -            MessageLogger messageLog =
  -                MessageLogger.newMessageLogger("WSIF", "org.apache.wsif.catalog.Messages");
  -            messageLog.message(
  -                WSIFConstants.TYPE_ERROR,
  +            MessageLogger.log(
                   "WSIF.0005E",
  -                new Object[] { "Jms", fieldBindingOperation.getName()});
  -            messageLog.destroy();
  +                "Jms",
  +                fieldBindingOperation.getName());
   
               throw new WSIFException(
  -                this +" : Could not invoke '" + fieldBindingOperation.getName() + "'",
  +                this
  +                    + " : Could not invoke '"
  +                    + fieldBindingOperation.getName()
  +                    + "'",
                   ex);
           }
   
  @@ -504,6 +510,7 @@
   			     WSIFConstants.JMS_PROP_OPERATION_NAME, value );
   		   }
   	    } catch (WSIFException ex) {
  +	    	Tr.exception(ex);
   	    }
   
   	    try {
  @@ -514,6 +521,7 @@
   			     WSIFConstants.JMS_PROP_INPUT_NAME, value );
   		   }
   	    } catch (WSIFException ex) {
  +	    	Tr.exception(ex);
   	    }
   
   	    try {
  @@ -524,6 +532,7 @@
   			     WSIFConstants.JMS_PROP_OUTPUT_NAME, value );
   		   }
   	    } catch (WSIFException ex) {
  +	    	Tr.exception(ex);
   	    }
   
   		// propertyValues from jms:address
  @@ -533,37 +542,46 @@
   		      setJMSPropertyValues(ja.getJMSPropertyValues(), jmsDest);
              }
           } catch (WSIFException ex) {
  +	    	Tr.exception(ex);
   	    }
   
   		// properties from the context
   		setDestinationContext( jmsDest );
   
   		// propertyValues from the input message
  -		if (fieldInputJmsPropertyValues != null) {
  -	       try {
  -			  setJmsPropertyValues( fieldInputJmsPropertyValues, jmsDest );
  - 	       } catch (WSIFException ex) {
  -	       }
  -		}
  +        if (fieldInputJmsPropertyValues != null) {
  +            try {
  +                setJmsPropertyValues(fieldInputJmsPropertyValues, jmsDest);
  +            } catch (WSIFException ex) {
  +                Tr.exception(ex);
  +            }
  +        }
       } 
   
       /**
        * sets the output message properties from the received JMS message.
        */
  -    private void setOutProperties(WSIFJMSDestination jmsDest, WSIFMessage output) {
  -       String partName;
  -       String propertyName;
  -       String propertyValue;
  -       if ( output != null && fieldOutputProperties != null) {
  -    	  for (Iterator i = fieldOutputProperties.keySet().iterator(); i.hasNext(); ) {
  -    	     partName = (String)i.next();
  -    		 propertyName = (String)fieldOutputProperties.get( partName );
  -    		 try {
  -    		    propertyValue = (String)jmsDest.getProperty( propertyName );
  -    		    output.setObjectPart( partName, propertyValue );
  -    		 } catch (WSIFException ex) {}
  -    	  }
  -       }
  +    private void setOutProperties(
  +        WSIFJMSDestination jmsDest,
  +        WSIFMessage output) {
  +
  +        String partName;
  +        String propertyName;
  +        String propertyValue;
  +        if (output != null && fieldOutputProperties != null) {
  +            for (Iterator i = fieldOutputProperties.keySet().iterator();
  +                i.hasNext();
  +                ) {
  +                partName = (String) i.next();
  +                propertyName = (String) fieldOutputProperties.get(partName);
  +                try {
  +                    propertyValue = (String) jmsDest.getProperty(propertyName);
  +                    output.setObjectPart(partName, propertyValue);
  +                } catch (WSIFException ex) {
  +                    Tr.exception(ex);
  +                }
  +            }
  +        }
       }
   
       /**
  @@ -609,12 +627,14 @@
               try {
                   fieldInputMessageName = fieldBindingOperation.getBindingInput().getName();
               } catch (NullPointerException e) {
  +              	Tr.exception(e);
                   fieldInputMessageName = null;
               }
   
               try {
                   fieldOutputMessageName = fieldBindingOperation.getBindingOutput().getName();
               } catch (NullPointerException e) {
  +              	Tr.exception(e);
                   fieldOutputMessageName = null;
               }
   
  @@ -707,6 +727,7 @@
   					primitiveType = constructor.newInstance(new Object[] {value});
   				}
   				catch (Exception e) {
  +	              	Tr.exception(e);
   				}
   			}
   		}
  @@ -733,6 +754,7 @@
                       return t;
                   }
               } catch (ClassCastException exn) {
  +              	Tr.exception(exn);
               }
           }
           Tr.exit(JMSConstants.MESSAGE_TYPE_NOTSET);
  @@ -765,24 +787,27 @@
        * This sets up any context JMS property values in the Destination
        */
       private void setDestinationContext(WSIFJMSDestination dest) {
  -       if ( context == null 
  -       || dest == null ) {
  -          return;
  -       }
  -       String partName;
  -       HashMap jmsProps = new HashMap();
  -       for (Iterator i = context.getPartNames(); i.hasNext(); ) {
  -          partName = (String)i.next();
  -          if ( partName.startsWith( WSIFConstants.CONTEXT_JMS_PREFIX ) ) {
  -             try {
  -                jmsProps.put( partName.substring( WSIFConstants.CONTEXT_JMS_PREFIX.length() ), 
  -                              context.getObjectPart( partName ) );
  -             } catch (WSIFException ex) {}
  -          } 
  -       }
  -       if ( jmsProps.size() > 0 ) {
  -          dest.setProperties( jmsProps );
  -       }
  +        if (context == null || dest == null) {
  +            return;
  +        }
  +        String partName;
  +        HashMap jmsProps = new HashMap();
  +        for (Iterator i = context.getPartNames(); i.hasNext();) {
  +            partName = (String) i.next();
  +            if (partName.startsWith(WSIFConstants.CONTEXT_JMS_PREFIX)) {
  +                try {
  +                    jmsProps.put(
  +                        partName.substring(
  +                            WSIFConstants.CONTEXT_JMS_PREFIX.length()),
  +                        context.getObjectPart(partName));
  +                } catch (WSIFException ex) {
  +                    Tr.exception(ex);
  +                }
  +            }
  +        }
  +        if (jmsProps.size() > 0) {
  +            dest.setProperties(jmsProps);
  +        }
       }
   
       public String deep() {
  
  
  
  1.11      +24 -26    xml-axis-wsif/java/src/org/apache/wsif/providers/java/WSIFOperation_Java.java
  
  Index: WSIFOperation_Java.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/src/org/apache/wsif/providers/java/WSIFOperation_Java.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- WSIFOperation_Java.java	9 Jul 2002 10:37:12 -0000	1.10
  +++ WSIFOperation_Java.java	19 Jul 2002 14:39:37 -0000	1.11
  @@ -1087,19 +1087,19 @@
                   }
               }
           } catch (Exception ex) {
  -        	Tr.exception(ex);
  +            Tr.exception(ex);
  +
               // Log message
  -            MessageLogger messageLog =
  -                MessageLogger.newMessageLogger("WSIF", "org.apache.wsif.catalog.Messages");
  -            messageLog.message(
  -                WSIFConstants.TYPE_ERROR,
  +            MessageLogger.log(
                   "WSIF.0005E",
  -                new Object[] { "Java", fieldJavaOperationModel.getMethodName()});
  -            messageLog.destroy();
  -            // End message
  +                "Java",
  +                fieldJavaOperationModel.getMethodName());
   
               throw new WSIFException(
  -                this +" : Could not invoke '" + fieldJavaOperationModel.getMethodName() + "'",
  +                this
  +                    + " : Could not invoke '"
  +                    + fieldJavaOperationModel.getMethodName()
  +                    + "'",
                   ex);
           }
   
  @@ -1214,16 +1214,13 @@
                   }
               }
           } catch (InvocationTargetException ex) {
  -        	Tr.exception(ex);
  +            Tr.exception(ex);
  +
               // Log message
  -            MessageLogger messageLog =
  -                MessageLogger.newMessageLogger("WSIF", "org.apache.wsif.catalog.Messages");
  -            messageLog.message(
  -                WSIFConstants.TYPE_ERROR,
  +            MessageLogger.log(
                   "WSIF.0005E",
  -                new Object[] { "Java", fieldJavaOperationModel.getMethodName()});
  -            messageLog.destroy();
  -            // End message
  +                "Java",
  +                fieldJavaOperationModel.getMethodName());
   
               throw new WSIFException(
                   this
  @@ -1232,18 +1229,19 @@
                       + "' failed.",
                   ex);
           } catch (Exception ex) {
  -        	Tr.exception(ex);
  +            Tr.exception(ex);
  +
               // Log message
  -            MessageLogger messageLog =
  -                MessageLogger.newMessageLogger("WSIF", "org.apache.wsif.catalog.Messages");
  -            messageLog.message(
  -                WSIFConstants.TYPE_ERROR,
  +            MessageLogger.log(
                   "WSIF.0005E",
  -                new Object[] { "Java", fieldJavaOperationModel.getMethodName()});
  -            messageLog.destroy();
  -            // End message
  +                "Java",
  +                fieldJavaOperationModel.getMethodName());
  +
               throw new WSIFException(
  -                this +" : Could not invoke '" + fieldJavaOperationModel.getMethodName() + "'",
  +                this
  +                    + " : Could not invoke '"
  +                    + fieldJavaOperationModel.getMethodName()
  +                    + "'",
                   ex);
           }
   
  
  
  
  1.8       +20 -43    xml-axis-wsif/java/src/org/apache/wsif/providers/ejb/WSIFOperation_EJB.java
  
  Index: WSIFOperation_EJB.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/src/org/apache/wsif/providers/ejb/WSIFOperation_EJB.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- WSIFOperation_EJB.java	1 Jul 2002 12:36:55 -0000	1.7
  +++ WSIFOperation_EJB.java	19 Jul 2002 14:39:37 -0000	1.8
  @@ -1047,37 +1047,24 @@
                   }
                   if (!found) {
                       // Log message
  -                    MessageLogger messageLog =
  -                        MessageLogger.newMessageLogger(
  -                            "WSIF",
  -                            "org.apache.wsif.catalog.Messages");
  -                    messageLog.message(
  -                        WSIFConstants.TYPE_ERROR,
  +                    MessageLogger.log(
                           "WSIF.0005E",
  -                        new Object[] {
  -                            "EJB",
  -                            fieldEJBOperationModel.getMethodName()});
  -                    messageLog.destroy();
  +                        "EJB",
  +                        fieldEJBOperationModel.getMethodName());
  +
                       // End message
  -                    throw new WSIFException(
  -                        "Operation failed!",
  -                        invocationFault);
  +                    throw new WSIFException("Operation failed!",invocationFault);
                   }
               }
   
           } catch (Exception ex) {
  -        	Tr.exception(ex);
  +            Tr.exception(ex);
  +
               // Log message
  -            MessageLogger messageLog =
  -                MessageLogger.newMessageLogger(
  -                    "WSIF",
  -                    "org.apache.wsif.catalog.Messages");
  -            messageLog.message(
  -                WSIFConstants.TYPE_ERROR,
  +            MessageLogger.log(
                   "WSIF.0005E",
  -                new Object[] { "EJB", fieldEJBOperationModel.getMethodName()});
  -            messageLog.destroy();
  -            // End message
  +                "EJB",
  +                fieldEJBOperationModel.getMethodName());
   
               throw new WSIFException(
                   this
  @@ -1193,18 +1180,13 @@
                           + fieldEJBOperationModel.getMethodName()
                           + "'");
           } catch (InvocationTargetException ex) {
  -        	Tr.exception(ex);
  +            Tr.exception(ex);
  +
               // Log message
  -            MessageLogger messageLog =
  -                MessageLogger.newMessageLogger(
  -                    "WSIF",
  -                    "org.apache.wsif.catalog.Messages");
  -            messageLog.message(
  -                WSIFConstants.TYPE_ERROR,
  +            MessageLogger.log(
                   "WSIF.0005E",
  -                new Object[] { "EJB", fieldEJBOperationModel.getMethodName()});
  -            messageLog.destroy();
  -            // End message
  +                "EJB",
  +                fieldEJBOperationModel.getMethodName());
   
               throw new WSIFException(
                   this
  @@ -1213,18 +1195,13 @@
                       + "' failed.",
                   ex);
           } catch (Exception ex) {
  -        	Tr.exception(ex);
  +            Tr.exception(ex);
  +
               // Log message
  -            MessageLogger messageLog =
  -                MessageLogger.newMessageLogger(
  -                    "WSIF",
  -                    "org.apache.wsif.catalog.Messages");
  -            messageLog.message(
  -                WSIFConstants.TYPE_ERROR,
  +            MessageLogger.log(
                   "WSIF.0005E",
  -                new Object[] { "EJB", fieldEJBOperationModel.getMethodName()});
  -            messageLog.destroy();
  -            // End message
  +                "EJB",
  +                fieldEJBOperationModel.getMethodName());
   
               throw new WSIFException(
                   this
  
  
  
  1.10      +0 -45     xml-axis-wsif/java/src/org/apache/wsif/WSIFConstants.java
  
  Index: WSIFConstants.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/src/org/apache/wsif/WSIFConstants.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- WSIFConstants.java	11 Jul 2002 12:10:16 -0000	1.9
  +++ WSIFConstants.java	19 Jul 2002 14:39:38 -0000	1.10
  @@ -72,51 +72,6 @@
       public static final String WSIF_PROPERTIES = "wsif.properties";
   
       /**
  -     * WSIF property name
  -     */
  -    public static final String WSIF_TRACEMECHANISM = "wsif.tracemechanism";
  -
  -    /**
  -     * WSIF property name
  -     */
  -    public static final String WSIF_TRACE = "wsif.trace";
  -
  -    /**
  -     * WSIF property name
  -     */
  -    public static final String WSIF_TRACEFILE = "wsif.tracefile";
  -
  -    /**
  -     *  Implementation independent trace constant
  -     */
  -    public static final long TYPE_EVENT = 7001;
  -
  -    /**
  -     *  Implementation independent trace constant
  -     */
  -    public static final long TYPE_ENTRY_EXIT = 7002;
  -
  -    /**
  -     *  Implementation independent trace constant
  -     */
  -    public static final long TYPE_DEBUG = 7003;
  -
  -    /**
  -     *  Implementation independent message constant
  -     */
  -    public static final long TYPE_INFO = 7004;
  -
  -    /**
  -     *  Implementation independent message constant
  -     */
  -    public static final long TYPE_WARNING = 7005;
  -
  -    /**
  -     *  Implementation independent message constant
  -     */
  -    public static final long TYPE_ERROR = 7006;
  -
  -    /**
        *  WSIF property for pluggable provider defaults
        */
       public static final String WSIF_PROP_PROVIDER_PFX1 =
  
  
  

Mime
View raw message