${esc.hash} Named Locks using Hazelcast
This module implement named locks using Hazelcast. It provides two implementations, using members or clients and
rely on Hazelcast ISemaphore instances.
Out of the box "hazelcast" (distributed) named lock implementations are the following:
- `semaphore-hazelcast` implemented in `org.eclipse.aether.named.hazelcast.HazelcastCPSemaphoreNamedLockFactory`.
Full Hazelcast member is used here.
- `semaphore-hazelcast-client` implemented in `org.eclipse.aether.named.hazelcast.HazelcastClientCPSemaphoreNamedLockFactory`
This implementation uses Hazelcast Client, so existing Hazelcast cluster to connect to is a requirement.
The semaphore name prefix is `maven:resolver:` and pre-configuring semaphores in Hazelcast is a must. The Hazelcast
configuration must have the following entry:
- Name prefix: `maven:resolver:` (use pattern matching configuration)
- JDK compatible: true
- Permit count: `Integer.MAX_VALUE` (value `2147483647`)
Example Hazelcast XML relevant snippet:
```xml
├── ${project.artifactId}-${project.version}.jar
└── hazelcast-5.1.1.jar
- Configure Hazelcast instance with `${maven.conf}/hazelcast.xml` or `${maven.conf}/hazelcast-client.xml` (if client used).
See Hazelcast documentation, default Hazelcast configuration discovery is being used.
- Now start a multithreaded Maven build on your project and make sure `NamedSyncContextFactory` is being used.