cz.cuni.pogamut.server
Class UCCWrapper.ScannerSink

java.lang.Object
  extended by java.lang.Thread
      extended by cz.cuni.pogamut.server.UCCWrapper.StreamSink
          extended by cz.cuni.pogamut.server.UCCWrapper.ScannerSink
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
UCCWrapper

public class UCCWrapper.ScannerSink
extends UCCWrapper.StreamSink

Scanns the output of UCC for some specific srings (Ports bounded. START MATCH).


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 int botsPort
           
private  java.util.regex.Pattern commandletNotFoundPattern
           
 int controlPort
           
 UCCStartException exception
          Exception that ended the startig.
private  java.util.regex.Pattern mapNotFoundPattern
           
private  java.util.regex.Pattern matchStartedPattern
           
private  java.util.regex.Pattern portPattern
           
 java.util.concurrent.CountDownLatch portsBindedLatch
           
 long startingTimeout
           
(package private)  java.util.TimerTask task
           
(package private)  java.util.Timer timer
          Thread that kills ucc process after specified time if the ports arent read from the console.
 
Fields inherited from class cz.cuni.pogamut.server.UCCWrapper.StreamSink
os
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
UCCWrapper.ScannerSink(java.io.InputStream is)
           
 
Method Summary
protected  void handleInput(java.lang.String str)
           
protected  void raiseLatch()
           
 
Methods inherited from class cz.cuni.pogamut.server.UCCWrapper.StreamSink
run
 
Methods inherited from class java.lang.Thread
activeCount, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, checkAccess, 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
 

Field Detail

startingTimeout

public long startingTimeout

exception

public UCCStartException exception
Exception that ended the startig. Should be checked after the latch is raised.


portsBindedLatch

public java.util.concurrent.CountDownLatch portsBindedLatch

controlPort

public int controlPort

botsPort

public int botsPort

timer

java.util.Timer timer
Thread that kills ucc process after specified time if the ports arent read from the console. This prevents freezing the ScannerSink when ucc fails to start.


task

java.util.TimerTask task

portPattern

private final java.util.regex.Pattern portPattern

commandletNotFoundPattern

private final java.util.regex.Pattern commandletNotFoundPattern

mapNotFoundPattern

private final java.util.regex.Pattern mapNotFoundPattern

matchStartedPattern

private final java.util.regex.Pattern matchStartedPattern
Constructor Detail

UCCWrapper.ScannerSink

public UCCWrapper.ScannerSink(java.io.InputStream is)
Method Detail

handleInput

protected void handleInput(java.lang.String str)
Overrides:
handleInput in class UCCWrapper.StreamSink

raiseLatch

protected void raiseLatch()