@Override
	public void setAttribute(Attribute attribute)
			throws AttributeNotFoundException, InvalidAttributeValueException,
			MBeanException, ReflectionException {
		if(attribute == null){
			throw new RuntimeOperationsException(
					new IllegalArgumentException("Attribute cannot be null "),
							"Cannot invoke a setter of " + dClassName +
							" with null attribute");
		}
		String name = attribute.getName();
		Object value = attribute.getValue();
		if(name == null){
			throw new RuntimeOperationsException(
					new IllegalArgumentException("Attribute name cannot be null"),
					"Cannot invoke the setter of " + dClassName + 
					" with null attribute name");
		}
		if(name.equals("State")){
			if(value == null){
				try{
					setState(null);
				}catch(Exception e){
					throw new InvalidAttributeValueException(
							"Cannot set attribute " + name + " to null");
				}
			}else{
				try{
					if(Class.forName("java.lang.String").isAssignableFrom(
							value.getClass())){
						setState((String) value);
					}else{
						throw new InvalidAttributeValueException(
								"Cannot set attribute " + name + " to a " +
						value.getClass().getName() + " Object,String expected");
					}
				}catch(ClassNotFoundException e){
					e.printStackTrace();
				}
			}
		}
		//recognize an attempt to set "NbChanges" attribute(read-only)
		else if(name.equals("NbChanges")){
			throw new AttributeNotFoundException(
					"Cannot set attribute " + name + " because it is read only");
			
		}else{
			 throw new AttributeNotFoundException("Attribute " + name +
                     " not found in " +
                     this.getClass().getName());
		}
		
	}