Re: Access Hibernate with out injection

2014-11-18 Thread Thiago H de Paula Figueiredo
On Tue, 18 Nov 2014 18:45:48 -0200, Harry Zhou wrote: 2. You can make RRealm a Tapestry IoC service (by creating an interface, an implementation, and bind the two in AppModule). Actually, that's recommended, but not needed. You can define a service based on a concrete class: binder.bind(

Re: Access Hibernate with out injection

2014-11-18 Thread Thiago H de Paula Figueiredo
On Tue, 18 Nov 2014 18:24:47 -0200, dragon wrote: @Contribute(WebSecurityManager.class) public static void addRealms(Configuration configuration) { CredentialsMatcher credentialsMatcher = new RCredentialsMatcher(); RRealm realm = new RRealm(); As Harry said, you're inst

Re: Access Hibernate with out injection

2014-11-18 Thread Harry Zhou
Hi Dragon, I believe what Kalle and Thiago are saying is that @Inject in your realm will not work unless your realm is itself a service or a component (such as a page). In your code, the "RRealm realm" is a plain old java object instantiated using "new". Tapestry IoC injection service will not b

Re: Access Hibernate with out injection

2014-11-18 Thread dragon
On 11/18/2014 02:50 PM, Kalle Korhonen wrote: > You make your AuthorizingRealm a Tapestry service or at least let the ioc > @Autobuild it for you. This is all fairly well covered at > http://tynamo.org/tapestry-security+guide but sounds like you might not be > using tapestry-security. Anyway, here

Re: Access Hibernate with out injection

2014-11-18 Thread Thiago H de Paula Figueiredo
On Tue, 18 Nov 2014 17:40:46 -0200, dragon wrote: Im trying to access a hibernate entity/database from a shiro AuthorizingRealm extending class. Since the tapestry IOC does not inject outside Pages / Components, I'm sorry, but this is completely wrong. Anything which is a Tapestry-IoC servi

Re: Access Hibernate with out injection

2014-11-18 Thread Kalle Korhonen
You make your AuthorizingRealm a Tapestry service or at least let the ioc @Autobuild it for you. This is all fairly well covered at http://tynamo.org/tapestry-security+guide but sounds like you might not be using tapestry-security. Anyway, here's an sample service realm (in JPA but same difference)

Access Hibernate with out injection

2014-11-18 Thread dragon
Im trying to access a hibernate entity/database from a shiro AuthorizingRealm extending class. Since the tapestry IOC does not inject outside Pages / Components, how do i access the Hibernate Session so i can access the database? Thanks for any suggestions. -