concurrency « MVC « Spring Q&A

1. IllegalMonitorStateException - CyclicBarrier

I have a method which uses CyclicBarrier as shown below:

public void getMessage(Message obj){
    CyclicBarrier barrier = new CyclicBarrier(1, new Runnable() {

2. How to assign task name in Spring TaskExecutor and check if it is still alive?

Lest's consider that I have the following:

public class MyRunnable implements Runnable {
    public void run() {
        //do something expensive