com.notuvy.singleapp
Class DummyApp.Preemt

java.lang.Object
  extended by com.notuvy.singleapp.DummyApp
      extended by com.notuvy.singleapp.DummyApp.Preemt
All Implemented Interfaces:
Preemptable, Runnable
Enclosing class:
DummyApp

public static class DummyApp.Preemt
extends DummyApp
implements Preemptable


Nested Class Summary
 
Nested classes/interfaces inherited from class com.notuvy.singleapp.DummyApp
DummyApp.Defer, DummyApp.Preemt
 
Field Summary
 
Fields inherited from class com.notuvy.singleapp.DummyApp
alive, LOG
 
Constructor Summary
DummyApp.Preemt()
           
 
Method Summary
 void gracefulExitForPreempt()
          The final hook allowing the preempted application to shutdown gracefully.
 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 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 class com.notuvy.singleapp.DummyApp
main, run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.lang.Runnable
run
 

Constructor Detail

DummyApp.Preemt

public DummyApp.Preemt()
Method Detail

gracefulExitForPreempt

public void gracefulExitForPreempt()
Description copied from interface: Preemptable
The final hook allowing the preempted application to shutdown gracefully.

Specified by:
gracefulExitForPreempt in interface Preemptable

sendToPreemptor

public Serializable sendToPreemptor()
Description copied from interface: Preemptable
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.

Specified by:
sendToPreemptor in interface Preemptable
Returns:
A serializable object that communicates the handoff from the dying application to the surviving one.

recvFromPreempted

public void recvFromPreempted(Object pObject)
Description copied from interface: Preemptable
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.

Specified by:
recvFromPreempted in interface Preemptable
Parameters:
pObject - A serializable object that communicates the handoff from the dying application to the surviving one.


Copyright © 2012. All Rights Reserved.