Skip to content

Commit

Permalink
Change to ignore Throwables when it scan clazzes in batch jar file.
Browse files Browse the repository at this point in the history
  • Loading branch information
223kazuki authored and seki-seki committed Apr 10, 2017
1 parent 8889d32 commit 55d6463
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/clj/job_streamer/control_bus/component/apps.clj
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
(letfn [(print-err []
(with-open [rdr (io/reader (.getErrorStream proc))]
(->> (line-seq rdr)
(map #(log/error %))
(map #(log/debug %))
doall)))]
(.start (Thread. print-err)))
(with-open [rdr (io/reader (.getInputStream proc))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,36 +89,35 @@ void pickOverBatchComponent(String resourcePath, ClassLoader cl) {
|| className.startsWith("com.sun.")
|| className.startsWith("sun.")
|| className.startsWith("clojure.")) {
System.err.println("This is ignored with wrong package name");
System.err.println("This is ignored according to package name.");
return;
}
try {
Class<?> clazz = cl.loadClass(className);
if (Batchlet.class.isAssignableFrom(clazz)) {
System.err.println(" This clazz is Batchlet");
System.err.println(" This clazz is Batchlet.");
container.batchlets.add(decideRefName(clazz));
} else if (ItemReader.class.isAssignableFrom(clazz)) {
System.err.println(" This clazz is ItemReader");
System.err.println(" This clazz is ItemReader.");
container.itemReaders.add(decideRefName(clazz));
} else if (ItemWriter.class.isAssignableFrom(clazz)) {
System.err.println(" This clazz is ItemWriter");
System.err.println(" This clazz is ItemWriter.");
container.itemWriters.add(decideRefName(clazz));
} else if (ItemProcessor.class.isAssignableFrom(clazz)) {
System.err.println(" This clazz is ItemProcessor");
System.err.println(" This clazz is ItemProcessor.");
container.itemProcessors.add(decideRefName(clazz));
} else if (isListener(clazz)) {
System.err.println(" This clazz is Listener");
System.err.println(" This clazz is Listener.");
container.listeners.add(decideRefName(clazz));
} else if (Throwable.class.isAssignableFrom(clazz)) {
System.err.println(" This clazz is Throwable");
System.err.println(" This clazz is Throwable.");
container.throwables.add(decideRefName(clazz));
} else {
System.err.println(" This clazz is ignored");
System.err.println(" This clazz is ignored.");
}
} catch (ClassNotFoundException | NoClassDefFoundError e) {
System.err.println(" This clazz is ignored with Exception");
} catch (Throwable e) {
System.err.println(" This clazz is ignored with Throwable.");
e.printStackTrace();
// ignore
}
}
}
Expand Down

0 comments on commit 55d6463

Please sign in to comment.