For more detailed information regarding the motivation behind this goal (and my efforts to solve it) view my previous question. I decided to ask this as a new question entir
Did you try the try-with-ressource statment? Even though, this is not the main purpose of this feature, maybe that does what you are looking for (in form of auto closing the ressources (your channel), but only when you leave the corresponding try-block)
try (final Channel channel = new RandomAccessFile(new File(path), "rw").getChannel()) {
// your stuff here
} catch (IOException ex) {
ex.printStackTrace();
}