I would like to utilize zookeeper to create distributed lock. I have the Factory creating LockObject that allow to lock/unlock some value. Every LockObject created by the Factory uses the same org.apache.zookeeper.Zookeeper object.
Now, I would like to use this Factory, as EJB so the other services could use it. We can assume that multiple threads will be using same Zookeeper object simultaneously. What I'm dealing with is to restrict the number of connections that can be created from the application. Is there any kind of connection pool for zookeeper or is single org.apache.zookeeper.Zookeeper object appropriate for this problem?
Best, A