Skip to content

Latest commit

 

History

History
64 lines (35 loc) · 1.1 KB

README.md

File metadata and controls

64 lines (35 loc) · 1.1 KB

SingleInstanceLock

Prevent your application from starting more than once on the same machine


License Java Version Apache Maven ready


##Example

	SingleInstanceLock.setApplicationId("some_unique_application_id");

    boolean locked = SingleInstanceLock.lock();
    
    if (locked) {
    	//Lock acquired
    } else {
    	//Other application instance has lock
    }
    
    //...

    SingleInstanceLock.release();
    

Built with Maven

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>