private static Semaphore onInterruption(final InterruptedException e) { Thread.interrupted(); throw ExceptionUtils.throwAsRuntimeException(e); } }
private static Object uncheckedInvoke(Method method, Object target, Object... args) { try { return method.invoke(target, args); } catch (IllegalAccessException e) { throw ExceptionUtils.throwAsRuntimeException(e); } catch (InvocationTargetException e) { throw ExceptionUtils.throwAsRuntimeException(e.getCause()); } }
protected boolean isValidPath(ServletContextEvent sce, ConfigDescriptor configDescriptor) { try { return sce.getServletContext().getResource(configDescriptor.getPath()) != null; } catch (MalformedURLException e) { throw ExceptionUtils.throwAsRuntimeException(e); } }
protected boolean isValidPath(ServletContextEvent sce, ConfigDescriptor configDescriptor) { try { return sce.getServletContext().getResource(configDescriptor.getPath()) != null; } catch (MalformedURLException e) { throw ExceptionUtils.throwAsRuntimeException(e); } }
@Override public boolean getRollbackOnly() { try { return getTransactionStatus() == Status.STATUS_MARKED_ROLLBACK; } catch (SystemException e) { throw ExceptionUtils.throwAsRuntimeException(e); } }
@Override public boolean getRollbackOnly() { try { return getTransactionStatus() == Status.STATUS_MARKED_ROLLBACK; } catch (SystemException e) { throw ExceptionUtils.throwAsRuntimeException(e); } }
private void invokeMethod(Object target) { try { this.method.invokeExplosively(target); } catch (Throwable throwable) { throw ExceptionUtils.throwAsRuntimeException(throwable); } } }
@Override public Object proceed() throws Exception { try { return process(proxy, method, args, repositoryMetadata, repositoryMethodMetadata); } catch (Throwable t) { throw ExceptionUtils.throwAsRuntimeException(t); } } });
private ConfigNodeConverter createCustomConfigNodeConverter(ViewConfigRoot viewConfigRoot, ConfigNodeConverter defaultConverter) { Class<? extends ConfigNodeConverter> converterClass = viewConfigRoot.configNodeConverter(); if (!ConfigNodeConverter.class.equals(converterClass)) { try { return converterClass.newInstance(); } catch (Exception e) { throw ExceptionUtils.throwAsRuntimeException(e); } } return defaultConverter; }
private ConfigNodeConverter createCustomConfigNodeConverter(ViewConfigRoot viewConfigRoot, ConfigNodeConverter defaultConverter) { Class<? extends ConfigNodeConverter> converterClass = viewConfigRoot.configNodeConverter(); if (!ConfigNodeConverter.class.equals(converterClass)) { try { return converterClass.newInstance(); } catch (Exception e) { throw ExceptionUtils.throwAsRuntimeException(e); } } return defaultConverter; }
@Override public void stop() { try { if (this.scheduler != null && this.scheduler.isStarted()) { this.scheduler.shutdown(SchedulerBaseConfig.LifecycleIntegration.FORCE_STOP); this.scheduler = null; } } catch (SchedulerException e) { throw ExceptionUtils.throwAsRuntimeException(e); } }
@Override public void startJobManually(Class<? extends T> jobClass) { try { this.scheduler.triggerJob(createJobKey(jobClass)); } catch (SchedulerException e) { throw ExceptionUtils.throwAsRuntimeException(e); } }
@Override public void pauseJob(Class<? extends T> jobClass) { try { this.scheduler.pauseJob(createJobKey(jobClass)); } catch (SchedulerException e) { throw ExceptionUtils.throwAsRuntimeException(e); } }
@Override public void resumeJob(Class<? extends T> jobClass) { try { this.scheduler.resumeJob(createJobKey(jobClass)); } catch (SchedulerException e) { throw ExceptionUtils.throwAsRuntimeException(e); } }
protected void broadcastAccessDeniedException(ErrorViewAwareAccessDeniedException accessDeniedException) { AccessDeniedExceptionBroadcaster exceptionBroadcaster = BeanProvider.getContextualReference(AccessDeniedExceptionBroadcaster.class); Throwable broadcastResult = exceptionBroadcaster.broadcastAccessDeniedException(accessDeniedException); if (broadcastResult != null) { throw ExceptionUtils.throwAsRuntimeException(broadcastResult); } }
protected void broadcastAccessDeniedException(ErrorViewAwareAccessDeniedException accessDeniedException) { AccessDeniedExceptionBroadcaster exceptionBroadcaster = BeanProvider.getContextualReference(AccessDeniedExceptionBroadcaster.class); Throwable broadcastResult = exceptionBroadcaster.broadcastAccessDeniedException(accessDeniedException); if (broadcastResult != null) { throw ExceptionUtils.throwAsRuntimeException(broadcastResult); } }
@Override public void interruptJob(Class<? extends T> jobClass) { try { this.scheduler.interrupt(createJobKey(jobClass)); } catch (SchedulerException e) { throw ExceptionUtils.throwAsRuntimeException(e); } }
@Override public boolean deleteJob(Class<? extends T> jobClass) { try { return this.scheduler.deleteJob(createJobKey(jobClass)); } catch (SchedulerException e) { throw ExceptionUtils.throwAsRuntimeException(e); } }
/** * @return true if the transaction has been started and not ended */ @Override public boolean isActive() { //we can't use the status of the overall try { return this.getTransactionStatus() != Status.STATUS_NO_TRANSACTION && this.getTransactionStatus() != Status.STATUS_UNKNOWN; //TODO re-visit it } catch (SystemException e) { throw ExceptionUtils.throwAsRuntimeException(e); } }
@Override public void setRollbackOnly() { try { if (resolveUserTransaction() != null) { resolveUserTransaction().setRollbackOnly(); } } catch (SystemException e) { throw ExceptionUtils.throwAsRuntimeException(e); } }