org.objectweb.cjdbc.controller.core
Class ControllerServerThread

java.lang.Object
  extended byjava.lang.Thread
      extended byorg.objectweb.cjdbc.controller.core.ControllerServerThread
All Implemented Interfaces:
java.lang.Runnable

public class ControllerServerThread
extends java.lang.Thread

A ControllerServerThread listens for C-JDBC driver connections. It accepts the connection and give them to ControllerWorkerThreads.

Version:
1.0
Author:
Emmanuel Cecchet , Duncan Smith
See Also:
ControllerWorkerThread

Field Summary
protected  Controller controller
           
protected  java.util.ArrayList controllerServerThreadPendingQueue
          Pending queue of client (driver) socket connections
protected  int idleWorkerThreads
          Number of idle ControllerWorkerThread.
private  boolean isShuttingDown
           
(package private) static Trace logger
          Logger instance.
private  java.net.ServerSocket serverSocket
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ControllerServerThread(Controller controller)
          Creates a new ControllerServerThread that listens on the given port.
 
Method Summary
 int getControllerServerThreadPendingQueueSize()
           
 int getIdleWorkerThreads()
           
 boolean isShuttingDown()
          Returns the isShuttingDown value.
 void run()
          Accepts connections from drivers, read the virtual database name and returns the connection point.
 void shutdown()
          Refuse new connection to clients and finish transaction
 
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

serverSocket

private java.net.ServerSocket serverSocket

isShuttingDown

private boolean isShuttingDown

controller

protected Controller controller

controllerServerThreadPendingQueue

protected java.util.ArrayList controllerServerThreadPendingQueue
Pending queue of client (driver) socket connections


idleWorkerThreads

protected int idleWorkerThreads
Number of idle ControllerWorkerThread. Access to this variable must be synchronized using pendingQueue.


logger

static Trace logger
Logger instance.

Constructor Detail

ControllerServerThread

public ControllerServerThread(Controller controller)
Creates a new ControllerServerThread that listens on the given port.

Parameters:
controller - The controller which created this thread.
Method Detail

run

public void run()
Accepts connections from drivers, read the virtual database name and returns the connection point.


shutdown

public void shutdown()
Refuse new connection to clients and finish transaction


getControllerServerThreadPendingQueueSize

public int getControllerServerThreadPendingQueueSize()
Returns:
Returns the controllerServerThreadPendingQueue size.

getIdleWorkerThreads

public int getIdleWorkerThreads()
Returns:
Returns the idleWorkerThreads.

isShuttingDown

public boolean isShuttingDown()
Returns the isShuttingDown value.

Returns:
Returns the isShuttingDown.


Copyright © 2002, 2005 - ObjectWeb Consortium - All Rights Reserved.