protected void processRequest (String jsonRequest, boolean isDelete) {
Map<String, Map<String, Object>> entries = (Map<String, Map<String, Object>>)getContext().getAttributes().get("entries");
//Map<String, Object> entries = (Map<String, Object>)getContext().getAttributes().get("entries");
ForkJoinPool pool = (ForkJoinPool) getContext().getAttributes().get("pool");
ObserverTask<Integer, RestApiTask> observerTask = (ObserverTask<Integer, RestApiTask>) getContext().getAttributes().get("observerTask");
ControllerRef controllerRef = (ControllerRef)getContext().getAttributes().get("controllerRef");
ForkJoinTask<Map<String, Map<String, Object>>> task2;
if (entries == null)
entries = new HashMap<>();
if (isDelete) {
Map <String, Object> delete = new HashMap();
delete.put("DELETE", "YES");
entries.put(jsonRequest, delete);
}
RecursiveTask <Map<String, Map<String, Object>>> task = new RestApiTask(jsonRequest, entries);
if (observerTask !=null)
observerTask.update((RestApiTask) task);
/*if (pool != null)
pool.execute(task);*/
if (pool != null) {
task2 = pool.submit(task);
try {
entries = task2.get();
} catch (InterruptedException | ExecutionException e) {
// TODO Auto-generated catch block
e.printStackTrace();