com.sun.grid.jgrid.server
Class JCEPVersion10Module.ListenerThread

java.lang.Object
  extended byjava.lang.Thread
      extended bycom.sun.grid.jgrid.server.JCEPVersion10Module.ListenerThread
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
JCEPVersion10Module

private class JCEPVersion10Module.ListenerThread
extends java.lang.Thread

This class reads incoming messages from the input stream and forwards the resulting commands through the protocol module.


Field Summary
private  boolean running
          A flag to indicate whether the ListenerThread should continue running
private  java.lang.Thread thread
          The thread which is running the ListenerThread.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
(package private) JCEPVersion10Module.ListenerThread()
          Creates a new ListenerThread.
 
Method Summary
private  void logErrorOrWarn(java.lang.String jobId, java.lang.String error)
          Convenience method to log the error to the client is possible.
 void run()
          When an object implementing interface Runnable is used to create a thread, starting the thread causes the object's run method to be called in that separately executing thread.
(package private)  void stopReading()
          Sets running to false and interrupts thread, causing the ListenerThread to stop reading from the input stream.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, 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

running

private boolean running
A flag to indicate whether the ListenerThread should continue running


thread

private java.lang.Thread thread
The thread which is running the ListenerThread. Used to interrupt the ListenerThread when closing the connection.

Constructor Detail

JCEPVersion10Module.ListenerThread

JCEPVersion10Module.ListenerThread()
Creates a new ListenerThread.

Method Detail

run

public void run()
When an object implementing interface Runnable is used to create a thread, starting the thread causes the object's run method to be called in that separately executing thread.

The general contract of the method run is that it may take any action whatsoever.

See Also:
Thread.run()

stopReading

void stopReading()
Sets running to false and interrupts thread, causing the ListenerThread to stop reading from the input stream. If the ListenerThread is interrupted while trying to read from the input stream, it simply exits quietly.


logErrorOrWarn

private void logErrorOrWarn(java.lang.String jobId,
                            java.lang.String error)
Convenience method to log the error to the client is possible. If that fails, it logs the error to the log.

Parameters:
jobId - the id of the job that caused the error
error - the error to log