Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Distributed object pool

 
Victor Thomson
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,

I am in need of implementing a distributed object pool. That is, I need for multiple JVMs running on separate hardware to be able to access a finite collection of objects. The pool should manage the concurrency and contention for the objects such that if the pool is emptied, the JVM code requesting a new object should appear to block until one becomes available again. Was thinking of trying to use JMS to implement something like this, but not sure if I'm going down the right path with that. Has anyone else implemented something like this? Is there a library or tool that would help here? Looked at Apache Commons Pool, but it doesn't appear to support the distributed use case I've outlined... Also looked at Semaphore, but same thing again...

Many thanks,

-Victor
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13055
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What exactly do you mean by "access a finite collection of objects" ?

Are these serialized Java objects that you want to pass around as needed? If so it sounds like a JavaSpaces application to me.

The GigaSpaces developer edition would be my choice. A central JavaSpaces manager can control access to serialized objects using very flexible rules.

There is some similarity to JMS but with much better control.

Bill
 
Victor Thomson
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, sorry, they would be serializable java objects. Basically, we have an application that we have acquired a limited number of licenses for, and we have applications that run on different machines that need to interact with the software and need to login. So, it would be nice to have these "floating" licenses that separate JVM's could access. The object pool, perhaps GigaSpaces, would manage the concurrency so that each "license" object is only in use once at a time and client apps would block until one becomes available... The object itself could be a very simple POJO that simply contains the username/password in it with appropriate accessors... I hope this makes things a little clearer, but I'm going to investigate GigaSpaces now. Does it still sound like an appropriate solution?

-Victor
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13055
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That should be easily done with Gigaspaces / JavaSpaces.

Here is a nice wikipedia article summarizing tuple space concepts.

Bill
 
Paul Clapham
Sheriff
Pie
Posts: 20750
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Victor", please check your private messages regarding an important administrative matter.

Thank you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic