package omq.test.multiThread;

import java.util.ArrayList;
import java.util.List;

import omq.server.RemoteObject;

public class MobileImpl extends RemoteObject implements Mobile {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private List<String> messages = new ArrayList<String>();

	@Override
	public synchronized void sendMessage(String message) {
		System.out.println("Message received " + this.getRef() + " -> " + message);
		messages.add(message);
	}

	@Override
	public List<String> getMessages() {
		return messages;
	}

}
