Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Missed some classes affected by the interface change.

  • Loading branch information...
commit e0a082f235ec3840192797a6cd0a3b29bb2dd58a 1 parent e870ea3
@joshsh authored
View
8 twitlogic-plugins/twitlogic-larkc-plugin/src/main/java/net/fortytwo/twitlogic/larkc/TwitterStream.java
@@ -125,7 +125,11 @@ private void start(final Factory<SailConnectionListener> factory) throws Excepti
try {
Handler<Tweet> adder = new Handler<Tweet>() {
- public boolean handle(final Tweet tweet) throws HandlerException {
+ public boolean isOpen() {
+ return !closed && annotator.isOpen();
+ }
+
+ public void handle(final Tweet tweet) throws HandlerException {
try {
c.clear();
c.commit();
@@ -133,7 +137,7 @@ public boolean handle(final Tweet tweet) throws HandlerException {
throw new HandlerException(e);
}
- return !closed && annotator.handle(tweet);
+ annotator.handle(tweet);
}
};
View
24 twitlogic-rdfagents/src/main/java/net/fortytwo/twitlogic/rdfagents/TwitLogicPubsubProvider.java
@@ -67,15 +67,16 @@ public TwitLogicPubsubProvider(final RDFAgent agent,
TwitLogic.setConfiguration(config);
final Handler<Dataset> handler = new Handler<Dataset>() {
- @Override
- public boolean handle(Dataset dataset) throws HandlerException {
+ public boolean isOpen() {
+ return true;
+ }
+
+ public void handle(Dataset dataset) throws HandlerException {
try {
handleDataset(dataset);
} catch (LocalFailure e) {
throw new HandlerException(e);
}
-
- return true;
}
};
@@ -155,21 +156,22 @@ public void run(final Handler<Dataset> datasetHandler) throws TweetStoreExceptio
try {
Handler<Tweet> handler = new Handler<Tweet>() {
@Override
- public boolean handle(final Tweet tweet) throws HandlerException {
+ public boolean isOpen() {
+ return persister.isOpen() && datasetHandler.isOpen();
+ }
+
+ @Override
+ public void handle(final Tweet tweet) throws HandlerException {
System.out.println("got this tweet: " + tweet);
buffer.clear();
- boolean b = persister.handle(tweet);
+ persister.handle(tweet);
if (0 < buffer.size()) {
Collection<Statement> c = new LinkedList<Statement>();
c.addAll(buffer);
- if (!datasetHandler.handle(new Dataset(c))) {
- return false;
- }
+ datasetHandler.handle(new Dataset(c));
}
-
- return b;
}
};
Please sign in to comment.
Something went wrong with that request. Please try again.