package com.oy.shared.scample.actor;

public abstract class Actor {
	public void start(){
		MessageBus.getCurrent().addActor(this);
	}
	
	public void stop(){
		MessageBus.getCurrent().removeActor(this);
	} 
	
	public abstract void react(Message msg);
	
	public void postMessage(Message msg){
		MessageBus.getCurrent().postMessage(msg, this);
	}
	
	public Message sendMessage(Message msg){
		throw new RuntimeException();
	}
}
