@Before("call(int java.nio.channels.Selector.select(..))") public void select(JoinPoint thisJoinPoint) { if (config.isDebug()) { latency(HIGH, thisJoinPoint); } }
@Before("call(java.nio.channels.SocketChannel java.nio.channels.ServerSocketChannel.accept())") public void accept(JoinPoint thisJoinPoint) { if (config.isDebug()) { SelectableChannel asc = (SelectableChannel) thisJoinPoint.getTarget(); if (asc.isBlocking()) latency(HIGH, thisJoinPoint); } } }
@Before("call(* java.io.PrintWriter.format(..))") public void format(JoinPoint thisJoinPoint) { Writer writer = (Writer) thisJoinPoint.getTarget(); if (config.isDebug()) { config.logger.finest( thisJoinPoint.toString() + " with " + FileTools.dumpChain(writer)); } latency(HIGH, thisJoinPoint, writer); }
@Before("call(* java.io.PrintWriter.println(..))") public void println(JoinPoint thisJoinPoint) { Writer writer = (Writer) thisJoinPoint.getTarget(); if (config.isDebug()) { config.logger.finest( thisJoinPoint.toString() + " with " + FileTools.dumpChain(writer)); } latency(HIGH, thisJoinPoint, writer); }
@Before("call(* java.io.PrintWriter.printf(..))") public void printf(JoinPoint thisJoinPoint) { Writer writer = (Writer) thisJoinPoint.getTarget(); if (config.isDebug()) { config.logger.finest( thisJoinPoint.toString() + " with " + FileTools.dumpChain(writer)); } latency(HIGH, thisJoinPoint, writer); }
@Before("call(* java.io.PrintWriter.print(..))") public void print(JoinPoint thisJoinPoint) { Writer writer = (Writer) thisJoinPoint.getTarget(); if (config.isDebug()) { config.logger.finest( thisJoinPoint.toString() + " with " + FileTools.dumpChain(writer)); } latency(HIGH, thisJoinPoint, writer); }
@Before("call(* java.io.OutputStream.write(..))") public void write(JoinPoint thisJoinPoint) { OutputStream out = (OutputStream) thisJoinPoint.getTarget(); if (config.isDebug()) { config.logger.finest( thisJoinPoint.toString() + " with " + FileTools.dumpChain(out)); } latency(HIGH, thisJoinPoint, (OutputStream) thisJoinPoint.getTarget()); }
@Override public ReactiveAuditException lazyException() { CharSequence msg=(config.isDebug()) ? FileTools.dumpChain(out) : FileTools.printFilename(out); return FactoryException.newFile(latency, thisJoinPoint, msg); } };
@Before("call(* java.io.Writer.append(..))") public void append(JoinPoint thisJoinPoint) { if (config.isDebug()) { Writer writer = (Writer) thisJoinPoint.getTarget(); config.logger.finest( thisJoinPoint.toString() + " with " + FileTools.dumpChain(writer)); } latency(HIGH, thisJoinPoint, (Writer) thisJoinPoint.getTarget()); }
@Override public ReactiveAuditException lazyException() { CharSequence msg=(config.isDebug()) ? FileTools.dumpChain(reader) : FileTools.printFilename(reader); return FactoryException.newNetwork(latency, thisJoinPoint, msg); } };
@Before("call(* java.io.Reader+.read(..))") public void read(JoinPoint thisJoinPoint) { if (config.isDebug()) { Reader reader = (Reader) thisJoinPoint.getTarget(); config.logger.finest( thisJoinPoint.toString() + " with " + FileTools.dumpChain(reader)); } latency(HIGH, thisJoinPoint, (Reader) thisJoinPoint.getTarget()); }
@Before("call(* java.io.Writer.write(..))") public void write(JoinPoint thisJoinPoint) { if (config.isDebug()) { Writer writer = (Writer) thisJoinPoint.getTarget(); config.logger.finest( thisJoinPoint.toString() + " with " + FileTools.dumpChain(writer)); } latency(HIGH, thisJoinPoint, (Writer) thisJoinPoint.getTarget()); }
@Before("call(* java.io.Writer.flush(..))") public void flush(JoinPoint thisJoinPoint) { if (config.isDebug()) { Writer writer = (Writer) thisJoinPoint.getTarget(); config.logger.finest( thisJoinPoint.toString() + " with " + FileTools.dumpChain(writer)); } latency(HIGH, thisJoinPoint, (Writer) thisJoinPoint.getTarget()); }
@Before("call(* java.io.Writer.close())") public void close(JoinPoint thisJoinPoint) { if (config.isDebug()) { Writer writer = (Writer) thisJoinPoint.getTarget(); config.logger.finest( thisJoinPoint.toString() + " with " + FileTools.dumpChain(writer)); } latency(LOW, thisJoinPoint, (Writer) thisJoinPoint.getTarget()); }
@Override public ReactiveAuditException lazyException() { CharSequence msg=(config.isDebug()) ? FileTools.dumpChain(reader) : FileTools.printFilename(reader); return FactoryException.newFile(latency, thisJoinPoint, msg); } };
@Override public ReactiveAuditException lazyException() { CharSequence msg=(config.isDebug()) ? FileTools.dumpChain(writer) : FileTools.printFilename(writer); return FactoryException.newNetwork(latency, thisJoinPoint, msg); } };
@Override public ReactiveAuditException lazyException() { CharSequence msg=(config.isDebug()) ? FileTools.dumpChain(writer) : FileTools.printFilename(writer); return FactoryException.newFile(latency, thisJoinPoint, msg); } };
@Before("call(* java.io.InputStream+.read(..))") public void read(JoinPoint thisJoinPoint) { if (config.isDebug()) { InputStream in = (InputStream) thisJoinPoint.getTarget(); config.logger.finest( thisJoinPoint.toString() + " with " + FileTools.dumpChain(in)); } latency(HIGH, thisJoinPoint, (InputStream) thisJoinPoint.getTarget()); }
@Override public ReactiveAuditException lazyException() { CharSequence msg=(config.isDebug()) ? FileTools.dumpChain(out) : FileTools.printFilename(out); return FactoryException.newNetwork(latency, thisJoinPoint, msg); } };
static public ReactiveAuditException latencyInputStream(ReactiveAudit config, Latency latency, JoinPoint thisJoinPoint, InputStream in) { CharSequence msg; if (config.isDebug()) msg = FileTools.dumpChain(in); else msg = FileTools.printFilename(in); ReactiveAuditException ex = null; switch (FileTools.isLastInputStreamWithLatency(in)) { case NET_ERROR: ex = FactoryException.newNetwork(latency, thisJoinPoint, msg); break; case FILE_ERROR: ex = FactoryException.newFile(latency, thisJoinPoint, msg); break; } return ex; }