java.lang.Object
org.apache.jena.sparql.service.enhancer.impl.util.FinallyRunAll
All Implemented Interfaces:
Runnable

public class FinallyRunAll extends Object implements Runnable
Force all actions in a list to run. Usage:

 FinallyAll.run(
   () -> action1(),
   () -> action2(),
   () -> actionN()
 );
 
This is more succinct than nested finally blocks such as:

 try { action1(); } finally {
   try { action2(); } finally {
     try { actionM(); } finally {
       actionN();
     }
   }
 }
 
  • Constructor Details

    • FinallyRunAll

      public FinallyRunAll()
    • FinallyRunAll

      public FinallyRunAll(List<ThrowingRunnable> actions)
  • Method Details