src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/SEIStub.java

Print this page
rev 472 : 8036030: Update JAX-WS RI integration to latest version
   1 /*
   2  * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package com.sun.xml.internal.ws.client.sei;
  27 
  28 import com.sun.istack.internal.NotNull;
  29 import com.sun.istack.internal.Nullable;
  30 import com.sun.xml.internal.ws.api.SOAPVersion;
  31 import com.sun.xml.internal.ws.api.addressing.WSEndpointReference;
  32 import com.sun.xml.internal.ws.api.client.WSPortInfo;
  33 import com.sun.xml.internal.ws.api.databinding.Databinding;
  34 import com.sun.xml.internal.ws.api.addressing.WSEndpointReference;
  35 import com.sun.xml.internal.ws.api.message.Header;
  36 import com.sun.xml.internal.ws.api.message.Headers;
  37 import com.sun.xml.internal.ws.api.message.Packet;
  38 import com.sun.xml.internal.ws.api.model.MEP;
  39 import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation;
  40 import com.sun.xml.internal.ws.api.pipe.Fiber;
  41 import com.sun.xml.internal.ws.api.pipe.Tube;
  42 import com.sun.xml.internal.ws.api.server.Container;
  43 import com.sun.xml.internal.ws.api.server.ContainerResolver;
  44 import com.sun.xml.internal.ws.binding.BindingImpl;
  45 import com.sun.xml.internal.ws.client.AsyncResponseImpl;
  46 import com.sun.xml.internal.ws.client.RequestContext;
  47 import com.sun.xml.internal.ws.client.ResponseContextReceiver;
  48 import com.sun.xml.internal.ws.client.Stub;
  49 import com.sun.xml.internal.ws.client.WSServiceDelegate;
  50 import com.sun.xml.internal.ws.model.JavaMethodImpl;
  51 import com.sun.xml.internal.ws.model.SOAPSEIModel;


 150                 try {
 151                     return method.invoke(this, args);
 152                 } catch (IllegalAccessException e) {
 153                     // impossible
 154                     throw new AssertionError(e);
 155                 } catch (IllegalArgumentException e) {
 156                     throw new AssertionError(e);
 157                 } catch (InvocationTargetException e) {
 158                     throw e.getCause();
 159                 }
 160             }
 161         } finally {
 162             ContainerResolver.getDefault().exitContainer(old);
 163         }
 164     }
 165 
 166     private void validateInputs(Object proxy, Method method) {
 167         if (proxy == null || !Proxy.isProxyClass(proxy.getClass())) {
 168             throw new IllegalStateException("Passed object is not proxy!");
 169         }
 170         Class<?> declaringClass = method.getDeclaringClass();
 171         if (method == null || declaringClass == null
 172                 || Modifier.isStatic(method.getModifiers())) {
 173             throw new IllegalStateException("Invoking static method is not allowed!");
 174         }
 175     }
 176 
 177     public final Packet doProcess(Packet request, RequestContext rc, ResponseContextReceiver receiver) {
 178         return super.process(request, rc, receiver);
 179     }
 180 
 181     public final void doProcessAsync(AsyncResponseImpl<?> receiver, Packet request, RequestContext rc, Fiber.CompletionCallback callback) {
 182         super.processAsync(receiver, request, rc, callback);
 183     }
 184 
 185     protected final @NotNull QName getPortName() {
 186         return wsdlPort.getName();
 187     }
 188 
 189 
 190     public void setOutboundHeaders(Object... headers) {
 191         if(headers==null)
   1 /*
   2  * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package com.sun.xml.internal.ws.client.sei;
  27 
  28 import com.sun.istack.internal.NotNull;
  29 import com.sun.istack.internal.Nullable;
  30 import com.sun.xml.internal.ws.api.SOAPVersion;

  31 import com.sun.xml.internal.ws.api.client.WSPortInfo;
  32 import com.sun.xml.internal.ws.api.databinding.Databinding;
  33 import com.sun.xml.internal.ws.api.addressing.WSEndpointReference;
  34 import com.sun.xml.internal.ws.api.message.Header;
  35 import com.sun.xml.internal.ws.api.message.Headers;
  36 import com.sun.xml.internal.ws.api.message.Packet;
  37 import com.sun.xml.internal.ws.api.model.MEP;
  38 import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation;
  39 import com.sun.xml.internal.ws.api.pipe.Fiber;
  40 import com.sun.xml.internal.ws.api.pipe.Tube;
  41 import com.sun.xml.internal.ws.api.server.Container;
  42 import com.sun.xml.internal.ws.api.server.ContainerResolver;
  43 import com.sun.xml.internal.ws.binding.BindingImpl;
  44 import com.sun.xml.internal.ws.client.AsyncResponseImpl;
  45 import com.sun.xml.internal.ws.client.RequestContext;
  46 import com.sun.xml.internal.ws.client.ResponseContextReceiver;
  47 import com.sun.xml.internal.ws.client.Stub;
  48 import com.sun.xml.internal.ws.client.WSServiceDelegate;
  49 import com.sun.xml.internal.ws.model.JavaMethodImpl;
  50 import com.sun.xml.internal.ws.model.SOAPSEIModel;


 149                 try {
 150                     return method.invoke(this, args);
 151                 } catch (IllegalAccessException e) {
 152                     // impossible
 153                     throw new AssertionError(e);
 154                 } catch (IllegalArgumentException e) {
 155                     throw new AssertionError(e);
 156                 } catch (InvocationTargetException e) {
 157                     throw e.getCause();
 158                 }
 159             }
 160         } finally {
 161             ContainerResolver.getDefault().exitContainer(old);
 162         }
 163     }
 164 
 165     private void validateInputs(Object proxy, Method method) {
 166         if (proxy == null || !Proxy.isProxyClass(proxy.getClass())) {
 167             throw new IllegalStateException("Passed object is not proxy!");
 168         }
 169         if (method == null || method.getDeclaringClass() == null

 170                 || Modifier.isStatic(method.getModifiers())) {
 171             throw new IllegalStateException("Invoking static method is not allowed!");
 172         }
 173     }
 174 
 175     public final Packet doProcess(Packet request, RequestContext rc, ResponseContextReceiver receiver) {
 176         return super.process(request, rc, receiver);
 177     }
 178 
 179     public final void doProcessAsync(AsyncResponseImpl<?> receiver, Packet request, RequestContext rc, Fiber.CompletionCallback callback) {
 180         super.processAsync(receiver, request, rc, callback);
 181     }
 182 
 183     protected final @NotNull QName getPortName() {
 184         return wsdlPort.getName();
 185     }
 186 
 187 
 188     public void setOutboundHeaders(Object... headers) {
 189         if(headers==null)