How to implement a single instance Java application?

后端 未结 17 787
北荒
北荒 2020-11-22 04:32

Sometime I see many application such as msn, windows media player etc that are single instance applications (when user executes while application is running a new applicatio

17条回答
  •  自闭症患者
    2020-11-22 04:42

    I wrote a dedicated library for that https://sanyarnd.github.io/applocker

    It is based on file-channel locking, so it will not block a port number, or deadlock application in case of power outage (channel is released once process is terminated).

    Library is lightweight itself and has a fluent API.

    It was inspired by http://www.sauronsoftware.it/projects/junique/, but it's based on file channels instead. And there are other extra new features.

提交回复
热议问题