diff --git a/Workspace/client/src/main/java/com/pqt/client/module/stat/StatDao.java b/Workspace/client/src/main/java/com/pqt/client/module/stat/StatDao.java index 5a0444b5..57945add 100644 --- a/Workspace/client/src/main/java/com/pqt/client/module/stat/StatDao.java +++ b/Workspace/client/src/main/java/com/pqt/client/module/stat/StatDao.java @@ -57,6 +57,7 @@ public class StatDao { private synchronized void replaceStats(Map stats) { this.stats = new HashMap<>(stats); this.lastRefreshTimestamp = new Date(); + eventFirerer.fireStatChangedEvent(); } public void removeListener(IStatListener listener) { diff --git a/Workspace/client/src/main/java/com/pqt/client/module/stat/listeners/IStatFirerer.java b/Workspace/client/src/main/java/com/pqt/client/module/stat/listeners/IStatFirerer.java index 105af3f2..25d61e83 100644 --- a/Workspace/client/src/main/java/com/pqt/client/module/stat/listeners/IStatFirerer.java +++ b/Workspace/client/src/main/java/com/pqt/client/module/stat/listeners/IStatFirerer.java @@ -4,13 +4,11 @@ import java.util.Map; public interface IStatFirerer { - public abstract void fireGetStatSuccess(); - - public abstract void fireGetStatError(Throwable cause); - - public abstract void fireGetStatRefused(Throwable cause); + void fireGetStatSuccess(); + void fireGetStatError(Throwable cause); + void fireGetStatRefused(Throwable cause); + void fireStatChangedEvent(); void removeListener(IStatListener listener); - void addListener(IStatListener listener); } diff --git a/Workspace/client/src/main/java/com/pqt/client/module/stat/listeners/IStatListener.java b/Workspace/client/src/main/java/com/pqt/client/module/stat/listeners/IStatListener.java index 21c324b9..5e1349c9 100644 --- a/Workspace/client/src/main/java/com/pqt/client/module/stat/listeners/IStatListener.java +++ b/Workspace/client/src/main/java/com/pqt/client/module/stat/listeners/IStatListener.java @@ -5,10 +5,12 @@ import java.util.Map; public interface IStatListener extends EventListener { - public abstract void onGetStatSuccess(); + void onGetStatSuccess(); - public abstract void onGetStatError(Throwable cause); + void onGetStatError(Throwable cause); - public abstract void onGetStatRefused(Throwable cause); + void onGetStatRefused(Throwable cause); + + void onStatChangedEvent(); } diff --git a/Workspace/client/src/main/java/com/pqt/client/module/stat/listeners/SimpleStatFirerer.java b/Workspace/client/src/main/java/com/pqt/client/module/stat/listeners/SimpleStatFirerer.java index d84966e6..3e57a15a 100644 --- a/Workspace/client/src/main/java/com/pqt/client/module/stat/listeners/SimpleStatFirerer.java +++ b/Workspace/client/src/main/java/com/pqt/client/module/stat/listeners/SimpleStatFirerer.java @@ -14,6 +14,7 @@ public class SimpleStatFirerer implements IStatFirerer { /** * @see com.pqt.client.module.stat.listeners.IStatFirerer#fireGetStatSuccess() */ + @Override public void fireGetStatSuccess() { for(IStatListener l : listeners.getListeners(IStatListener.class)){ l.onGetStatSuccess(); @@ -24,6 +25,7 @@ public class SimpleStatFirerer implements IStatFirerer { /** * @see com.pqt.client.module.stat.listeners.IStatFirerer#fireGetStatError(Throwable) */ + @Override public void fireGetStatError(Throwable cause) { for(IStatListener l : listeners.getListeners(IStatListener.class)){ l.onGetStatError(cause); @@ -34,12 +36,20 @@ public class SimpleStatFirerer implements IStatFirerer { /** * @see com.pqt.client.module.stat.listeners.IStatFirerer#fireGetStatRefused(Throwable) */ + @Override public void fireGetStatRefused(Throwable cause) { for(IStatListener l : listeners.getListeners(IStatListener.class)){ l.onGetStatRefused(cause); } } + @Override + public void fireStatChangedEvent() { + for(IStatListener l : listeners.getListeners(IStatListener.class)){ + l.onStatChangedEvent(); + } + } + @Override public void removeListener(IStatListener listener) { listeners.remove(IStatListener.class, listener); diff --git a/Workspace/client/src/main/java/com/pqt/client/module/stat/listeners/StatListenerAdapter.java b/Workspace/client/src/main/java/com/pqt/client/module/stat/listeners/StatListenerAdapter.java index c182895e..a96fd826 100644 --- a/Workspace/client/src/main/java/com/pqt/client/module/stat/listeners/StatListenerAdapter.java +++ b/Workspace/client/src/main/java/com/pqt/client/module/stat/listeners/StatListenerAdapter.java @@ -6,6 +6,7 @@ public class StatListenerAdapter implements IStatListener { /** * @see com.pqt.client.module.stat.listeners.IStatListener#onGetStatSuccess() */ + @Override public void onGetStatSuccess() { } @@ -14,6 +15,7 @@ public class StatListenerAdapter implements IStatListener { /** * @see com.pqt.client.module.stat.listeners.IStatListener#onGetStatError(Throwable) */ + @Override public void onGetStatError(Throwable cause) { } @@ -22,8 +24,14 @@ public class StatListenerAdapter implements IStatListener { /** * @see com.pqt.client.module.stat.listeners.IStatListener#onGetStatRefused(Throwable) */ + @Override public void onGetStatRefused(Throwable cause) { } + @Override + public void onStatChangedEvent() { + + } + }