Ejemplo n.º 1
0
 @Override
 public void run() {
   if (connection == null) {
     connection = connector.connect();
   }
   input = connection.getInput();
   reader = new BufferedReader(new InputStreamReader(input));
   keepReading();
 }
Ejemplo n.º 2
0
 /**
  * Suorittaa connectorin varaamisen synkronisesti.
  *
  * @param connector
  */
 public void start(ConnectionStrategy connector) {
   this.connector = connector;
   this.connection = connector.connect();
   super.start(); // Aloitetaan thread kun alkuvalmistelut on tehty
 }