ini constructor injection

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

ini constructor injection

domfarr
I'm trying to constructor, via ini, a 3rd party class that only exposes constructor parameters. There are not setting equivalents.

Can this be done via ini configuration? 
Reply | Threaded
Open this post in threaded view
|

Re: ini constructor injection

Jared Bunting-2

I don't believe so.  However, you could write a factory (implement org.apache.shiro.util.Factory) that has setters for the required parameters and then calls the constructor in its "getInstance" method.  Then, in your INI file you just reference the factory class and shiro will take care of invoking getInstance for you.

On Feb 18, 2014 10:06 AM, "Dominic Farr" <[hidden email]> wrote:
I'm trying to constructor, via ini, a 3rd party class that only exposes constructor parameters. There are not setting equivalents.

Can this be done via ini configuration? 
Reply | Threaded
Open this post in threaded view
|

Re: ini constructor injection

domfarr
That's what I'm looking for. Thank you


On 18 February 2014 17:37, Jared Bunting <[hidden email]> wrote:

I don't believe so.  However, you could write a factory (implement org.apache.shiro.util.Factory) that has setters for the required parameters and then calls the constructor in its "getInstance" method.  Then, in your INI file you just reference the factory class and shiro will take care of invoking getInstance for you.

On Feb 18, 2014 10:06 AM, "Dominic Farr" <[hidden email]> wrote:
I'm trying to constructor, via ini, a 3rd party class that only exposes constructor parameters. There are not setting equivalents.

Can this be done via ini configuration?