1 package net.sourceforge.simplegamenet.framework.transport; 2 3 import net.sourceforge.simplegamenet.framework.transport.NewConnectionData; 4 5 class NewConnectionTask implements Runnable { 6 7 private ServerModem serverModem; 8 private NewConnectionData newConnectionData; 9 10 public NewConnectionTask(ServerModem serverModem, 11 NewConnectionData newConnectionData) { 12 this.serverModem = serverModem; 13 this.newConnectionData = newConnectionData; 14 } 15 16 /*** 17 * When an object implementing interface <code>Runnable</code> is used to create a thread, 18 * starting the thread causes the object's <code>run</code> method to be called in that 19 * separately executing thread. 20 * <p/> 21 * The general contract of the method <code>run</code> is that it may take any action 22 * whatsoever. 23 * 24 * @see java.lang.Thread#run() 25 */ 26 public void run() { 27 serverModem.addNewConnection(newConnectionData); 28 } 29 30 }