why implementing an access control service ? ^_^ maybe = a wery "T5" way?
Chris Lewis-5 wrote: > > Hi all, > > I'm implementing an access control service as a Dispatcher, and > contributing it to the MasterDispatcher service. This dispatcher runs > just before PageRender... and ComponentAction..., so that it can check > if the user is allowed to access the page/resource. This seems to be a > very "T5" way of doing things and completely removes the task of access > control from the pages (ie i don't have to extend a base page that > implements control logic). > I want this service to use a database and am already using > tapestry-hibernate in this project. I figured I could just @Inject the > session into my service just like I would a page or component, but that > doesn't work. In a way that makes sense; services are singletons if I'm > not mistaken (which makes sense), and Sessions exist (and possibly > injected?) per-thread. Being that my service will be started in a > different thread than any request, I think @Inject is ignored. > > So my question is, how should I go about getting access to my database > from my service? I'd like to use the blinding simplicity of of IoC just > giving it to me, but I;m not sure that's an option. Any ideas? > > thanks, > chris > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/t5%3A-%40Inject-hibernate-Session-into-a-service--tf4501533.html#a12838907 Sent from the Tapestry - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]