avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject Re: Resolver package--Please post your thoughts
Date Wed, 13 Feb 2002 19:40:17 GMT
Antti Koivunen wrote:
> 4. Loose Token?
> 
> As I see it, it's mainly a matter of
> 
>   Token token = resolver.lookup(MY_URI);
>   MyComponent mc = (MyComponent) token.reference();
>   token.release();
> 
> vs.
> 
>   MyComponent mc = (MyComponent) resolver.lookup(MY_URI);
>   resolver.release(MY_URI, mc);
> 
> And the same thing for String[] + Object[]. Which one do you like best?


For the time being, I think we settled on the direct approach:

interface ServiceManager
{
     /**
      * Return component for the specified role.  If there are more than
      * one components for the role, return the default.
      */
     Object lookup(String role);

     /**
      * Return component for the specified role.  If there are more than
      * one components for the role, use the supplied parameters to determine
      * which one.  If the parameters do not help, return the default.
      */
     Object lookup(String role, Parameters params);

     /**
      * Returns true if the ServiceManager has at least one instance of a
      * role.
      */
     boolean hasComponent( String role );

     /**
      * Release a sepecific component.
      */
     void release(Object component);
}



-- 

"They that give up essential liberty to obtain a little temporary safety
  deserve neither liberty nor safety."
                 - Benjamin Franklin


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


Mime
View raw message