That works well. We implemented a custom Realm in that way:

http://mail-archives.apache.org/mod_mbox/tomcat-users/200605.mbox/[EMAIL 
PROTECTED]

David Delbecq wrote:
En l'instant précis du 19/03/07 13:31, Tremal Naik s'exprimait en ces
termes:
2007/3/19, David Delbecq <[EMAIL PROTECTED]>:
I don't understand why you try to do a webapp specific stuff (licence
checking) in a server context (a valve).
Well, my license is limiting the number of contemporary sessions, i.e.
there is a limit on the number of users can be logged in at the same
time. So, I need to filter user requests after web app startup. I may
do this after the user has authenticated himself, but this means that
then I should force his logout somehow, and this is more complicated
than simply barring the users at the source.

I'd like to point out that my valve has been defined at the
application specific level, in the  webapps\MyApp\META-INF\context.xml
file

Thanks

How about having your webapp implements some kind on 'license checking
service' and, at webapp startup, put it available at the JNDI level? You
valve (or realm) could then access this named service and simply issue a
'can i log in one more user?' request. This way all you have in
server/lib is a simple interface and the valve itself. All buisness
logic will be implemented by webapp.



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to