On Wed, 2002-06-05 at 21:40, Paul Hammant wrote:
> Richard,
> 
> Multi-realm ideas are great lads :-)
> 
> >So, if we
> >decide to support multiple realms how do we provide multiple components
> >that implement the same role (in this case Realm) to a Serviceable
> >component?  Or would that not be the right interface to implement? 
> >What, other than Serviceable, should it become to accomplish this?
> >
> Well here is an idea....
> 
> Have a RealmDelegate block - it is the thing that implements the 
>  "org.apache.avalon.cornerstone.services.security.Realm" ROLE
> 
> It has multiple implementations : JAASRealmDelegate, PAMRealDelegate & 
> JAASnPAMRealmDelegate.  These probably share a parent class (some 
> glorified hashmap).  The trick is that each hasa different service(..) 
> method and looks up more strongly typed services as their class name 
> would hint :
> 
> class JAASnPAMRealmDelegate extends AbstractRealmDelegate {
>   public void service(ServiceManager sm) throws ServiceException{
>     
> realmMap.add("jaas",sm.lookup("org.apache.avalon.cornerstone.services.security.Realm:JAAS"));
>     
> realmMap.add("pam",sm.lookup("org.apache.avalon.cornerstone.services.security.Realm:PAM"));
>   }
> }
> 
> This solution, if it is workable, is based on the fact that ROLE need 
> not be a class name, it is just a string that si expected to have some 
> theme.
> 
> - Paul

That was something I had considered.  The thing about that solution is
that it is impossible to have two components that have the same ROLE. 
For instance, someone (not necessarily me, I'm just trying to think
ahead) might want to have two instances of a JNDIRealm that make use of
two different directories to do the validation.  I think what I was
hoping for was a lookupAll() method or something similar in concept.

> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to