Socket based utility librarie for Java. Control that there is only one instance of a program running.
Java
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples/src/com/negusoft/singleinstance/examples
source
README

README

Project: Single Instance
Developer: Borja Lopez Urkidi
Organization: NEGU Soft
Web: http://www.negusoft.com

This is a utility to control the creation of instances across the local system. This means we can check if there is already an instance of certain program running at the moment. It is also possible to implement actions to be performed when attempting to create a new instance if there was already one active.

A socket based mechanism is used to establish the instances. You can select the port number on which you want to work and a listening socket will take it. Like this, the new instance will fail to listen on that port number, meaning that there is another one running. Since it is a socket based system, it allows passing data between the actual instance and the one attempting to establish. This can be useful, for example, to pass a file url to a program that will be opened in the currently running instance, if there is one.