LectureGame.Core
Class ConnectionListener

java.lang.Object
  extended by LectureGame.Core.ConnectionListener
All Implemented Interfaces:
java.lang.Runnable

 class ConnectionListener
extends java.lang.Object
implements java.lang.Runnable

Created by IntelliJ IDEA. User: olekrst Date: 10.jan.2007 Time: 16:30:44 This class runs as a separate thread and listens for StudentClient connections.


Field Summary
private  int maxConnections
           
private  NetworkConnectionKeeper networkConnectionKeeper
           
private  boolean serverIsAlive
           
 
Constructor Summary
ConnectionListener(NetworkConnectionKeeper networkConnectionKeeper)
          Thread which listens for incoming connections from studentclients
 
Method Summary
 void run()
          Listens for new connections of the type StudentClient.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

maxConnections

private final int maxConnections

serverIsAlive

private boolean serverIsAlive

networkConnectionKeeper

private final NetworkConnectionKeeper networkConnectionKeeper
Constructor Detail

ConnectionListener

public ConnectionListener(NetworkConnectionKeeper networkConnectionKeeper)
Thread which listens for incoming connections from studentclients

Parameters:
networkConnectionKeeper -
See Also:
NetworkConnectionKeeper
Method Detail

run

public void run()
Listens for new connections of the type StudentClient. Adds them to the networkConnectionKeeper. It's possible to set a limit to the number of allowed simultanous connections i the LectureGame.Core.LG class

Specified by:
run in interface java.lang.Runnable
See Also:
Runnable, LG