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:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to