if (e.getCause() instanceof IllegalArgumentException) { if (LOG.isLoggable(Level.INFO)) { LOG.info("WARNING: couldn't auto wire " + fieldName
/** * loads the class from the class loader of the specified WireContext. * * @throws WireException * if the class could not be loaded. */ public Object construct(WireContext wireContext) { ClassLoader classLoader = wireContext.getClassLoader(); try { return ReflectUtil.loadClass(classLoader, text); } catch (BonitaRuntimeException e) { Throwable cause = e.getCause(); String message = ExceptionManager.getInstance().getFullMessage( "bp_CD_1", text, cause.getMessage()); throw new WireException(message, cause); } }
@Override public Class<?> getType(final WireDefinition wireDefinition) { if (className != null) { try { return ReflectUtil.loadClass(wireDefinition.getClassLoader(), className); } catch (final BonitaRuntimeException e) { final String message = ExceptionManager.getInstance().getFullMessage("bp_HCD_1", className, e.getMessage()); throw new WireException(message, e.getCause()); } } return Configuration.class; }
@Override public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable { if (Environment.getCurrent() != null) { return new RESTServerAPIInterceptorCommand(method, args, api) .execute(Environment.getCurrent()); } // If no environment: use directly the command Service with interceptors final EnvironmentFactory envFactory = GlobalEnvironmentFactory .getEnvironmentFactory(DomainOwner.getDomain()); try { return envFactory.get(CommandService.class).execute( new RESTServerAPIInterceptorCommand(method, args, api)); } catch (final BonitaWrapperException e) { throw e.getCause(); } catch (final BonitaRuntimeException e) { if (DefaultCommandService.class.getName().equals(e.getWrappedBy()) || UnRollbackableException.class.getName().equals(e.getWrappedBy())) { throw e.getCause(); } else { throw e; } } }
public Class<?> getType(WireDefinition wireDefinition) { if (className != null) { try { return ReflectUtil .loadClass(wireDefinition.getClassLoader(), className); } catch (BonitaRuntimeException e) { String message = ExceptionManager.getInstance().getFullMessage( "bp_OD_10", (name != null ? name : className), e.getMessage()); throw new WireException(message, e .getCause()); } } Descriptor descriptor = null; if (factoryDescriptor != null) { descriptor = factoryDescriptor; } else if (factoryObjectName != null) { descriptor = wireDefinition.getDescriptor(factoryObjectName); } if (descriptor != null) { Class<?> factoryClass = descriptor.getType(wireDefinition); if (factoryClass != null) { Method method = ReflectUtilDescriptor.findMethod(factoryClass, methodName, argDescriptors, null); if (method != null) { return method.getReturnType(); } } } return null; }
return envFactory.get(CommandService.class).execute(new APIInterceptorCommand(method, args, false)); } catch (final BonitaRuntimeException e) { final Throwable cause = e.getCause(); if (cause instanceof BonitaException) { throw (BonitaException) cause; throw e; } else if (e instanceof BonitaWrapperException) { throw (RuntimeException) e.getCause();