Mercurial > hg > Database > Alice
view src/main/java/alice/topology/node/ExecuteEvent.java @ 478:cf345b10a21a dispose
bug fix
author | sugi |
---|---|
date | Tue, 02 Dec 2014 17:16:34 +0900 |
parents | 041ec04d4d45 |
children | 15eeb439830c 767d93626b88 3284428f525e |
line wrap: on
line source
package alice.topology.node; import java.util.List; import alice.codesegment.CloseEventCodeSegment; import alice.codesegment.CodeSegment; import alice.datasegment.CommandType; import alice.datasegment.Receiver; public class ExecuteEvent<T> extends CodeSegment { public Receiver info = ids.create(CommandType.TAKE); public Receiver info1 = ids.create(CommandType.TAKE); public ExecuteEvent() { info.setKey("_DEVENTLIST"); info1.setKey("_DISCONNECT"); } @SuppressWarnings("unchecked") @Override public void run() { List<Class<T>> eventList = info.asClass(List.class); try { for (Class<T> clazz : eventList){ // set MetaInfo if ("CloseEventCodeSegment".equals(clazz.getSuperclass().getSimpleName())) { CloseEventCodeSegment obj = (CloseEventCodeSegment) clazz.newInstance(); obj.metaInfo = info1; obj.ids.setKey(); obj.ids.receive(); } else if ("CodeSegment".equals(clazz.getSuperclass().getSimpleName())){ clazz.newInstance(); } } } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (SecurityException e) { e.printStackTrace(); } ods.put(info.key, info.getReceiveData()); } }