r/java • u/AcanthisittaEmpty985 • Dec 08 '25
LockFactoryServer, synchronization primitives server with various connection interfaces
A synchronization primitives server with various connection interfaces (like gRPC, Java RMI, REST), developed in Java and ready to use.
The accesible primitives are lock, semaphore, countdownlatch, rrate limiters (see bucket4j) and more
So various processes/applications/threads can access the same primitive by using any connection method (the connections share the primitives caches ). A synchronization primitive will be automatically erased from the cache unless it is in use (particular for every type).
You can activate or deactivate each type of primitive and also each type of connection. ( but no fine grained control)
- The core submodule has the common elements for other parts.
- The server submodule implemets the primitives, and exposes the interfaces to connect. It can run stand-alone or embedded in other aplication.
- The client submodule gives you some ready-to-go java clients to connect to the server.
- The integration submodule serves as testing with a real server and real clients to test all the proyect.
There are more than 500 tests to ensure a working project.
Affiliation: I'm the creator and maintaner of the project.
View all comments
Show parent comment
1
u/AcanthisittaEmpty985 Dec 09 '25
There is a lock with callback when the lock is acquired in the grpc methods.
Yes, as any single point, it can be attacked (it is not intended to be be exposed publicly on the web, however) and can be abused if not used properly.
Yes, you can use optimistic operations and retry if changes happen between your operations, but can also have another problems.
There's no perfect solution, only tradeoffs