Prevent your application from starting more than once on the same machine
##Example
SingleInstanceLock.setApplicationId("some_unique_application_id");
boolean locked = SingleInstanceLock.lock();
if (locked) {
//Lock acquired
} else {
//Other application instance has lock
}
//...
SingleInstanceLock.release();
This project can be built with Maven
Maven command:
$ mvn clean install
pom.xml entry in your project:
<dependency>
<groupId>ch.thn.app</groupId>
<artifactId>singleinstancelock</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>