package omq.test.multiThread;

import java.util.List;

import omq.common.broker.Broker;
import omq.exception.RemoteException;
import omq.server.RemoteObject;

public class CarImpl extends RemoteObject implements Car {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String plate;
	private int hp;
	private List<Rim> rims;
	private Mobile mobile;

	@Override
	public void setPlate(String plate) {
		this.plate = plate;
	}

	@Override
	public String getPlate() {
		return plate;
	}

	@Override
	public void setHP(int hp) {
		this.hp = hp;
	}

	@Override
	public int getHP() {
		return hp;
	}

	@Override
	public void setRims(List<Rim> rims) {
		this.rims = rims;
	}

	@Override
	public List<Rim> getRims() {
		return rims;
	}

	@Override
	public void setMobile(String mobile) throws RemoteException {
		this.mobile = (Mobile) Broker.lookup(mobile, Mobile.class);
	}

	@Override
	public String getMobile() {
		return mobile.getRef();
	}

}
