com.notuvy.singleapp
Interface SingleApp

All Superinterfaces:
Runnable

public interface SingleApp
extends Runnable

An application that want to automatically be managed as a single invocation must implement this to be able to use SingleAppEnforcer.

Author:
murali

Method Summary
 void forceExit()
          Force death if not graceful.
 void gracefulExitForPreempt()
          The final hook allowing the preempted application to shutdown gracefully.
 void recvFromDeferred(Object pObject)
          Callback to handle the situation where this instance is running, and a second instance attempted to start but deferred to this.
 void recvFromPreempted(Object pObject)
          Callback to handle the situation where an earlier instance is running, and a this instance started and told it to die.
 Serializable sendFromDeferred()
          Callback to handle the situation where another instance was running earlier, and this instance attempted to start but deferred to that.
 Serializable sendToPreemptor()
          Callback to handle the situation where this instance is running, and a second instance started and told this one to die.
 
Methods inherited from interface java.lang.Runnable
run
 

Method Detail

sendFromDeferred

Serializable sendFromDeferred()
Callback to handle the situation where another instance was running earlier, and this instance attempted to start but deferred to that. This method can contain any logic needed to handle handoff data between the two.

Returns:
A serializable object that communicates the handoff from the dying application to the surviving one.

recvFromDeferred

void recvFromDeferred(Object pObject)
Callback to handle the situation where this instance is running, and a second instance attempted to start but deferred to this. This method can contain any logic needed to handle handoff data between the two.

Parameters:
pObject - A serializable object that communicates the handoff from the dying application to the surviving one.

sendToPreemptor

Serializable sendToPreemptor()
Callback to handle the situation where this instance is running, and a second instance started and told this one to die. This method can contain any logic needed to handle handoff data between the two.

Returns:
A serializable object that communicates the handoff from the dying application to the surviving one.

recvFromPreempted

void recvFromPreempted(Object pObject)
Callback to handle the situation where an earlier instance is running, and a this instance started and told it to die. This method can contain any logic needed to handle handoff data between the two.

Parameters:
pObject - A serializable object that communicates the handoff from the dying application to the surviving one.

gracefulExitForPreempt

void gracefulExitForPreempt()
The final hook allowing the preempted application to shutdown gracefully.


forceExit

void forceExit()
Force death if not graceful. Usually this is just "System.exit(0)", but it is in the interface in case it needs to be overridden.



Copyright © 2012. All Rights Reserved.