Tabnine Logo
ResilientFileOutputStream.postIOFailure
Code IndexAdd Tabnine to your IDE (free)

How to use
postIOFailure
method
in
ch.qos.logback.core.recovery.ResilientFileOutputStream

Best Java code snippets using ch.qos.logback.core.recovery.ResilientFileOutputStream.postIOFailure (Showing top 5 results out of 315)

origin: tony19/logback-android

private void safeWrite(E event) throws IOException {
 ResilientFileOutputStream resilientFOS = (ResilientFileOutputStream) getOutputStream();
 FileChannel fileChannel = resilientFOS.getChannel();
 if (fileChannel == null) {
  return;
 }
 // Clear any current interrupt (see LOGBACK-875)
 boolean interrupted = Thread.interrupted();
 FileLock fileLock = null;
 try {
  fileLock = fileChannel.lock();
  long position = fileChannel.position();
  long size = fileChannel.size();
  if (size != position) {
   fileChannel.position(size);
  }
  super.writeOut(event);
 } catch (IOException e) {
  // Mainly to catch FileLockInterruptionExceptions (see LOGBACK-875)
  resilientFOS.postIOFailure(e);
 } finally {
  if (fileLock != null && fileLock.isValid()) {
   fileLock.release();
  }
  // Re-interrupt if we started in an interrupted state (see LOGBACK-875)
  if (interrupted) {
   Thread.currentThread().interrupt();
  }
 }
}
origin: com.impetus.fabric/fabric-jdbc-driver-shaded

private void safeWrite(E event) throws IOException {
  ResilientFileOutputStream resilientFOS = (ResilientFileOutputStream) getOutputStream();
  FileChannel fileChannel = resilientFOS.getChannel();
  if (fileChannel == null) {
    return;
  }
  // Clear any current interrupt (see LOGBACK-875)
  boolean interrupted = Thread.interrupted();
  FileLock fileLock = null;
  try {
    fileLock = fileChannel.lock();
    long position = fileChannel.position();
    long size = fileChannel.size();
    if (size != position) {
      fileChannel.position(size);
    }
    super.writeOut(event);
  } catch (IOException e) {
    // Mainly to catch FileLockInterruptionExceptions (see LOGBACK-875)
    resilientFOS.postIOFailure(e);
  } finally {
    if (fileLock != null && fileLock.isValid()) {
      fileLock.release();
    }
    // Re-interrupt if we started in an interrupted state (see LOGBACK-875)
    if (interrupted) {
      Thread.currentThread().interrupt();
    }
  }
}
origin: Nextdoor/bender

private void safeWrite(E event) throws IOException {
  ResilientFileOutputStream resilientFOS = (ResilientFileOutputStream) getOutputStream();
  FileChannel fileChannel = resilientFOS.getChannel();
  if (fileChannel == null) {
    return;
  }
  // Clear any current interrupt (see LOGBACK-875)
  boolean interrupted = Thread.interrupted();
  FileLock fileLock = null;
  try {
    fileLock = fileChannel.lock();
    long position = fileChannel.position();
    long size = fileChannel.size();
    if (size != position) {
      fileChannel.position(size);
    }
    super.writeOut(event);
  } catch (IOException e) {
    // Mainly to catch FileLockInterruptionExceptions (see LOGBACK-875)
    resilientFOS.postIOFailure(e);
  } finally {
    if (fileLock != null && fileLock.isValid()) {
      fileLock.release();
    }
    // Re-interrupt if we started in an interrupted state (see LOGBACK-875)
    if (interrupted) {
      Thread.currentThread().interrupt();
    }
  }
}
origin: io.virtdata/virtdata-lib-realer

private void safeWrite(E event) throws IOException {
  ResilientFileOutputStream resilientFOS = (ResilientFileOutputStream) getOutputStream();
  FileChannel fileChannel = resilientFOS.getChannel();
  if (fileChannel == null) {
    return;
  }
  // Clear any current interrupt (see LOGBACK-875)
  boolean interrupted = Thread.interrupted();
  FileLock fileLock = null;
  try {
    fileLock = fileChannel.lock();
    long position = fileChannel.position();
    long size = fileChannel.size();
    if (size != position) {
      fileChannel.position(size);
    }
    super.writeOut(event);
  } catch (IOException e) {
    // Mainly to catch FileLockInterruptionExceptions (see LOGBACK-875)
    resilientFOS.postIOFailure(e);
  } finally {
    if (fileLock != null && fileLock.isValid()) {
      fileLock.release();
    }
    // Re-interrupt if we started in an interrupted state (see LOGBACK-875)
    if (interrupted) {
      Thread.currentThread().interrupt();
    }
  }
}
origin: com.hynnet/logback-core

} catch (IOException e) {
 resilientFOS.postIOFailure(e);
ch.qos.logback.core.recoveryResilientFileOutputStreampostIOFailure

Popular methods of ResilientFileOutputStream

  • getChannel
  • <init>
  • setContext
  • flush
  • getFile
  • openNewOutputStream
  • write

Popular in Java

  • Start an intent from android
  • putExtra (Intent)
  • getSharedPreferences (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now