@Override protected final InvocationHandler prepareInvocationHandler(Object openClassInstance, Map<Method, IOpenMember> methodMap, IRuntimeEnv runtimeEnv) { return new OpenLRulesInvocationHandler(openClassInstance, runtimeEnv, methodMap); } }
@Override protected VariationsResult<Object> compute() { OpenLRulesInvocationHandler handler = null; try { if (runtimeEnv instanceof SimpleRulesRuntimeEnv) { if (Proxy.isProxyClass(serviceClassInstance.getClass())) { handler = (OpenLRulesInvocationHandler) Proxy.getInvocationHandler(serviceClassInstance); handler.setRuntimeEnv(runtimeEnv); } SimpleRulesRuntimeEnv simpleRulesRuntimeEnv = ((SimpleRulesRuntimeEnv) runtimeEnv); simpleRulesRuntimeEnv.changeMethodArgumentsCacheMode(org.openl.rules.vm.CacheMode.READ_ONLY); simpleRulesRuntimeEnv.setOriginalCalculation(false); simpleRulesRuntimeEnv.setIgnoreRecalculate(true); simpleRulesRuntimeEnv.getArgumentCachingStorage().initCurrentStep(); } return calculateSingleVariation(member, arguments, variation); } catch (Exception e) { log.error("Failed to calculate variation!", e); throw e; } finally { if (handler != null) handler.release(); } } }
@Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { if (IRulesRuntimeContextProvider.class.equals(method.getDeclaringClass())) { return method.invoke(this, args); } if (IEngineWrapper.class != method.getDeclaringClass()) { IOpenMember targetMethod = getMethodMap().get(method); if (targetMethod instanceof IOpenMethod) { validationHandler.validateProxyArguments(((IOpenMethod) targetMethod).getSignature(), getRuntimeEnv(), args); } } return super.invoke(proxy, method, args); } }
final OpenLRulesInvocationHandler handler = (OpenLRulesInvocationHandler) Proxy .getInvocationHandler(serviceClassInstance); handler.setRuntimeEnv(runtimeEnv); SimpleRulesRuntimeEnv simpleRulesRuntimeEnv = ((SimpleRulesRuntimeEnv) runtimeEnv); simpleRulesRuntimeEnv.changeMethodArgumentsCacheMode(org.openl.rules.vm.CacheMode.READ_ONLY);
public IRulesRuntimeContext getRuntimeContext() { return (IRulesRuntimeContext) getRuntimeEnv().getContext(); }
@Override protected VariationsResult<Object> compute() { OpenLRulesInvocationHandler handler = null; try { if (runtimeEnv instanceof SimpleRulesRuntimeEnv) { if (Proxy.isProxyClass(serviceClassInstance.getClass())) { handler = (OpenLRulesInvocationHandler) Proxy.getInvocationHandler(serviceClassInstance); handler.setRuntimeEnv(runtimeEnv); } SimpleRulesRuntimeEnv simpleRulesRuntimeEnv = ((SimpleRulesRuntimeEnv) runtimeEnv); simpleRulesRuntimeEnv.changeMethodArgumentsCacheMode(org.openl.rules.vm.CacheMode.READ_ONLY); simpleRulesRuntimeEnv.setOriginalCalculation(false); simpleRulesRuntimeEnv.setIgnoreRecalculate(true); simpleRulesRuntimeEnv.getArgumentCachingStorage().initCurrentStep(); } return calculateSingleVariation(member, arguments, variation); } catch (Exception e) { log.error("Failed to calculate variation!", e); throw e; } finally { if (handler != null) handler.release(); } } }
final OpenLRulesInvocationHandler handler = (OpenLRulesInvocationHandler) Proxy .getInvocationHandler(serviceClassInstance); handler.setRuntimeEnv(runtimeEnv); SimpleRulesRuntimeEnv simpleRulesRuntimeEnv = ((SimpleRulesRuntimeEnv) runtimeEnv); simpleRulesRuntimeEnv.changeMethodArgumentsCacheMode(org.openl.rules.vm.CacheMode.READ_ONLY);
@Override protected InvocationHandler prepareInvocationHandler(Object openClassInstance, Map<Method, IOpenMember> methodMap, IRuntimeEnv runtimeEnv) { return new OpenLRulesInvocationHandler(openClassInstance, runtimeEnv, methodMap); } }