refactoring
This commit is contained in:
parent
3f3ee0ef19
commit
abd5b755e9
|
@ -0,0 +1,11 @@
|
|||
package com.rusefi.io;
|
||||
|
||||
public class AbstractConnectionStateListener implements ConnectionStateListener {
|
||||
@Override
|
||||
public void onConnectionEstablished() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnectionFailed() {
|
||||
}
|
||||
}
|
|
@ -5,15 +5,7 @@ package com.rusefi.io;
|
|||
* 3/1/2017
|
||||
*/
|
||||
public interface ConnectionStateListener {
|
||||
ConnectionStateListener VOID = new ConnectionStateListener() {
|
||||
@Override
|
||||
public void onConnectionEstablished() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnectionFailed() {
|
||||
}
|
||||
};
|
||||
ConnectionStateListener VOID = new AbstractConnectionStateListener();
|
||||
|
||||
/**
|
||||
* This method is invoked once we have connection & configuration from controller
|
||||
|
|
|
@ -48,11 +48,7 @@ public class MainFrame {
|
|||
this.consoleUI = consoleUI;
|
||||
|
||||
this.tabbedPane = tabbedPane;
|
||||
listener = new ConnectionStateListener() {
|
||||
@Override
|
||||
public void onConnectionFailed() {
|
||||
}
|
||||
|
||||
listener = new AbstractConnectionStateListener() {
|
||||
@Override
|
||||
public void onConnectionEstablished() {
|
||||
FileLog.MAIN.logLine("onConnectionEstablished");
|
||||
|
|
|
@ -4,7 +4,7 @@ import com.devexperts.logging.Logging;
|
|||
import com.opensr5.ConfigurationImage;
|
||||
import com.rusefi.binaryprotocol.BinaryProtocol;
|
||||
import com.rusefi.config.generated.Fields;
|
||||
import com.rusefi.io.ConnectionStateListener;
|
||||
import com.rusefi.io.AbstractConnectionStateListener;
|
||||
import com.rusefi.io.IoStream;
|
||||
import com.rusefi.io.LinkManager;
|
||||
import com.rusefi.io.commands.HelloCommand;
|
||||
|
@ -32,16 +32,11 @@ public class NetworkConnector {
|
|||
.setNeedPullData(false);
|
||||
|
||||
CountDownLatch onConnected = new CountDownLatch(1);
|
||||
controllerConnector.startAndConnect(controllerPort, new ConnectionStateListener() {
|
||||
controllerConnector.startAndConnect(controllerPort, new AbstractConnectionStateListener() {
|
||||
@Override
|
||||
public void onConnectionEstablished() {
|
||||
onConnected.countDown();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnectionFailed() {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
log.info("Connecting to controller...");
|
||||
|
|
Loading…
Reference in New Issue