Users are allowed a variable number of concurrent sessions, which rules out session beans.
I could read a byte from a stream before processing the request and write a byte to it when done processing. On login write a byte for as many requests they're allowed. I could have a stream like that for each user, there won't be that many of this type, maybe a dozen or 2. Not that it would be such a big deal for the oter thousands but in this particular forum its a more serious consideration.
Anyhat, can you give any other option please? [ August 17, 2008: Message edited by: Taariq San ]
What kind of application are we talking about, J2EE? Or Standard?
What is the definition of concurrent sessions? Are they separate user-specific data stores shared along multiple requests or just separate concurrent threads sharing the same data store? Does each request get a new session? How are sessions generated?
What should be the behavior when the user has no more concurrent sessions? Should new requests fail with an error, or should the requests block until a session becomes available?
How are sessions made available?
You may want to look into the java.util.concurrent.Semaphore. It may help you create a general framework, but it is hard to know if it would be applicable to your situation.
Joined: Nov 20, 2007
Thanks Steve, that's just what I'm after. This fits the bill perfectly so I won't bore you with the details. Happy coding!