org.apache.jdo.impl.fostore
Class Main.ListenerRunnable

java.lang.Object
  extended byorg.apache.jdo.impl.fostore.Main.ListenerRunnable
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
Main

class Main.ListenerRunnable
extends java.lang.Object
implements java.lang.Runnable

The Listener Thread class. This class creates an incoming Socket and listens on it. When a connection comes in, create a service thread using the new Socket and run it.


Field Summary
(package private)  int port
          The port number to listen on.
 
Constructor Summary
(package private) Main.ListenerRunnable(int port)
          The Runnable class for the Listener Thread.
 
Method Summary
 void run()
          Run the listener thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

port

int port
The port number to listen on.

Constructor Detail

Main.ListenerRunnable

Main.ListenerRunnable(int port)
The Runnable class for the Listener Thread.

Parameters:
port - the port number to listen on.
Method Detail

run

public void run()
Run the listener thread. Create a ServerSocket using the port and backlog parameters and listen on it. For each incoming request, create a ConnectionRunnable and start a thread to service the request. This thread continues to accept incoming connections until the shutdown flag is set, at which point it terminates.

Specified by:
run in interface java.lang.Runnable