/** * Makes invocation handler. * * @return {@link InvocationHandler} instance * @throws Exception */ protected InvocationHandler makeInvocationHandler(Object instanceObject) throws Exception { Map<Method, Method> methodsMap = makeMethodMap(getServiceClass(), getOriginalInstantiationStrategy().getInstanceClass()); return new RuntimeContextInstantiationStrategyEnhancerInvocationHandler(methodsMap, instanceObject); }
@Override protected boolean validateServiceClass(Class<?> serviceClass) throws ValidationServiceClassException { if (RuntimeContextInstantiationStrategyEnhancerHelper.isDecoratedClass(serviceClass)) { return true; } else { throw new ValidationServiceClassException("Runtime context parameter required in each method!"); } }
public CompiledOpenClass getCompiledOpenClass() throws RulesInstantiationException, ProjectResolvingException, ClassNotFoundException { return getRulesInstantiationStrategy().compile(); }
@Override public CompiledOpenClass compile() throws RulesInstantiationException { return getOriginalInstantiationStrategy().compile(); }
@Override public ClassLoader getClassLoader() throws RulesInstantiationException { try { return getOriginalInstantiationStrategy().getInstanceClass().getClassLoader(); } catch (ClassNotFoundException e) { throw new RulesInstantiationException(e); } }
@Override public void forcedReset() { reset(); getOriginalInstantiationStrategy().forcedReset(); }
@Override public void setExternalParameters(Map<String, Object> parameters) { getOriginalInstantiationStrategy().setExternalParameters(parameters); } }
@Override public void reset() { getOriginalInstantiationStrategy().reset(); serviceClass = null; }
@SuppressWarnings("unchecked") public T newInstance() throws RulesInstantiationException, ProjectResolvingException, ClassNotFoundException { return (T) getRulesInstantiationStrategy().instantiate(); }
@Override public Collection<Module> getModules() { return getOriginalInstantiationStrategy().getModules(); }
@Override public Map<String, Object> getExternalParameters() { return getOriginalInstantiationStrategy().getExternalParameters(); }
@Override public Class<?> getGeneratedRulesClass() throws RulesInstantiationException { return getOriginalInstantiationStrategy().getGeneratedRulesClass(); }
/** * Makes invocation handler. * * @return {@link InvocationHandler} instance * @throws Exception */ protected InvocationHandler makeInvocationHandler(Object instanceObject) throws Exception { Map<Method, Method> methodsMap = makeMethodMap(getServiceClass(), getOriginalInstantiationStrategy().getInstanceClass()); return new RuntimeContextInstantiationStrategyEnhancerInvocationHandler(methodsMap, instanceObject); }
public CompiledOpenClass getCompiledOpenClass() throws RulesInstantiationException, ProjectResolvingException, ClassNotFoundException { return getRulesInstantiationStrategy().compile(); }
@Override public void forcedReset() { reset(); getOriginalInstantiationStrategy().forcedReset(); }
@Override public void setExternalParameters(Map<String, Object> parameters) { getOriginalInstantiationStrategy().setExternalParameters(parameters); } }
@Override public void reset() { getOriginalInstantiationStrategy().reset(); serviceClass = null; }
@Override protected boolean validateServiceClass(Class<?> serviceClass) throws ValidationServiceClassException { if (RuntimeContextInstantiationStrategyEnhancerHelper.isDecoratedClass(serviceClass)) { return true; } else { throw new ValidationServiceClassException("Runtime context parameter required in each method!"); } }
@Override public Collection<Module> getModules() { return getOriginalInstantiationStrategy().getModules(); }
@Override public Map<String, Object> getExternalParameters() { return getOriginalInstantiationStrategy().getExternalParameters(); }