diff --git a/fpnn-lib/src/main/java/com/fpnn/FPClient.java b/fpnn-lib/src/main/java/com/fpnn/FPClient.java index 6a18b4d..6184a0b 100644 --- a/fpnn-lib/src/main/java/com/fpnn/FPClient.java +++ b/fpnn-lib/src/main/java/com/fpnn/FPClient.java @@ -14,11 +14,6 @@ public class FPClient { - public interface IAnswer { - - void sendAnswer(Object payload, boolean exception); - } - public interface IKeyData { FPData getKeyData(FPEncryptor encryptor); @@ -412,7 +407,7 @@ private void pushService(FPData quest) { final FPClient self = this; final FPData fQuest = quest; - this._psr.service(quest, new IAnswer() { + this._psr.service(quest, new FPProcessor.IAnswer() { @Override public void sendAnswer(Object payload, boolean exception) { diff --git a/fpnn-lib/src/main/java/com/fpnn/FPProcessor.java b/fpnn-lib/src/main/java/com/fpnn/FPProcessor.java index 3a58ade..099461d 100644 --- a/fpnn-lib/src/main/java/com/fpnn/FPProcessor.java +++ b/fpnn-lib/src/main/java/com/fpnn/FPProcessor.java @@ -5,9 +5,14 @@ public class FPProcessor { + public interface IAnswer { + + void sendAnswer(Object payload, boolean exception); + } + public interface IProcessor { - void service(FPData data, FPClient.IAnswer answer); + void service(FPData data, IAnswer answer); void onSecond(long timestamp); } @@ -30,7 +35,7 @@ public void setProcessor(IProcessor processor) { this._processor = processor; } - public void service(FPData data, FPClient.IAnswer answer) { + public void service(FPData data, IAnswer answer) { if (this._processor == null) { @@ -39,7 +44,7 @@ public void service(FPData data, FPClient.IAnswer answer) { this._processor = new IProcessor() { @Override - public void service(FPData data, FPClient.IAnswer answer) { + public void service(FPData data, IAnswer answer) { if (data.getFlag() == 0) { diff --git a/fpnn-lib/src/main/java/com/fpnn/callback/FPCallback.java b/fpnn-lib/src/main/java/com/fpnn/callback/FPCallback.java index eae09ce..2982e71 100644 --- a/fpnn-lib/src/main/java/com/fpnn/callback/FPCallback.java +++ b/fpnn-lib/src/main/java/com/fpnn/callback/FPCallback.java @@ -27,7 +27,7 @@ public void addCallback(String key, FPCallback.ICallback callback, int timeout) synchronized (this._exMap) { int ts = timeout <= 0 ? FPConfig.SEND_TIMEOUT : timeout; - long expire = ts + Calendar.getInstance().getTimeInMillis(); + long expire = ts + System.currentTimeMillis(); this._exMap.put(key, expire); } } diff --git a/test-app/.idea/workspace.xml b/test-app/.idea/workspace.xml index 7da7201..e8289b3 100644 --- a/test-app/.idea/workspace.xml +++ b/test-app/.idea/workspace.xml @@ -36,12 +36,9 @@ - - - - - - + + + @@ -49,11 +46,18 @@ - - + + - - + + + + + + + + + @@ -2418,9 +2422,9 @@ - + @@ -2438,26 +2442,11 @@ - + - - - - - - - - - - - - - - - @@ -2641,7 +2630,7 @@ - + @@ -2660,7 +2649,6 @@ - @@ -2673,6 +2661,7 @@ + @@ -2683,14 +2672,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + @@ -2706,10 +2718,7 @@ - - - - + @@ -2819,23 +2828,27 @@ - - + + - - + + + + + + + + + - - - - - - + + + diff --git a/test-main/.idea/workspace.xml b/test-main/.idea/workspace.xml index cdf5245..0fe3f6f 100644 --- a/test-main/.idea/workspace.xml +++ b/test-main/.idea/workspace.xml @@ -27,7 +27,7 @@ - + @@ -89,9 +89,7 @@ - - @@ -114,6 +112,8 @@