Mercurial > hg > Database > Alice
view src/main/java/alice/test/codesegment/local/SingletonTestCodeSegment.java @ 345:8f71c3e6f11d
Change directory structure Maven standard
author | sugi |
---|---|
date | Wed, 16 Apr 2014 18:26:07 +0900 |
parents | |
children | aefbe41fcf12 |
line wrap: on
line source
package alice.test.codesegment.local; import org.msgpack.type.Value; import alice.codesegment.CodeSegment; import alice.datasegment.CommandType; import alice.datasegment.Receiver; public class SingletonTestCodeSegment extends CodeSegment { Receiver arg1 = ids.create(CommandType.PEEK); private static SingletonTestCodeSegment instance = new SingletonTestCodeSegment(); private SingletonTestCodeSegment(){} public static SingletonTestCodeSegment getInstance(){ return instance; } @Override public void run() { System.out.println("type = " + arg1.type); System.out.println("index = " + arg1.index); System.out.println("data = " + arg1.getVal()); System.out.println(((Value)arg1.getVal()).getType()); if (arg1.index == 10) { System.exit(0); return; } this.recycle(); ods.update("local", "key2", "String data"); } }