Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 82282 invoked from network); 23 Dec 2008 19:12:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Dec 2008 19:12:18 -0000 Received: (qmail 46374 invoked by uid 500); 23 Dec 2008 19:12:12 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 46310 invoked by uid 500); 23 Dec 2008 19:12:12 -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 46301 invoked by uid 99); 23 Dec 2008 19:12:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Dec 2008 11:12:12 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of deepalk@gmail.com designates 74.125.46.154 as permitted sender) Received: from [74.125.46.154] (HELO yw-out-1718.google.com) (74.125.46.154) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Dec 2008 19:12:03 +0000 Received: by yw-out-1718.google.com with SMTP id 6so1970655ywa.88 for ; Tue, 23 Dec 2008 11:11:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=zK2r+gSwjxE2KC70bITxBAo4VM8xP6s5LB9W0H4H9Ck=; b=If1EqZ2QR94QgqeANH3szERhbc8kEJ/ERkfX6+IbnrAR7i+TC51+VyZLUKC3d6R29V JqGp5qlygrh5CFC/afLLG70onB4VkA0u5VPMG/ibMHgq0pw5MTANBybWfC+6xyiXYLCm PQ4u1ySXOYt11sNe4qKIHtzEiaJBteO+JrJww= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=ktpZVvvI88roHNYiANudT0bYg4hGQAOHg9531tltu7OWRgQKZ4FQgLCn7apiiVpsyZ NEyV10z6Hh50X6hmJCanfGPBhIE07YmYwxB/m6J+4sz5PWzDf8mSZ4v0kj4hVJrkDyV3 3WSrIp7nFrrNlxWalcFw9J+IVmk1jawAAAENM= Received: by 10.100.134.16 with SMTP id h16mr4820886and.42.1230059502254; Tue, 23 Dec 2008 11:11:42 -0800 (PST) Received: from ?128.61.119.2? (lawn-128-61-119-2.lawn.gatech.edu [128.61.119.2]) by mx.google.com with ESMTPS id d22sm16609381and.0.2008.12.23.11.11.41 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 23 Dec 2008 11:11:41 -0800 (PST) Message-ID: <495137F1.7050002@gmail.com> Date: Tue, 23 Dec 2008 14:11:45 -0500 From: Deepal jayasinghe User-Agent: Thunderbird 2.0.0.18 (Windows/20081105) MIME-Version: 1.0 To: axis-dev@ws.apache.org Subject: Re: [Axis2]Proposal:Change to Handler order resolution Implementation References: In-Reply-To: X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org > Hi All; > > As far as I understood, with current handler order resolution in the > Phase (see org.apache.axis2.engine.Phase) the order of Handlers are > depended on the order they are added. For an example, if there are > handlers A and B and there is a rules in B says B after A, the order > is preserved only if B is added after A. if handlers are added B,A > then since A does not have rules, it is added to somewhere. AFAIK > current code only check rules for the new handler, but does not check > rules in the existing Handlers. > hmm this can be easily solved by adding dependencies to both handlers, for example in handler A we can tell it needs to be after B, and B we can tell it needs to be before A. So you can get this easily done with current impl. I know which will not solve 100% of the problem, but the system is capable of handling that. One other suggestion wold be to add new phases and put the handler there, then that will make sure handlers are in order. > I noticed this problem while developing a Handler, and walk though the > code also verified it. > > However, there is a standard way to solve this problem. The solution > is creating a graph assigning dependencies as edges in a graph--which > is a directed acyclic graph--and then doing a topology sort > http://en.wikipedia.org/wiki/Topological_sort . The algorithm takes > O(n) time and space where n is number of entities + number of rules, > which is pretty reasonable. > > If people agree, I would like to redo the Handler resolution algorithm > in the Phase class with topology sort. Please comment. (Please note I > can not commit for a time line, but will do it when I get a free > time.) > > I am -0 on this, I know how many issues I have fixed alone the way specially in handlers and phases. You can see what we are doing is simple, but in different scenarios you have different issues, like engaging, dis-engaging and etc... Just because we have fixed so many issues I am nit going to tell that we should not make any changes, it is ok (and we should) do changes. But .... , if we have a way around to solve the problem then we should not take this as a high priority item. Adding something, the initial implementation of Axis2 did support what you ask for, but later we decided to change into this structure. And after implementation of Dynamic Phases most of the problem were able to solve very easily. Even your problem can be easily solve with that. Thanks Deepal > Thanks very much > Srinath > > -- Thank you! http://blogs.deepal.org http://deepal.org