You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ws.apache.org by Apache Wiki <wi...@apache.org> on 2008/03/03 12:35:09 UTC

[Ws Wiki] Trivial Update of "FrontPage/Axis/AxisClientConfiguration/InterruptCalls" by RodrigoRuiz

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Ws Wiki" for change notification.

The following page has been changed by RodrigoRuiz:
http://wiki.apache.org/ws/FrontPage/Axis/AxisClientConfiguration/InterruptCalls

The comment on the change is:
Improved exception handling in invoke()

------------------------------------------------------------------------------
    /**
     * {@inheritDoc}
     */
-   @Override public void invoke(MessageContext msgContext) throws AxisFault {
+   @Override public void invoke(MessageContext ctx) throws AxisFault {
+     Thread t = Thread.currentThread();
      try {
        super.invoke(msgContext);
      } catch (AxisFault fault) {
-       Thread t = Thread.currentThread();
+       Throwable cause = fault.getCause();
-       if (fault.getCause() instanceof SocketException && t.isInterrupted()) {
+       if (cause instanceof SocketException && t.isInterrupted()) {
+         InterruptedException ie = new InterruptedException();
+         ie.setStackTrace(cause.getStackTrace());
-         fault = AxisFault.makeFault(new InterruptedException());
+         fault = AxisFault.makeFault(ie);
        }
        throw fault;
      } finally {
-       SOCKETS.remove(Thread.currentThread());
+       SOCKETS.remove(t);
      }
    }
  
    /**
     * {@inheritDoc}
     */
-   @Override protected void getSocket(SocketHolder sockHolder, MessageContext msgContext,
+   @Override protected void getSocket(SocketHolder sock, MessageContext ctx,
      String protocol, String host, int port, int timeout, StringBuffer otherHeaders,
      BooleanHolder useFullURL) throws Exception {
  
-     super.getSocket(sockHolder, msgContext, protocol, host, port,
+     super.getSocket(sock, ctx, protocol, host, port,
          timeout, otherHeaders, useFullURL);
  
-     SOCKETS.put(Thread.currentThread(), sockHolder.getSocket());
+     SOCKETS.put(Thread.currentThread(), sock.getSocket());
    }
  }
  }}}

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@ws.apache.org
For additional commands, e-mail: general-help@ws.apache.org