jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Guggisberg" <stefan.guggisb...@gmail.com>
Subject Re: passing init values to an AccessManager?
Date Mon, 06 Mar 2006 12:55:34 GMT
On 3/6/06, Torgeir Veimo <torgeir@pobox.com> 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"/>

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.


> --
> Torgeir Veimo <torgeir@pobox.com>

View raw message