public ExceptionHandlerImpl createExceptionHandler() { ExceptionHandlerImpl exceptionHandler = new ExceptionHandlerImpl(); addExceptionHandler(exceptionHandler); return exceptionHandler; }
/** creates an exception handler for the given exception class on the current process element; * until the {@link #exceptionHandlerEnd()}. Subsequent invocations of * {@link #listener(Activity) listeners} or {@link #transition() transitions} will * have the created exception handler as a target. * * DONT'T FORGET TO CLOSE THE EXCEPTION HANDLER WITH exceptionHandlerEnd. */ public ProcessFactory exceptionHandler(Class<? extends Exception> exceptionClass) { if (exceptionHandler!=null) { throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd"); } ProcessElementImpl processElement = null; if (eventListenerReference!=null) { processElement = eventListenerReference; } else if (event!=null) { processElement = event; } else if (observableElement!=null) { processElement = observableElement; } else { throw new PvmException("no current process element, event or action"); } exceptionHandler = processElement.createExceptionHandler(); if (exceptionClass!=null) { exceptionHandler.setExceptionClassName(exceptionClass.getName()); } return this; }
List<ExceptionHandlerImpl> exceptionHandlers = processElement.getExceptionHandlers(); if (exceptionHandlers!=null) { for (ExceptionHandlerImpl exceptionHandler: exceptionHandlers) {