• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Distributed object pool

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That should be easily done with Gigaspaces / JavaSpaces.

Here is a nice wikipedia article summarizing tuple space concepts.

Bill
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Victor", please check your private messages regarding an important administrative matter.

Thank you.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic