RFC: Netx - Implement SingeInstanceService

Omair Majid omajid at redhat.com
Thu Jun 18 10:00:46 PDT 2009


Hi,

The attached patch adds support for SingleInstanceService to Netx.

It creates a lock file under ~/.netx/locks/ once an application adds a 
SingleInstanceListener to the SingleInstanceService. A second instance 
of the application sees this lock file, sends it's arguments to the 
first instance and shuts down.

ChangeLog:
2009-06-18  Omair Majid  <omajid at redhat.com>

     *rt/net/sourceforge/jnlp/Launcher.java
     (launchApplication): Check for any existing single instance.
     Dont start a second instance.
     *rt/net/sourceforge/jnlp/resources/Messages.properties: Add
     RNoLockDir.
     *rt/net/sourceforge/jnlp/services/ExtendedSingleInstanceService.java
     New file.
     *rt/net/sourceforge/jnlp/services/InstanceExistsException.java: New
     file.
     *rt/net/sourceforge/jnlp/services/ServiceUtil.java
     (getSingleInstanceService): New function.
     (checkExistingSingleInstance): New function.
     *rt/net/sourceforge/jnlp/services/SingleInstanceLock.java: New
     file.
     *rt/net/sourceforge/jnlp/services/XServiceManagerStub.java: Add
     SingleInstanceService to serviceNames. Create a new instance of
     XSingleInstanceService as a privileged proxy.
     *rt/net/sourceforge/jnlp/services/XSingleInstanceService.java: New
     file.

Any comments?

Cheers,
Omair
-------------- next part --------------
A non-text attachment was scrubbed...
Name: netx-single-instance.patch
Type: text/x-patch
Size: 22555 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20090618/db6f9257/netx-single-instance.patch 


More information about the distro-pkg-dev mailing list