Created
May 3, 2013 10:31
-
-
Save ceki/5508403 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AbstractSocketAppender extends ... { | |
ConnectionRunner connectionRunner = ...: | |
public final void run() { | |
try { | |
while (!Thread.currentThread().isInterrupted()) { | |
Socket socket = connectionRunner.getSocket(); | |
if(socket == null) | |
break; | |
dispatchEvents(); | |
} | |
} catch (InterruptedException ex) { | |
assert true; // ok... we'll exit now | |
} | |
addInfo("shutting down"); | |
} | |
void stop() { | |
CloseUtil.closeQuietly(socket); | |
task.cancel(true); | |
connectionRunner.stop(); | |
super.stop(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment