com.notuvy.singleapp
Class SingleUserEnforcer

java.lang.Object
  extended by com.notuvy.singleapp.multiuser.GenericEnforcer
      extended by com.notuvy.singleapp.SingleUserEnforcer
All Implemented Interfaces:
Enforcer, Runnable

public abstract class SingleUserEnforcer
extends GenericEnforcer
implements Runnable, Enforcer

A utility that enforces the invocation of a system-wide singleton application instance.

Author:
murali

Field Summary
protected static org.apache.log4j.Logger LOG
           
 
Fields inherited from class com.notuvy.singleapp.multiuser.GenericEnforcer
fAllowSystemExit
 
Constructor Summary
protected SingleUserEnforcer(int pPort, Runnable pRunnable)
           
 
Method Summary
 void attempt()
           
 int getPort()
           
protected abstract  void handleConnection(Socket pSocket)
           
protected abstract  void handlePortConflict()
           
 void run()
           
 void shutdownServer()
           
protected  void takeControl()
           
protected  void wrest(Preemptable pPreemptable)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected static final org.apache.log4j.Logger LOG
Constructor Detail

SingleUserEnforcer

protected SingleUserEnforcer(int pPort,
                             Runnable pRunnable)
Method Detail

getPort

public int getPort()

takeControl

protected void takeControl()

wrest

protected void wrest(Preemptable pPreemptable)

attempt

public void attempt()
Specified by:
attempt in interface Enforcer

run

public void run()
Specified by:
run in interface Runnable

handlePortConflict

protected abstract void handlePortConflict()

handleConnection

protected abstract void handleConnection(Socket pSocket)

shutdownServer

public void shutdownServer()
Specified by:
shutdownServer in interface Enforcer


Copyright © 2012. All Rights Reserved.