Source:
public void sharedLockRequest(final AsyncResponse asyncResponse, String requestInfo) { String refDesignator = ""; String requester = ""; final String requestType; final String LOCK_REQUEST = "lock"; final SharedLockRequest request; final SharedLockRequestHandler requestHandler; try { request = new SharedLockRequest(); requestHandler = new SharedLockRequestHandler(); Map<String, Object> requestInfoMap = Helper.toMap(requestInfo); if (requestInfoMap != null) { log.handle(Priority.INFO, "Request Info Map = " + requestInfoMap.toString()); refDesignator = (String) requestInfoMap.get("ref_desig"); requester = (String) requestInfoMap.get("requester"); requestType = (String) requestInfoMap.get("request_type"); request.setName(refDesignator); request.setDetails(requester); if (requestType.equals(LOCK_REQUEST)) { request.setRequestType(RequestType.WRITER_LOCK); } else { request.setRequestType(RequestType.WRITER_UNLOCK); } executor.execute(new Runnable() { @Override public void run() { try { final SharedLockResponse response = requestHandler.handleRequest(request); log.handle(Priority.INFO, "response = " + response.toString()); if (response.isSucessful()) { log.handle(Priority.INFO, requestType + " is successfull"); } else { log.handle(Priority.INFO, requestType + " is not successfull"); } String responseString = Helper.toJson(response); asyncResponse.resume(Response.ok(responseString, MediaType.APPLICATION_JSON).build()); } catch (Exception e) { log.error("handleRequest Exception", e); asyncResponse.resume(Response.ok("handleRequest Exception", MediaType.APPLICATION_JSON).build()); } } }); } else { log.handle(Priority.INFO, "Request Info Map is null"); asyncResponse.resume(Response.ok("Request Info Map is null", MediaType.APPLICATION_JSON).build()); } } catch (Exception e) { log.error("sharedLockRequest Exception", e); asyncResponse.resume(Response.ok("sharedLockRequest Exception", MediaType.APPLICATION_JSON).build()); } }

Target:
public void sharedLockRequest(final AsyncResponse asyncResponse, String requestInfo) { String refDesignator = ""; String requester = ""; final String requestType; final String LOCK_REQUEST = "lock"; final SharedLockRequest request; final SharedLockRequestHandler requestHandler; try { request = new SharedLockRequest(); requestHandler = new SharedLockRequestHandler(); Map<String, Object> requestInfoMap = Helper.toMap(requestInfo); if (requestInfoMap != null) { log.handle(Priority.INFO, "Request Info Map = " + requestInfoMap.toString()); refDesignator = (String) requestInfoMap.get("ref_desig"); requester = (String) requestInfoMap.get("requester"); requestType = (String) requestInfoMap.get("request_type"); request.setName(refDesignator); request.setDetails(requester); if (requestType.equals(LOCK_REQUEST)) { request.setRequestType(RequestType.WRITER_LOCK); } else { request.setRequestType(RequestType.WRITER_UNLOCK); } executor.execute(new Runnable() { @Override public void run() { try { final SharedLockResponse response = requestHandler.handleRequest(request); log.handle(Priority.INFO, "response = " + response.toString()); if (response.isSucessful()) { log.handle(Priority.INFO, requestType + " was successfull"); } else { log.handle(Priority.INFO, requestType + " was not successfull"); } String responseString = Helper.toJson(response); asyncResponse.resume(Response.ok(responseString, MediaType.APPLICATION_JSON).build()); } catch (Exception e) { log.error("handleRequest Exception", e); asyncResponse.resume(Response.ok("handleRequest Exception", MediaType.APPLICATION_JSON).build()); } } }); } else { log.handle(Priority.INFO, "Request Info Map is null"); asyncResponse.resume(Response.ok("Request Info Map is null", MediaType.APPLICATION_JSON).build()); } } catch (Exception e) { log.error("sharedLockRequest Exception", e); asyncResponse.resume(Response.ok("sharedLockRequest Exception", MediaType.APPLICATION_JSON).build()); } }