Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 39609 invoked from network); 7 May 2007 13:57:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 May 2007 13:57:39 -0000 Received: (qmail 29304 invoked by uid 500); 7 May 2007 13:57:43 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 29247 invoked by uid 500); 7 May 2007 13:57:43 -0000 Mailing-List: contact axis-dev-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-dev@ws.apache.org Received: (qmail 29227 invoked by uid 99); 7 May 2007 13:57:42 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 May 2007 06:57:42 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [12.130.29.202] (HELO eero.baz.org) (12.130.29.202) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 May 2007 06:57:33 -0700 Received: by eero.baz.org (Postfix, from userid 1017) id 983218995C; Mon, 7 May 2007 09:57:12 -0400 (EDT) Received: from [192.168.1.3] (psc.progress.com [66.30.193.95]) by eero (tmda-ofmipd) with ESMTP; Mon, 07 May 2007 09:57:11 -0400 (EDT) Message-ID: <463F3031.7020302@thoughtcraft.com> Date: Mon, 07 May 2007 09:57:05 -0400 User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: axis-dev@ws.apache.org Subject: Re: [Axis2] org.apache.axis2.client.async.Callback#onError method signature References: <19e0530f0705070634i525bf0e0j8a86cdb3f65e2b7c@mail.gmail.com> In-Reply-To: <19e0530f0705070634i525bf0e0j8a86cdb3f65e2b7c@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit From: Glen Daniels X-Delivery-Agent: TMDA/1.0.2 (Bold Forbes) X-Virus-Checked: Checked by ClamAV on apache.org Hi dims! Davanum Srinivas wrote: > Does it make sense to change the method as follows? Basically add an > extra paramter in onError? > > public abstract class Callback { > public abstract void onComplete(AsyncResult result); > public abstract void onError(Exception e, AsyncResult result); > } Hm... a couple of thoughts here. First of all, is "onComplete()" really the right name for the callback? If you have an MEP with multiple response messages, mightn't this get called a few times? Perhaps onMessage() is better, and then we can have onComplete() be a separate callback to indicate that the MEP is done. Second, what's the point of AsyncResult? It contains nothing except a MessageContext right now. Recommend dropping this class. Third, why is Callback an abstract class and not just an interface? There doesn't seem to be enough going on there (really just setting the "complete" flag) to warrant the limitations that you get when extending instead of implementing. Fourth, if you get an onError(), does that mean you a) received a fault message, or b) something went wrong on our side? In other words, which MessageContext would we even be receiving here? I think it would be clearer and cleaner to have all received messages, including faults, be handled by onMessage(), and then have onError() be explicitly for the case where something went wrong while sending. Alternately I'd be ok with separate onFault() and onError(). So I'd propose the following: public interface Callback { /** * Received a message, info in the MessageContext. Might be a * fault, so check msgContext.isFault()! */ void onMessage(MessageContext msgContext); /** * Operation is complete. (should we pass OperationContext?) */ void onComplete(); /** * Something went wrong on our side! The MessageContext * is the OUTGOING message. Incoming faults will trigger the * onMessage() callback above. */ void onError(Exception e, MessageContext msgContext); } Thoughts? --Glen --------------------------------------------------------------------- To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org For additional commands, e-mail: axis-dev-help@ws.apache.org