private void closeAndThrow( Exception e ) { if ( pagedFile != null ) { try { closeStoreFile(); } catch ( IOException failureToClose ) { // Not really a suppressed exception, but we still want to throw the real exception, e, // but perhaps also throw this in there or convenience. e.addSuppressed( failureToClose ); } } throwIfUnchecked( e ); throw new RuntimeException( e ); }
/** * Closes this store. This will cause all buffers and channels to be closed. * Requesting an operation from after this method has been invoked is * illegal and an exception will be thrown. * <p> * This method will start by invoking the {@link #closeStoreFile()} method * giving the implementing store way to do anything that it needs to do * before the pagedFile is closed. */ @Override public void close() { try { closeStoreFile(); } catch ( IOException | IllegalStateException e ) { throw new UnderlyingStorageException( "Failed to close store file: " + getStorageFile(), e ); } }
private void closeAndThrow( Exception e ) { if ( pagedFile != null ) { try { closeStoreFile(); } catch ( IOException failureToClose ) { // Not really a suppressed exception, but we still want to throw the real exception, e, // but perhaps also throw this in there or convenience. e.addSuppressed( failureToClose ); } } throwIfUnchecked( e ); throw new RuntimeException( e ); }
/** * Closes this store. This will cause all buffers and channels to be closed. * Requesting an operation from after this method has been invoked is * illegal and an exception will be thrown. * <p> * This method will start by invoking the {@link #closeStoreFile()} method * giving the implementing store way to do anything that it needs to do * before the pagedFile is closed. */ @Override public void close() { try { closeStoreFile(); } catch ( IOException | IllegalStateException e ) { throw new UnderlyingStorageException( "Failed to close store file: " + getStorageFile(), e ); } }