Archived
This forum has been archived. Please start a new discussion on GitHub.
Ice and stateless servers
in Help Center
Hi,
i'm new to Ice and come from a J2EE background, with a distant CORBA knowledge.
I've checked the documentation, but found nothing comparable to a Java Stateless Sessionbean (SSB).
Is there an easy way to build a Ice server that
o uses a pool of (stateless) objects
o guarantees that during a call, the object is used by exactly one client
o grows/shrinks the pool dynamicly
o blocks incoming connections until a pool object is available?
Thanks for any answers,
Jürgen
i'm new to Ice and come from a J2EE background, with a distant CORBA knowledge.
I've checked the documentation, but found nothing comparable to a Java Stateless Sessionbean (SSB).
Is there an easy way to build a Ice server that
o uses a pool of (stateless) objects
o guarantees that during a call, the object is used by exactly one client
o grows/shrinks the pool dynamicly
o blocks incoming connections until a pool object is available?
Thanks for any answers,
Jürgen
0
Comments
-
This isn't hard to implement.
- Allocate a bunch of servants and put them in a free list.
- Write a servant locator that, for each incoming call, takes a servant from the free list, puts the servant into a in-use list, and returns that servant; if the free list is empty, block in the locate() call until a servant gets back into the free list; in the deactivate call, remove the servant from the in-use list and put it back on the free list.
Cheers,
Michi.0 -
Thanks a lot for the quick answer, i'll look at it!0