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

📄 clientsideproxy.java

📁 real-time design patterns in Real-time java
💻 JAVA
字号:
package designPatterns.Proxy;import java.util.Iterator;import java.util.LinkedList;import javax.realtime.LTMemory;import designPatterns.Data;import rtComm.LinkQueue;public class ClientSideProxy extends Proxy implements ProxyClient {	private LinkQueue commBus;		// Logic of notify method encapsulated into a scoped class 	ScopedNotify sNotify;		public ClientSideProxy(Data data, LinkQueue commBus) {		super(data);		this.commBus = commBus;		sNotify = new ScopedNotify(clientsList, this.data);	}	private LTMemory mem = new LTMemory(1024*16);		static class ScopedNotify implements Runnable {		private LinkedList clients;		private Data data;		public ScopedNotify(LinkedList clients, Data data) {			this.clients = clients;			this.data = data;		}		public void run() {			Iterator i = clients.iterator();			while (i.hasNext()) {				ProxyClient cl = (ProxyClient)i.next();				cl.accept(data);			}		}	}		protected void notifyClients() {		mem.enter(sNotify);	}	public LinkQueue getCommBus() {		return commBus;	}		public void checkData(boolean pend) {		Data data = commBus.deQueue(pend); 		accept(data);		commBus.recycle(data);	}}

⌨️ 快捷键说明

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