Mercurial > hg > FederatedLinda
view src/fdl/test/debug2/MetaProtocolEngine.java @ 92:ea4ee892baf5
commit
author | kazz <kazz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 22 Apr 2010 16:13:03 +0900 |
parents | |
children | 0ea086f0e96f |
line wrap: on
line source
package fdl.test.debug2; import java.nio.ByteBuffer; import fdl.*; /** * MetaProtocolEngine * * @author Kazuki Akamine * * 接続する機能までを実装した MetaEngine * これを継承して、具体的な処理を書く * */ public class MetaProtocolEngine implements MetaEngine { // Fields private NodeProperty np; // Constructor public MetaProtocolEngine(int port, MetaLinda ml, String managerHostName, int managerPort) { this.np = new NodeProperty(port, ml, managerHostName, managerPort); ml.out(TupleId.BODY.id, ByteBuffer.wrap("dummy".getBytes())); } public void mainLoop() { initPoller(); while (np.running) { np.ml.sync(); } Debug.print("Terminated" + np.nodeId + " replies=" + np.ml.replies.size() + " qsize=" + np.ml.fdl.qsize); } protected void initPoller() { np.ml.in(TupleId.MANAGE.id, new AcceptXMLCallback(TupleId.MANAGE, np)); np.ml.in(TupleId.DEBUG.id, new AcceptXMLCallback(TupleId.DEBUG, np)); } }