Refactor from base project

This commit is contained in:
2015-06-25 16:01:06 +01:00
parent cccb76a03d
commit b422958f5d
4 changed files with 6 additions and 7 deletions

View File

@@ -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");
} }

View File

@@ -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;

View File

@@ -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;

View File

@@ -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 {