src/share/jaxws_classes/com/sun/xml/internal/ws/client/dispatch/PacketDispatch.java

changeset 368
0989ad8c0860
parent 286
f50545b5e2f1
child 637
9c07ef4934dd
     1.1 --- a/src/share/jaxws_classes/com/sun/xml/internal/ws/client/dispatch/PacketDispatch.java	Thu Apr 04 19:05:24 2013 -0700
     1.2 +++ b/src/share/jaxws_classes/com/sun/xml/internal/ws/client/dispatch/PacketDispatch.java	Tue Apr 09 14:51:13 2013 +0100
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -27,8 +27,10 @@
    1.11  
    1.12  import com.sun.istack.internal.Nullable;
    1.13  import com.sun.xml.internal.ws.api.addressing.WSEndpointReference;
    1.14 +import com.sun.xml.internal.ws.api.client.ThrowableInPacketCompletionFeature;
    1.15  import com.sun.xml.internal.ws.api.client.WSPortInfo;
    1.16  import com.sun.xml.internal.ws.api.message.Packet;
    1.17 +import com.sun.xml.internal.ws.api.pipe.Fiber;
    1.18  import com.sun.xml.internal.ws.api.pipe.Tube;
    1.19  import com.sun.xml.internal.ws.binding.BindingImpl;
    1.20  import com.sun.xml.internal.ws.client.WSServiceDelegate;
    1.21 @@ -43,10 +45,12 @@
    1.22   * @since 2.2.6
    1.23   */
    1.24  public class PacketDispatch extends DispatchImpl<Packet> {
    1.25 +    private final boolean isDeliverThrowableInPacket;
    1.26  
    1.27      @Deprecated
    1.28      public PacketDispatch(QName port, WSServiceDelegate owner, Tube pipe, BindingImpl binding, @Nullable WSEndpointReference epr) {
    1.29          super(port, Mode.MESSAGE, owner, pipe, binding, epr);
    1.30 +        isDeliverThrowableInPacket = calculateIsDeliverThrowableInPacket(binding);
    1.31      }
    1.32  
    1.33  
    1.34 @@ -56,10 +60,21 @@
    1.35  
    1.36      public PacketDispatch(WSPortInfo portInfo, Tube pipe, BindingImpl binding, WSEndpointReference epr, boolean allowFaultResponseMsg) {
    1.37          super(portInfo, Mode.MESSAGE, pipe, binding, epr, allowFaultResponseMsg);
    1.38 +        isDeliverThrowableInPacket = calculateIsDeliverThrowableInPacket(binding);
    1.39      }
    1.40  
    1.41      public PacketDispatch(WSPortInfo portInfo, BindingImpl binding, WSEndpointReference epr) {
    1.42          super(portInfo, Mode.MESSAGE, binding, epr, true);
    1.43 +        isDeliverThrowableInPacket = calculateIsDeliverThrowableInPacket(binding);
    1.44 +    }
    1.45 +
    1.46 +    private boolean calculateIsDeliverThrowableInPacket(BindingImpl binding) {
    1.47 +        return binding.isFeatureEnabled(ThrowableInPacketCompletionFeature.class);
    1.48 +    }
    1.49 +
    1.50 +    @Override
    1.51 +    protected void configureFiber(Fiber fiber) {
    1.52 +        fiber.setDeliverThrowableInPacket(isDeliverThrowableInPacket);
    1.53      }
    1.54  
    1.55      @Override

mercurial