Skip to content

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

License

Notifications You must be signed in to change notification settings

thnaeff/SingleInstanceLock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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>

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages