public void execute(String[] args) throws Exception
   {

		processArguments(args);
				
		String theAttr = (String)attributeNames.toArray()[0]; 
		String theVal = (String)attributeNames.toArray()[1]; 

		if (objectName == null)
			throw new CommandException("Missing object name");

		log.debug("attribute names: " + attributeNames);
		if (attributeNames.size() != 2 )
		{
			throw new CommandException("Wrong number of arguments");
		}
		MBeanServerConnection server = getMBeanServer();

		MBeanInfo info = server.getMBeanInfo(objectName);
		
		MBeanAttributeInfo[] attrs = info.getAttributes();
		
		MBeanAttributeInfo attr=null;

		boolean found = false;
		for (int i=0;i < attrs.length ; i++ ) 
		{			
			if (attrs[i].getName().equals(theAttr) && 
				attrs[i].isWritable()) {
				
					found=true;
					attr= attrs[i];
					break;
				}
		}
		
		if (found == false)
		{
			
			throw new CommandException("No matching attribute found");
		}
		else 
		{
			Object oVal = convert(theVal,attr.getType());
			Attribute at = new Attribute(theAttr,oVal);
			server.setAttribute(objectName,at);
			
			// read the attribute back from the server
			if (!context.isQuiet())
			{
				PrintWriter out = context.getWriter();
				Object nat = server.getAttribute(objectName,theAttr);
				if (nat==null)
					out.println("null");
				else 
					if (prefix)
						out.print(theAttr+"=");
					out.println(nat.toString());
			}
		}
		closeServer();
   }