class ParameterService {

	public synchronized void setParam(Parameter param, Object value) {
		
		// check either param is registered
		if (getParam(param.getId()) != param) {
			throw new IllegalArgumentException(String.format("parameter provided with id %s is not the same as the registered one"));
		}
		
		try {
			if (recursionOn) {
				throw new IllegalStateException("recursion detected - parameter listeners are not allowed to modify parameters from within same thread");
			}
			
			recursionOn = true;
			
			if (param.setParameterValue(value)) {
				onParamChanged(param);
			}
		} finally {
			recursionOn = false;
		}
	}

	public  ParameterService(RoboStrokeEventBus bus);

}