⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 future.java

📁 一个很好的微工作流内核
💻 JAVA
字号:
/* * 	  *  Copyright (c) 2002 Dragos Manolescu (dam@micro-workflow.com) *  *  See the LICENSE file for licensing information. */package com.microworkflow.execution;import java.lang.reflect.InvocationHandler;import java.lang.reflect.Proxy;import java.lang.reflect.Method;import java.util.ArrayList;public class Future implements InvocationHandler {		protected Object value = null;	protected ArrayList messageList = null;		public Future() {	 value = null;	}	public Future(Object obj) {	 value = obj;	}	public static Object newInstance(ClassLoader cl, Object obj, Class[] interfaces) {		return (Object) Proxy.newProxyInstance(cl, interfaces, new Future(obj));			}	public Object invoke(Object proxy, Method method, Object[] args)		throws Throwable {			if (getValue() != null) {				return method.invoke(value, args);			}			else {				add(method, args);			}		return null;	}	protected void add(Method method, Object[] arguments) {		getMessageList().add(new Message(method, arguments));	}	public Object getValue() {		return value;	}	public void setValue(Object value) {		this.value = value;		if (messageList != null && messageList.size() > 0) {			invokePendingMessages();		}	}	protected void invokePendingMessages() {	}	public ArrayList getMessageList() {		if (messageList == null) {			setMessageList(new ArrayList());		}		return messageList;	}	public void setMessageList(ArrayList messageList) {		this.messageList = messageList;	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -