public void invokeExecutionInits(Execution exec, Execution parent) throws UiException { if (_execInits != null) { for (Iterator<ExecutionInit> it = new LinkedList<ExecutionInit>(_execInits).iterator(); it.hasNext();) { try { it.next().init(exec, parent); } catch (Throwable ex) { throw UiException.Aide.wrap(ex); //Don't intercept; to prevent the creation of a session } } } }
/** Creates an instance of {@link AuWriter}. */ public static AuWriter newInstance() throws UiException { if (_awCls != null) { try { return (AuWriter) _awCls.newInstance(); } catch (Exception ex) { throw UiException.Aide.wrap(ex); } } return new HttpAuWriter(); }
public void execute(BindContext ctx) { final Object base = getBinder().getViewModel(); final Component comp = getComponent(); //ctx.getComponent(); final BindEvaluatorX eval = getBinder().getEvaluatorX(); final String methodName = (String) eval.getValue(ctx, comp, getCommand()); try { final Method method = Classes.getMethodInPublic(base.getClass(), methodName, new Class[] { Map.class }); method.invoke(getBinder().getViewModel(), ctx.getAttributes()); } catch (Exception e) { throw UiException.Aide.wrap(e); } }
@SuppressWarnings("unchecked") public Component newInstance(Page page, String clsnm) { try { return newInstance((Class<? extends Component>) resolveImplementationClass(page, clsnm)); } catch (ClassNotFoundException ex) { throw UiException.Aide.wrap(ex); } }
private Function getFunction0(NameSpace bshns, String name, Class[] argTypes) { try { final BshMethod m = bshns.getMethod(name, argTypes != null ? argTypes : new Class[0], false); return m != null ? new BSHFunction(m) : null; } catch (UtilEvalError ex) { throw UiException.Aide.wrap(ex); } }
protected boolean contains(String name) { try { return _ip.getNameSpace().getVariable(name) != Primitive.VOID; //Primitive.VOID means not defined } catch (UtilEvalError ex) { throw UiException.Aide.wrap(ex); } }
private void injectFieldByName(Object arg, Class tgtcls, Class parmcls, String fdname) { try { final Field fd = Classes.getAnyField(tgtcls, fdname); injectField(arg, parmcls, fd); } catch (NoSuchFieldException e) { //ignore } catch (Exception ex2) { throw UiException.Aide.wrap(ex2); } }
public void call(Object data) { try { Executions.getCurrent().pushArg(currentArg); doAfterCompose(comp); } catch (Exception e) { throw UiException.Aide.wrap(e); } finally { Executions.getCurrent().popArg(); } } });
protected void unset(String name) { try { _ip.unset(name); } catch (EvalError ex) { throw UiException.Aide.wrap(ex); } }
protected void set(String name, Object val) { try { _ip.set(name, val); //unlike NameSpace.setVariable, _ip.set() handles null } catch (EvalError ex) { throw UiException.Aide.wrap(ex); } }
protected void exec(String script) { try { final Scope scope = getCurrent(); if (scope != null) _ip.eval(script, prepareNS(scope)); else _ip.eval(script); //unlikely (but just in case) } catch (EvalError ex) { throw UiException.Aide.wrap(ex); } }
protected Object get(String name) { try { return unwrap(_ip.get(name)); } catch (EvalError ex) { throw UiException.Aide.wrap(ex); } }
private void checkError() { if (_ex != null) { //failed to process // if (log.isDebugEnabled()) log.realCause(_ex); final Throwable ex = _ex; _ex = null; throw UiException.Aide.wrap(ex); } }
public void call(Object data) { try { Executions.getCurrent().pushArg(currentArg); doBeforeComposeChildren(comp); } catch (Exception e) { throw UiException.Aide.wrap(e); } finally { Executions.getCurrent().popArg(); } } });
/** Set mode to MODAL and suspend this thread. */ private void enterModal() { _mode = MODAL; smartUpdate("mode", modeToString(_mode)); //no need to synchronized (_mutex) because no racing is possible try { Executions.wait(_mutex); } catch (InterruptedException ex) { throw UiException.Aide.wrap(ex); } }