public void start() {
thread = new Thread(new Runnable() {
public void run() {
try {
Socket socket;
System.setProperty("sshtools.agent", location);
state.setValue(StartStopState.STARTED);
while ((socket = server.accept()) != null) {
SshAgentConnection agentClient = new SshAgentConnection(keystore,
socket.getInputStream(),
socket.getOutputStream());
}
thread = null;
} catch (IOException ex) {
log.info("The agent listener closed: " +
ex.getMessage());
} finally {
state.setValue(StartStopState.STOPPED);
}
}
});
thread.start();
}
Starts the agent listener thread |