/** * Construct a Logger using a Configuration supplied * by the caller. * @param config Configuration object * @throws IOException */ public Logger(Configuration config) throws IOException { super(config); lfmgr = new LogFileManager(config); bmgr = new LogBufferManager(config); }
/** * close the Log files and perform necessary cleanup tasks. */ public void close() throws IOException, InterruptedException { // prevent new threads from adding to the log synchronized(this) { isClosed = true; } lfmgr.close(); }
private void checkPutEnabled() throws LogClosedException { if (replayNeeded) throw new LogClosedException("replay() must be called prior to put(); activeMark [0x" + Long.toHexString(super.getActiveMark()) + "]"); }
/** * Construct a Logger using default Configuration object. * @throws IOException */ public Logger() throws IOException { this(new Configuration()); }
/** * Registers a LogEventListener for log event notifications. * * @param eventListener object to be notified of logger events. */ public void setLogEventListener(LogEventListener eventListener) { lfmgr.setLogEventListener(eventListener); }
/** * implements LogEventListener#isLoggable(). * @param level a logging level defined by LogEventListener */ public boolean isLoggable(int level) { boolean loggable = false; // cannot log events if caller did not provide a listener if (this.eventListener != null) loggable = eventListener.isLoggable(level); return loggable; }
public final long getWaitForBuffer() { LogBufferManager parent = LogBufferManager.this; return parent.getWaitForBuffer(); } }
/** * delegates log request to the callers event listener. * @param level log level * @param message text to be logged * @param thrown Throwable related to event being logged */ public void log(int level, String message, Throwable thrown) { if (this.eventListener != null) eventListener.log(level, message, thrown); }
XAReplayListener(ReplayListener tmListener) { assert tmListener != null: "ReplayListener must be non-null"; this.tmListener = tmListener; lr = tmListener.getLogRecord(); }
public void onError(LogException e) { // pass the error onto the TM tmListener.onError(e); }
/** * Construct an exception with message describing the problem * @param activeMark * @param highMark */ public LogFileOverflowException(long activeMark, long highMark, File lf) { super(format(activeMark, highMark, lf)); }
/** * Construct a Logger using a Configuration supplied * by the caller. * @param config Configuration object * @throws IOException */ public Logger(Configuration config) throws IOException { super(config); lfmgr = new LogFileManager(config); bmgr = new LogBufferManager(config); }
private void checkPutEnabled() throws LogClosedException { if (replayNeeded) throw new LogClosedException("replay() must be called prior to put(); activeMark [0x" + Long.toHexString(super.getActiveMark()) + "]"); }
/** * Construct a Logger using default Configuration object. * @throws IOException */ public Logger() throws IOException { this(new Configuration()); }
/** * implements LogEventListener#isLoggable(). * @param level a logging level defined by LogEventListener */ public boolean isLoggable(int level) { boolean loggable = false; // cannot log events if caller did not provide a listener if (this.eventListener != null) loggable = eventListener.isLoggable(level); return loggable; }
public final long getWaitForBuffer() { LogBufferManager parent = LogBufferManager.this; return parent.getWaitForBuffer(); } }
/** * Construct a Logger using a Configuration supplied * by the caller. * @param config Configuration object * @throws IOException */ public Logger(Configuration config) throws IOException { super(config); lfmgr = new LogFileManager(config); bmgr = new LogBufferManager(config); }
private void checkPutEnabled() throws LogClosedException { if (replayNeeded) throw new LogClosedException("replay() must be called prior to put(); activeMark [0x" + Long.toHexString(super.getActiveMark()) + "]"); }
/** * Construct a Logger using a Configuration supplied * by the caller. * @param config Configuration object * @throws IOException */ public Logger(Configuration config) throws IOException { super(config); lfmgr = new LogFileManager(config); bmgr = new LogBufferManager(config); }