Return-Path: Delivered-To: apmail-jakarta-avalon-dev-archive@apache.org Received: (qmail 47049 invoked from network); 7 Dec 2002 19:57:54 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 7 Dec 2002 19:57:54 -0000 Received: (qmail 16478 invoked by uid 97); 7 Dec 2002 19:59:02 -0000 Delivered-To: qmlist-jakarta-archive-avalon-dev@jakarta.apache.org Received: (qmail 16431 invoked by uid 97); 7 Dec 2002 19:59:01 -0000 Mailing-List: contact avalon-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Avalon Developers List" Reply-To: "Avalon Developers List" Delivered-To: mailing list avalon-dev@jakarta.apache.org Received: (qmail 16419 invoked by uid 98); 7 Dec 2002 19:59:00 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Message-Id: <5.1.0.14.2.20021207205720.00bb06f8@mail.sutic.nu> X-Sender: leo.sutic@mail.inspireinfrastructure.com (Unverified) X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Sat, 07 Dec 2002 21:03:58 +0100 To: avalon-dev@jakarta.apache.org From: Leo Sutic Subject: Locators (was: Re: Context: usage recommendations?) Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-OriginalArrivalTime: 07 Dec 2002 19:57:52.0583 (UTC) FILETIME=[ED3D5570:01C29E2A] X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Stephen wrote: > * Service locator > > This is a new concept that is very similar to the > Merlin extension handler. It a component that provides > a plug-in lookup solution that can be narrowed to a > particular interface (and can be located by the container > using the interface name as the key). A service locator > can be applied to the following three areas: > > * context value lookup > * service lookup > * lifecycle stage handler lookup If you have two interfaces: interface A { void method (); } interface B { void method (); } and a dynamic proxy (or any class) implementing both interfaces: class Proxy implements A, B { ... } Proxy proxy = ...; The two calls: ((A) proxy).method (); ((B) proxy).method (); are indistiguishable. This is true even if you are using a dynamic proxy's InvocationHandler. (In which case they will both be calls to A.method.) Unlike C#, Java has no way of distinguishing through what interface the call was made. I think this makes your idea less useful. (Yes, I have a proposal of my own, writing it right now...) /LS -- To unsubscribe, e-mail: For additional commands, e-mail: