Refactor from base project
This commit is contained in:
@@ -27,7 +27,7 @@ public class Loader extends AbstractLoader<Loader> {
|
|||||||
String protocol = properties.getOrDefault("server.protocol", "tcp").toString();
|
String protocol = properties.getOrDefault("server.protocol", "tcp").toString();
|
||||||
String implementation = properties.getOrDefault("tcp.implementation", "socket").toString();
|
String implementation = properties.getOrDefault("tcp.implementation", "socket").toString();
|
||||||
int port = Integer.valueOf(properties.getProperty("remote.port"));
|
int port = Integer.valueOf(properties.getProperty("remote.port"));
|
||||||
addForwarder(protocol, implementation, port);
|
addServerForwarder(protocol, implementation, port);
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
throw new LoaderException("Failed to parse remote.port");
|
throw new LoaderException("Failed to parse remote.port");
|
||||||
}
|
}
|
||||||
@@ -43,7 +43,7 @@ public class Loader extends AbstractLoader<Loader> {
|
|||||||
String protocol = properties.getOrDefault("server.protocol", "tcp").toString();
|
String protocol = properties.getOrDefault("server.protocol", "tcp").toString();
|
||||||
String implementation = properties.getOrDefault("tcp.implementation", "socket").toString();
|
String implementation = properties.getOrDefault("tcp.implementation", "socket").toString();
|
||||||
int port = Integer.valueOf(properties.getProperty("server.port"));
|
int port = Integer.valueOf(properties.getProperty("server.port"));
|
||||||
addSender(protocol, implementation, "localhost", port);
|
addServerSender(protocol, implementation, port);
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
throw new LoaderException("Failed to parse server.port");
|
throw new LoaderException("Failed to parse server.port");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ import lirc.Lirc.Number;
|
|||||||
import lirc.Lirc.NumberButton;
|
import lirc.Lirc.NumberButton;
|
||||||
import lirc.Lirc.Signal;
|
import lirc.Lirc.Signal;
|
||||||
import base.Control;
|
import base.Control;
|
||||||
|
import base.Sender;
|
||||||
import base.exception.worker.ActivateException;
|
import base.exception.worker.ActivateException;
|
||||||
import base.exception.worker.DeactivateException;
|
import base.exception.worker.DeactivateException;
|
||||||
import base.sender.Sender;
|
|
||||||
import base.work.Listen;
|
import base.work.Listen;
|
||||||
|
|
||||||
import com.github.boukefalos.lirc.util.SignalObject;
|
import com.github.boukefalos.lirc.util.SignalObject;
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ import lirc.Lirc.Color;
|
|||||||
import lirc.Lirc.Direction;
|
import lirc.Lirc.Direction;
|
||||||
import lirc.Lirc.Number;
|
import lirc.Lirc.Number;
|
||||||
import lirc.Lirc.Signal;
|
import lirc.Lirc.Signal;
|
||||||
import base.receiver.Forwarder;
|
import base.Forwarder;
|
||||||
import base.server.forwarder.AbstractReceiver;
|
import base.server.receiver.AbstractReceiver;
|
||||||
import base.work.Listen;
|
import base.work.Listen;
|
||||||
|
|
||||||
import com.github.boukefalos.lirc.Lirc;
|
import com.github.boukefalos.lirc.Lirc;
|
||||||
|
|||||||
@@ -9,8 +9,7 @@ import com.github.boukefalos.lirc.LircButton;
|
|||||||
import com.github.boukefalos.lirc.implementation.Local;
|
import com.github.boukefalos.lirc.implementation.Local;
|
||||||
import com.github.boukefalos.lirc.util.SignalObject;
|
import com.github.boukefalos.lirc.util.SignalObject;
|
||||||
|
|
||||||
public class TestLocal extends Listen<Object> {
|
public class TestLocal extends Listen<Object> {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
new TestLocal().start();
|
new TestLocal().start();
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user