/** * Take actions on callback exceptions depending on callback mode. */ private void handleCallbackExceptions(Exception[] exceps, int mode) { if (exceps.length == 0 || (mode & CALLBACK_IGNORE) != 0) return; OpenJPAException ce; if (exceps.length == 1) ce = new CallbackException(exceps[0]); else ce = new CallbackException(_loc.get("callback-err")). setNestedThrowables(exceps); if ((mode & CALLBACK_ROLLBACK) != 0 && (_flags & FLAG_ACTIVE) != 0) { ce.setFatal(true); setRollbackOnlyInternal(ce); } if ((mode & CALLBACK_LOG) != 0 && _log.isWarnEnabled()) _log.warn(ce); if ((mode & CALLBACK_RETHROW) != 0) throw ce; }
private void makeCallback(LifecycleEvent ev) { int eventType = ev.getType(); if (_callbacks[eventType] == null) return; Object src = ev.getSource(); for (LifecycleCallbacks callback : _callbacks[eventType]) { try { callback.makeCallback(src, ev.getRelated(), eventType); } catch (Throwable t) { if (t instanceof InvocationTargetException) t = t.getCause(); if (t instanceof RuntimeException) throw (RuntimeException) t; throw new CallbackException(_loc.get("system-listener-err", src)).setCause(t).setFatal(true); } } }
private void makeCallback(LifecycleEvent ev) { int eventType = ev.getType(); if (_callbacks[eventType] == null) return; Object src = ev.getSource(); for (LifecycleCallbacks callback : _callbacks[eventType]) { try { callback.makeCallback(src, ev.getRelated(), eventType); } catch (Throwable t) { if (t instanceof InvocationTargetException) t = t.getCause(); if (t instanceof RuntimeException) throw (RuntimeException) t; throw new CallbackException(_loc.get("system-listener-err", src)).setCause(t).setFatal(true); } } }
private void makeCallback(LifecycleEvent ev) { int eventType = ev.getType(); if (_callbacks[eventType] == null) return; Object src = ev.getSource(); for (LifecycleCallbacks callback : _callbacks[eventType]) { try { callback.makeCallback(src, ev.getRelated(), eventType); } catch (Throwable t) { if (t instanceof InvocationTargetException) t = t.getCause(); if (t instanceof RuntimeException) throw (RuntimeException) t; throw new CallbackException(_loc.get("system-listener-err", src)).setCause(t).setFatal(true); } } }
/** * Take actions on callback exceptions depending on callback mode. */ private void handleCallbackExceptions(Exception[] exceps, int mode) { if (exceps.length == 0 || (mode & CALLBACK_IGNORE) != 0) return; OpenJPAException ce; if (exceps.length == 1) { // If the exception is already a wrapped exception throw the // exception instead of wrapping it with a callback exception if (exceps[0] instanceof WrappedException) throw (WrappedException)exceps[0]; else ce = new CallbackException(exceps[0]); } else { ce = new CallbackException(_loc.get("callback-err")). setNestedThrowables(exceps); } if ((mode & CALLBACK_ROLLBACK) != 0 && (_flags & FLAG_ACTIVE) != 0) { ce.setFatal(true); setRollbackOnlyInternal(ce); } if ((mode & CALLBACK_LOG) != 0 && _log.isWarnEnabled()) _log.warn(ce); if ((mode & CALLBACK_RETHROW) != 0) throw ce; }
private void makeCallback(LifecycleEvent ev) { int eventType = ev.getType(); if (_callbacks[eventType] == null) return; Object src = ev.getSource(); for (LifecycleCallbacks callback : _callbacks[eventType]) { try { callback.makeCallback(src, ev.getRelated(), eventType); } catch (Throwable t) { if (t instanceof InvocationTargetException) t = t.getCause(); if (t instanceof RuntimeException) throw (RuntimeException) t; throw new CallbackException(_loc.get("system-listener-err", src)).setCause(t).setFatal(true); } } }
/** * Take actions on callback exceptions depending on callback mode. */ private void handleCallbackExceptions(Exception[] exceps, int mode) { if (exceps.length == 0 || (mode & CALLBACK_IGNORE) != 0) return; OpenJPAException ce; if (exceps.length == 1) { // If the exception is already a wrapped exception throw the // exception instead of wrapping it with a callback exception if (exceps[0] instanceof WrappedException) throw (WrappedException)exceps[0]; else ce = new CallbackException(exceps[0]); } else { ce = new CallbackException(_loc.get("callback-err")). setNestedThrowables(exceps); } if ((mode & CALLBACK_ROLLBACK) != 0 && (_flags & FLAG_ACTIVE) != 0) { ce.setFatal(true); setRollbackOnlyInternal(ce); } if ((mode & CALLBACK_LOG) != 0 && _log.isWarnEnabled()) _log.warn(ce); if ((mode & CALLBACK_RETHROW) != 0) throw ce; }
private void makeCallback(LifecycleEvent ev) { int eventType = ev.getType(); if (_callbacks[eventType] == null) return; Object src = ev.getSource(); for (LifecycleCallbacks callback : _callbacks[eventType]) { try { callback.makeCallback(src, ev.getRelated(), eventType); } catch (Throwable t) { if (t instanceof InvocationTargetException) t = t.getCause(); if (t instanceof RuntimeException) throw (RuntimeException) t; throw new CallbackException(_loc.get("system-listener-err", src)).setCause(t).setFatal(true); } } }
/** * Take actions on callback exceptions depending on callback mode. */ private void handleCallbackExceptions(Exception[] exceps, int mode) { if (exceps.length == 0 || (mode & CALLBACK_IGNORE) != 0) return; OpenJPAException ce; if (exceps.length == 1) { // If the exception is already a wrapped exception throw the // exception instead of wrapping it with a callback exception if (exceps[0] instanceof WrappedException) throw (WrappedException)exceps[0]; else ce = new CallbackException(exceps[0]); } else { ce = new CallbackException(_loc.get("callback-err")). setNestedThrowables(exceps); } if ((mode & CALLBACK_ROLLBACK) != 0 && (_flags & FLAG_ACTIVE) != 0) { ce.setFatal(true); setRollbackOnlyInternal(ce); } if ((mode & CALLBACK_LOG) != 0 && _log.isWarnEnabled()) _log.warn(ce); if ((mode & CALLBACK_RETHROW) != 0) throw ce; }
/** * Take actions on callback exceptions depending on callback mode. */ private void handleCallbackExceptions(Exception[] exceps, int mode) { if (exceps.length == 0 || (mode & CALLBACK_IGNORE) != 0) return; OpenJPAException ce; if (exceps.length == 1) { // If the exception is already a wrapped exception throw the // exception instead of wrapping it with a callback exception if (exceps[0] instanceof WrappedException) throw (WrappedException)exceps[0]; else ce = new CallbackException(exceps[0]); } else { ce = new CallbackException(_loc.get("callback-err")). setNestedThrowables(exceps); } if ((mode & CALLBACK_ROLLBACK) != 0 && (_flags & FLAG_ACTIVE) != 0) { ce.setFatal(true); setRollbackOnlyInternal(ce); } if ((mode & CALLBACK_LOG) != 0 && _log.isWarnEnabled()) _log.warn(ce); if ((mode & CALLBACK_RETHROW) != 0) throw ce; }