streams-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sblack...@apache.org
Subject [1/2] incubator-streams git commit: STREAMS-234 | Added an implementation of the MessagePersister interface which uses SLF4J to write out JMX information
Date Mon, 01 Dec 2014 16:40:48 GMT
Repository: incubator-streams
Updated Branches:
  refs/heads/master 88fcbd8d2 -> 658da115d


STREAMS-234 | Added an implementation of the MessagePersister interface which uses SLF4J to
write out JMX information


Project: http://git-wip-us.apache.org/repos/asf/incubator-streams/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-streams/commit/8a0b7df4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-streams/tree/8a0b7df4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-streams/diff/8a0b7df4

Branch: refs/heads/master
Commit: 8a0b7df44c3b8097119c94f5b0e518bdf17f0027
Parents: f6ee8c2
Author: Robert Douglas <rdouglas@w2ogroup.com>
Authored: Mon Nov 24 10:20:09 2014 -0600
Committer: Robert Douglas <rdouglas@w2ogroup.com>
Committed: Mon Nov 24 10:20:09 2014 -0600

----------------------------------------------------------------------
 .../persist/impl/SLF4JMessagePersister.java     | 25 ++++++++++++++++++++
 .../tasks/BroadcastMonitorThread.java           |  3 ++-
 2 files changed, 27 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/8a0b7df4/streams-monitoring/src/main/java/org/apache/streams/monitoring/persist/impl/SLF4JMessagePersister.java
----------------------------------------------------------------------
diff --git a/streams-monitoring/src/main/java/org/apache/streams/monitoring/persist/impl/SLF4JMessagePersister.java
b/streams-monitoring/src/main/java/org/apache/streams/monitoring/persist/impl/SLF4JMessagePersister.java
new file mode 100644
index 0000000..b44c36b
--- /dev/null
+++ b/streams-monitoring/src/main/java/org/apache/streams/monitoring/persist/impl/SLF4JMessagePersister.java
@@ -0,0 +1,25 @@
+package org.apache.streams.monitoring.persist.impl;
+
+import org.apache.streams.monitoring.persist.MessagePersister;
+import org.slf4j.Logger;
+
+import java.util.List;
+
+public class SLF4JMessagePersister implements MessagePersister {
+    private static final Logger LOGGER = org.slf4j.LoggerFactory.getLogger(SLF4JMessagePersister.class);
+    private static final int SUCCESS_STATUS = 0;
+    private static final int FAILURE_STATUS = -1;
+
+    public SLF4JMessagePersister() {
+
+    }
+
+    @Override
+    public int persistMessages(List<String> messages) {
+        for(String message : messages) {
+            LOGGER.info(message);
+        }
+
+        return SUCCESS_STATUS;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/8a0b7df4/streams-monitoring/src/main/java/org/apache/streams/monitoring/tasks/BroadcastMonitorThread.java
----------------------------------------------------------------------
diff --git a/streams-monitoring/src/main/java/org/apache/streams/monitoring/tasks/BroadcastMonitorThread.java
b/streams-monitoring/src/main/java/org/apache/streams/monitoring/tasks/BroadcastMonitorThread.java
index fd9354a..6c3ec4f 100644
--- a/streams-monitoring/src/main/java/org/apache/streams/monitoring/tasks/BroadcastMonitorThread.java
+++ b/streams-monitoring/src/main/java/org/apache/streams/monitoring/tasks/BroadcastMonitorThread.java
@@ -24,6 +24,7 @@ import com.google.common.collect.Lists;
 import org.apache.streams.jackson.*;
 import org.apache.streams.monitoring.persist.MessagePersister;
 import org.apache.streams.monitoring.persist.impl.BroadcastMessagePersister;
+import org.apache.streams.monitoring.persist.impl.SLF4JMessagePersister;
 import org.apache.streams.pojo.json.*;
 import org.slf4j.Logger;
 
@@ -57,7 +58,7 @@ public class BroadcastMonitorThread extends NotificationBroadcasterSupport
imple
         setBroadcastURI();
         setWaitTime();
 
-        messagePersister = new BroadcastMessagePersister(broadcastURI);
+        messagePersister = new SLF4JMessagePersister();
 
         initializeObjectMapper();
     }


Mime
View raw message