aspose file tools*
The moose likes Distributed Java and the fly likes Distributed object pool Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "Distributed object pool" Watch "Distributed object pool" New topic
Author

Distributed object pool

Victor Thomson
Greenhorn

Joined: Aug 23, 2005
Posts: 5
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

Joined: Mar 22, 2000
Posts: 12779
    
    5
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

Joined: Aug 23, 2005
Posts: 5
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

Joined: Mar 22, 2000
Posts: 12779
    
    5
That should be easily done with Gigaspaces / JavaSpaces.

Here is a nice wikipedia article summarizing tuple space concepts.

Bill
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18563
    
    8

"Victor", please check your private messages regarding an important administrative matter.

Thank you.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Distributed object pool