private void handleException(Throwable cause, String service, String interfaceImplementationRef, String operation, String paramType, Object param) { logger.debug("Handling exception {} inside service {} or {} and operation {} with param type {} and value {}", cause.getMessage(), service, operation, paramType, param); WorkItemHandlerRuntimeException wihRe; if( cause instanceof InvocationTargetException ) { Throwable realCause = cause.getCause(); wihRe = new WorkItemHandlerRuntimeException(realCause); wihRe.setStackTrace(realCause.getStackTrace()); } else { wihRe = new WorkItemHandlerRuntimeException(cause); wihRe.setStackTrace(cause.getStackTrace()); } wihRe.setInformation("Interface", service); wihRe.setInformation("InterfaceImplementationRef", interfaceImplementationRef); wihRe.setInformation("Operation", operation); wihRe.setInformation("ParameterType", paramType); wihRe.setInformation("Parameter", param); wihRe.setInformation(WorkItemHandlerRuntimeException.WORKITEMHANDLERTYPE, this.getClass().getSimpleName()); throw wihRe; }
protected void handleException(Throwable cause, Map<String, Object> handlerInfoMap) { if (handlingProcessId != null && handlingStrategy != null) { throw new ProcessWorkItemHandlerException(handlingProcessId, handlingStrategy, cause); } String service = (String) handlerInfoMap.get("Interface"); String operation = (String) handlerInfoMap.get("Operation"); if (this.logThrownException) { String message; if (service != null) { message = this.getClass().getSimpleName() + " failed when calling " + service + "." + operation; } else { message = this.getClass().getSimpleName() + " failed while trying to complete the task."; } logger.error(message, cause); } else { WorkItemHandlerRuntimeException wihRe = new WorkItemHandlerRuntimeException(cause); for (String key : handlerInfoMap.keySet()) { wihRe.setInformation(key, handlerInfoMap.get(key)); } wihRe.setInformation(WorkItemHandlerRuntimeException.WORKITEMHANDLERTYPE, this.getClass().getSimpleName()); throw wihRe; } }
private void handleException(Throwable cause, String service, String interfaceImplementationRef, String operation, String paramType, Object param) { logger.debug("Handling exception {} inside service {} or {} and operation {} with param type {} and value {}", cause.getMessage(), service, operation, paramType, param); WorkItemHandlerRuntimeException wihRe; if( cause instanceof InvocationTargetException ) { Throwable realCause = cause.getCause(); wihRe = new WorkItemHandlerRuntimeException(realCause); wihRe.setStackTrace(realCause.getStackTrace()); } else { wihRe = new WorkItemHandlerRuntimeException(cause); wihRe.setStackTrace(cause.getStackTrace()); } wihRe.setInformation("Interface", service); wihRe.setInformation("InterfaceImplementationRef", interfaceImplementationRef); wihRe.setInformation("Operation", operation); wihRe.setInformation("ParameterType", paramType); wihRe.setInformation("Parameter", param); wihRe.setInformation(WorkItemHandlerRuntimeException.WORKITEMHANDLERTYPE, this.getClass().getSimpleName()); throw wihRe; }
protected void handleException(Throwable cause, Map<String, Object> handlerInfoMap) { String service = (String) handlerInfoMap.get("Interface"); String operation = (String) handlerInfoMap.get("Operation"); if (this.logThrownException) { String message; if( service != null ) { message = this.getClass().getSimpleName() + " failed when calling " + service + "." + operation; } else { message = this.getClass().getSimpleName() + " failed while trying to complete the task."; } logger.error(message, cause); } else { WorkItemHandlerRuntimeException wihRe = new WorkItemHandlerRuntimeException(cause); for( String key : handlerInfoMap.keySet() ) { wihRe.setInformation(key, handlerInfoMap.get(key) ); } wihRe.setInformation(WorkItemHandlerRuntimeException.WORKITEMHANDLERTYPE, this.getClass().getSimpleName()); throw wihRe; } }
protected void handleException(Throwable cause, Map<String, Object> handlerInfoMap) { if (handlingProcessId != null && handlingStrategy != null) { throw new ProcessWorkItemHandlerException(handlingProcessId, handlingStrategy, cause); } String service = (String) handlerInfoMap.get("Interface"); String operation = (String) handlerInfoMap.get("Operation"); if (this.logThrownException) { String message; if (service != null) { message = this.getClass().getSimpleName() + " failed when calling " + service + "." + operation; } else { message = this.getClass().getSimpleName() + " failed while trying to complete the task."; } logger.error(message, cause); } else { WorkItemHandlerRuntimeException wihRe = new WorkItemHandlerRuntimeException(cause); for (String key : handlerInfoMap.keySet()) { wihRe.setInformation(key, handlerInfoMap.get(key)); } wihRe.setInformation(WorkItemHandlerRuntimeException.WORKITEMHANDLERTYPE, this.getClass().getSimpleName()); throw wihRe; } }
wihre.setInformation(SERVICE_NAME, serviceName != null ? serviceName.toString() : null); wihre.setInformation(OPERATION_NAME, operationName); wihre.setInformation(PARAMETER_NAME, parameterName); wihre.setInformation(RESULT_NAME, resultName); wihre.setInformation(FAULT_NAME, faultName); wihre.setInformation(FAULT_EVENT_ID, faultEventId); wihre.setInformation(FAULT_ACTION, faultAction.name()); wihre.setInformation(WorkItemHandlerRuntimeException.WORKITEMHANDLERTYPE, getClass().getSimpleName()); runtimeException = wihre;
wihre.setInformation(SERVICE_NAME, serviceName != null ? serviceName.toString() : null); wihre.setInformation(OPERATION_NAME, operationName); wihre.setInformation(PARAMETER_NAME, parameterName); wihre.setInformation(RESULT_NAME, resultName); wihre.setInformation(FAULT_NAME, faultName); wihre.setInformation(FAULT_EVENT_ID, faultEventId); wihre.setInformation(FAULT_ACTION, faultAction.name()); wihre.setInformation(WorkItemHandlerRuntimeException.WORKITEMHANDLERTYPE, getClass().getSimpleName()); runtimeException = wihre;