On 3/6/06, Torgeir Veimo <[EMAIL PROTECTED]> wrote: > How can I add configuration parameters for an AccessManager > implementation? If I use the example suggested in the example > repository.xml file, I'd have > > <AccessManager > class="org.apache.jackrabbit.core.security.SimpleAccessManager"> > <param name="config" value="${rep.home}/access.xml"/> --> > </AccessManager> > > But how is the config value communicated to the AccessManager instance?
the param values are passed as bean properties, i.e. using setter method, e.g. setConfig(String). an example: <AccessManager class="MyAccessManager"> <param name="foo" value="blah"/> <param name="bar" value="blah"/> </AccessManager> your MyAccessManager class needs to provide the following setter methods: void setFoo(String) void setBar(String) internally an org.apache.commons.collections.BeanMap is used to instantiate an Accessmanager implementation and pass the param values. see o.a.jackrabbit.core.config.BeanConfig for details. > > I assume that RepositoryConfig.getAccessManagerConfig() is involved > somehow, but how do I get to that class from inside an AccessManager? > > Furthermore, what is the lifetime for an AccessManager? If they are > created and discarded each time they are used, where do I do my initial > configuration parsing etc? AccessManager instances are created per session and are disposed (closed) on session logout. cheers stefan > > -- > Torgeir Veimo <[EMAIL PROTECTED]> > >