net.sourceforge.jnlp.services

## Class XSingleInstanceService

- java.lang.Object
- - net.sourceforge.jnlp.services.XSingleInstanceService

    public class XSingleInstanceService
    extends java.lang.Object

This class implements SingleInstanceService

### Constructor Summary

Constructors
`protected` `XSingleInstanceService()` Create a new XSingleInstanceService

### Method Summary

Methods
`void` `addSingleInstanceListener(SingleInstanceListener sil)` Add the specified SingleInstanceListener
`void` `checkSingleInstanceRunning(JNLPFile jnlpFile)` Check if another instance of this application is already running
`void` `initializeSingleInstance()` Initialize the new SingleInstanceService
`void` `removeSingleInstanceListener(SingleInstanceListener sil)` Remove the specified SingleInstanceListener

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### XSingleInstanceService

    protected XSingleInstanceService()

Create a new XSingleInstanceService

### Method Detail

#### initializeSingleInstance

    public void initializeSingleInstance()

Initialize the new SingleInstanceService

Throws:
  `javax.management.InstanceAlreadyExistsException` - if the instance already exists

#### checkSingleInstanceRunning

    public void checkSingleInstanceRunning(JNLPFile jnlpFile)

Check if another instance of this application is already running

Parameters:
  `jnlpFile` - The `JNLPFile` that specifies the application
Throws:
  `InstanceExistsException` - if an instance of this application already exists

#### addSingleInstanceListener

    public void addSingleInstanceListener(SingleInstanceListener sil)

Add the specified SingleInstanceListener

Parameters:
  `sil` - the single instance listener to be added. No action is performed if it is null.
Throws:
  `InstanceExistsException,` - which is likely to terminate the application but not guaranteed to

#### removeSingleInstanceListener

    public void removeSingleInstanceListener(SingleInstanceListener sil)

Remove the specified SingleInstanceListener

Parameters:
  `sil` - the single instance listener to be removed. No action is performed if it is null or not in the notification list.
Throws:
  `InstanceExistsException` - if an instance of this single instance application already exists