문제

I have a desktop Java application that is run from the command line, which takes in some arguments and performs some actions based on these arguments.

Currently, the application is instantiated periodically, performs its function and then exits.

The issue is that the users are unhappy with the amount of time it takes for the application to initialize. In order to work around this, I thought of simply toggling the visibility of the application when it is finished and setting up some kind of IDLE state.

I was trying to figure out a way to pass in new arguments next time the application needs to do work. I found out about SingleInstanceService and was wondering if it is possible to make this work with my application? It's unclear to me what I need to do so that the Single Instance Service runs on the client PC.

Alternatively, is there another solution for my communication problem? I would rather not depend on File I/O to trigger the application's logic.

Thanks.

도움이 되었습니까?

해결책

AFAIK The JNLP API is available only if you launch your application using java web start (JWS) technology: read more here: http://java.com/en/download/faq/java_webstart.xml

If that is an option for you, oracle has some example of how to use the SingleInstanceService here

Implement and Register SingleInstanceListener. It will be invoked with the main-args when new instances of your application is launched.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top