private static void executeSemaphore() { System.out.println("### Semaphore Execution Started... ###"); ISemaphore semaphore = context.getBean("semaphore", ISemaphore.class); semaphore.init(5); System.out.println("Semaphore initialized with 5."); try { semaphore.acquire(); } catch (InterruptedException e) { e.printStackTrace(); } System.out.println("Semaphore acquired once."); System.out.println("Available semaphore permits: " + semaphore.availablePermits()); semaphore.release(); System.out.println("Semaphore released."); System.out.println("Available semaphore permits: " + semaphore.availablePermits() + "\n"); }