view src/alice/test/codesegment/local/SingletonTestCodeSegment.java @ 314:f1f0638861ab

ping responce receivable
author sugi
date Fri, 06 Dec 2013 11:42:51 +0900
parents
children
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");
	}

}