avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leo Sutic <leo.su...@inspireinfrastructure.com>
Subject Locators (was: Re: Context: usage recommendations?)
Date Sat, 07 Dec 2002 20:03:58 GMT
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...)


To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>

View raw message