whitlock    2003/03/18 07:09:32

  Modified:    java/src/org/apache/wsif/providers/java
                        WSIFOperation_Java.java
  Added:       java/src/org/apache/wsif/providers InvocationHelper.java
  Log:
  16993: create InvocationHelper
  
  Revision  Changes    Path
  1.1                  
xml-axis-wsif/java/src/org/apache/wsif/providers/InvocationHelper.java
  
  Index: InvocationHelper.java
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   *
   * Copyright (c) 2002 The Apache Software Foundation.  All rights 
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer. 
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:  
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "WSIF" and "Apache Software Foundation" must
   *    not be used to endorse or promote products derived from this
   *    software without prior written permission. For written 
   *    permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called "Apache",
   *    nor may "Apache" appear in their name, without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation and was
   * originally based on software copyright (c) 2001, 2002, International
   * Business Machines, Inc., http://www.apache.org.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  package org.apache.wsif.providers;
  
  import org.apache.wsif.WSIFException;
  import org.apache.wsif.WSIFMessage;
  import org.apache.wsif.logging.Trc;
  
  /**
   * A class of static utility methods for use by services
   * 
   * @author Mark Whitlock
   */
  public class InvocationHelper {
      transient private static ThreadLocal context = new ThreadLocal();
        
        private InvocationHelper() {}
        
      public static WSIFMessage getMessageContext() {
          Trc.entry(null);
          WSIFMessage ctxt = (WSIFMessage)context.get();
          Trc.exit(ctxt);
          return ctxt;
      }
      
      public static void setMessageContext(WSIFMessage ctxt) throws WSIFException {
        Trc.entry(null);
        context.set(ctxt);
        Trc.exit();
      }
  }
  
  
  
  1.35      +3 -19     
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.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- WSIFOperation_Java.java   18 Mar 2003 13:52:14 -0000      1.34
  +++ WSIFOperation_Java.java   18 Mar 2003 15:09:32 -0000      1.35
  @@ -64,7 +64,6 @@
   import java.lang.reflect.InvocationTargetException;
   import java.lang.reflect.Method;
   import java.util.ArrayList;
  -import java.util.Arrays;
   import java.util.Enumeration;
   import java.util.HashMap;
   import java.util.Iterator;
  @@ -83,7 +82,6 @@
   import javax.wsdl.Port;
   import javax.xml.namespace.QName;
   
  -import org.apache.wsif.WSIFConstants;
   import org.apache.wsif.WSIFException;
   import org.apache.wsif.WSIFMessage;
   import org.apache.wsif.WSIFOperation;
  @@ -91,8 +89,8 @@
   import org.apache.wsif.base.WSIFDefaultOperation;
   import org.apache.wsif.logging.MessageLogger;
   import org.apache.wsif.logging.Trc;
  +import org.apache.wsif.providers.InvocationHelper;
   import org.apache.wsif.providers.ProviderUtils;
  -import org.apache.wsif.util.WSIFProperties;
   import org.apache.wsif.wsdl.extensions.java.JavaOperation;
   
   /**
  @@ -125,7 +123,6 @@
       protected Map fieldTypeMaps = null;
       protected boolean multiOutParts = false;
       transient private Object returnClass = null;
  -    transient private static ThreadLocal context = new ThreadLocal();
   
       private class FaultMessageInfo {
           String fieldMessageName;
  @@ -986,7 +983,7 @@
   
           Trc.entry(this, input, output, fault);
           close();
  -        setUpContext();
  +        InvocationHelper.setMessageContext(getContext());
   
           boolean operationSucceeded = true;
           boolean usedOutputParam = false;
  @@ -1446,7 +1443,7 @@
   
           Trc.entry(this, input);
           close();
  -        setUpContext();
  +        InvocationHelper.setMessageContext(getContext());
   
           try {
               Object result = null;
  @@ -1632,19 +1629,6 @@
           Trc.exit();
       }
       
  -    public static WSIFMessage getMessageContext() {
  -        Trc.entry(null);
  -        WSIFMessage ctxt = (WSIFMessage)context.get();
  -        Trc.exit(ctxt);
  -        return ctxt;
  -    }
  -    
  -    private void setUpContext() throws WSIFException {
  -     Trc.entry(this);
  -     context.set(getContext());
  -     Trc.exit();
  -    }
  -
       public String deep() {
           String buff = "";
           try {
  
  
  

Reply via email to