Mercurial > hg > Database > Alice
changeset 524:061478079bc7 dispose
add java 3d to lib
author | Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 10 Apr 2015 17:56:55 +0900 |
parents | 145c425db88d |
children | 30a74eee59c7 |
files | src/main/java/alice/daemon/Connection.java src/main/java/alice/daemon/IncomingTcpConnection.java src/main/java/alice/topology/node/TopologyNodeConfig.java |
diffstat | 3 files changed, 20 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/alice/daemon/Connection.java Thu Apr 09 18:36:26 2015 +0900 +++ b/src/main/java/alice/daemon/Connection.java Fri Apr 10 17:56:55 2015 +0900 @@ -58,10 +58,10 @@ if (name!=null){ ConnectionInfo c = new ConnectionInfo(name, socket); ReceiveData rData = new ReceiveData(c, false, false); - DataSegment.getLocal().put("_DISCONNECT", rData, null); + DataSegment.getLocal().put("_DISCONNECT", rData, false); if (sendManager) { SendOption option = new SendOption(false, false); - DataSegment.get("manager").put("_DISCONNECTNODE", rData, option); + DataSegment.get("manager").put("_DISCONNECTNODE", rData, false); } }
--- a/src/main/java/alice/daemon/IncomingTcpConnection.java Thu Apr 09 18:36:26 2015 +0900 +++ b/src/main/java/alice/daemon/IncomingTcpConnection.java Fri Apr 10 17:56:55 2015 +0900 @@ -89,7 +89,7 @@ break; case RESPONSE: rData = new ReceiveData(new RespondData(reverseKey, System.currentTimeMillis()), false, false); - DataSegment.getLocal().put(msg.key, rData, null); + DataSegment.getLocal().put(msg.key, rData, false); break; default: break;
--- a/src/main/java/alice/topology/node/TopologyNodeConfig.java Thu Apr 09 18:36:26 2015 +0900 +++ b/src/main/java/alice/topology/node/TopologyNodeConfig.java Fri Apr 10 17:56:55 2015 +0900 @@ -1,5 +1,6 @@ package alice.topology.node; +import java.util.ArrayList; import alice.daemon.Config; public class TopologyNodeConfig extends Config { @@ -7,6 +8,8 @@ private String managerHostName; private int managerPort = 10000; public String cookie; + private ArrayList<Class> eventList = new ArrayList<Class>(); + public TopologyNodeConfig(String[] args) { super(args); @@ -37,4 +40,18 @@ this.managerPort = managerPort; } + public void register(Class clazz) { + if ("CodeSegment".equals(clazz.getSuperclass().getSimpleName())) + eventList.add(clazz); + } + + public void executeEvent() { + for (Class clazz : eventList) + try { + clazz.newInstance(); + } catch (InstantiationException | IllegalAccessException e) { + e.printStackTrace(); + } + } + }