net.sourceforge.yagurashogi.server
Class PairingEngine

java.lang.Object
  extended by java.lang.Thread
      extended by net.sourceforge.yagurashogi.server.PairingEngine
All Implemented Interfaces:
java.lang.Runnable

public class PairingEngine
extends java.lang.Thread

A utility that works in background, looks up waiting players and tries to pair them up.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
PairingEngine(ShogiServer shogiServer)
          Creates new instance of PairingEngine.
 
Method Summary
 void run()
          Main loop.
 void startPairing()
          Starts the pairing engine.
 void stopPairing()
          Stops the pairing engine.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PairingEngine

public PairingEngine(ShogiServer shogiServer)
Creates new instance of PairingEngine.

Parameters:
shogiServer - the server instance to associate this engine with
Method Detail

run

public void run()
Main loop.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

startPairing

public void startPairing()
Starts the pairing engine.


stopPairing

public void stopPairing()
Stops the pairing engine.