/** * Get the class loader of the component. */ public ClassLoader getClassLoader() { return interpreter.getClassLoader(); }
Field f = fields[i].getField(getClassLoader()); f.setAccessible(true); f.set(agent, ret);
/** * Set an injected field value. */ protected void setFieldValue(Object val, Field field, String convert) { if(val!=null || !SReflect.isBasicType(field.getType())) { try { Object agent = microagent instanceof IPojoMicroAgent? ((IPojoMicroAgent)microagent).getPojoAgent(): microagent; if(convert!=null) { SimpleValueFetcher fetcher = new SimpleValueFetcher(getFetcher()); fetcher.setValue("$value", val); val = SJavaParser.evaluateExpression(convert, getModel().getAllImports(), fetcher, getClassLoader()); } field.setAccessible(true); field.set(agent, val); } catch(Exception e) { throw new RuntimeException(e); } } }
Field field = inj.getFirstEntity().getField(getClassLoader()); String convback = inj.getThirdEntity(); val = SJavaParser.evaluateExpression(convback, getModel().getAllImports(), fetcher, getClassLoader());
Field field = infos[j].getFirstEntity().getField(getClassLoader()); String convert = infos[j].getSecondEntity(); Field field = info.getFirstEntity().getField(getClassLoader()); String convert = info.getSecondEntity();
final Field f = ((FieldInfo)infos[j]).getField(getClassLoader()); if(SReflect.isSupertype(IFuture.class, f.getType())) final Method m = SReflect.getMethod(agent.getClass(), ((MethodInfo)infos[j]).getName(), ((MethodInfo)infos[j]).getParameterTypes(getClassLoader())); if(info.isMultiple())
fut.addResultListener(lis); final Field f = pis[i].getField(getClassLoader()); getServiceContainer().searchService(IComponentManagementService.class, RequiredServiceInfo.SCOPE_PLATFORM) .addResultListener(new ExceptionDelegationResultListener<IComponentManagementService, Void>(fut)