avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Unico Hommes" <Un...@hippo.nl>
Subject RE: [Fortress] How to get the role of a component in an Accessor?
Date Wed, 07 Jan 2004 12:52:56 GMT
 

Carsten Ziegeler wrote:
> 
> Carsten Ziegeler wrote:
> >
> > Unico Hommes wrote:
> > >
> > > Carsten Ziegeler wrote:
> > > >
> > > > How can I get the role of a component in an Accessor?
> > > >
> > > > I looked into the context passed to the access() method, but it 
> > > > doesn't seem to contain the role name, e.g.
> > > > a context.get( "component.name" ) doesn't work.
> > > >
> > >
> > > Haven't tried it myself but I think you should be able to get the 
> > > MetaInfoManager via the ServiceManager that you can get from the 
> > > Context object.
> > >
> > > ServiceManager services =
> > > context.get(ContainerManagerConstants.SERVICE_MANAGER);
> > > MetaInfoManager meta = services.lookup(MetaInfoManager.ROLE);
> > >
> > Wow, that's what I call simple :) Thanks!
> >
> It seems that the context directly contains a MetaInfoManager 
> but how do I get the current role name from the MetaInfoManager?
> 

I may misunderstand but isn't this what you are looking for:

MetaInfo info =
metaManager.getMetaInfoForClassName(object.getClass().getName());
Iterator roles = info.getRoles();

Unico

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


Mime
View raw message