ProcessScope.java 文件源码

java
阅读 22 收藏 0 点赞 0 评论 0

项目:SecureBPMN 作者:
/**
 * creates a proxy that dispatches invocations to the currently bound {@link ProcessInstance}
 *
 * @return shareable {@link ProcessInstance}
 */
private Object createSharedProcessInstance()   {
    ProxyFactory proxyFactoryBean = new ProxyFactory(ProcessInstance.class, new MethodInterceptor() {
        public Object invoke(MethodInvocation methodInvocation) throws Throwable {
            String methodName = methodInvocation.getMethod().getName() ;

            logger.info("method invocation for " + methodName+ ".");
            if(methodName.equals("toString"))
                return "SharedProcessInstance";


            ProcessInstance processInstance = Context.getExecutionContext().getProcessInstance();
            Method method = methodInvocation.getMethod();
            Object[] args = methodInvocation.getArguments();
            Object result = method.invoke(processInstance, args);
            return result;
        }
    });
    return proxyFactoryBean.getProxy(this.classLoader);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号