public void update(Observable o, Object arg) {
        SessionInfo sessionInfo = (SessionInfo) arg;
        if (sessionInfo.getOutput() != null) {
            XStream xstream = new XStream();
            logger.debug("Message from server: " + sessionInfo.getMessage() + " from XML");
            String message = sessionInfo.getMessage();
            ApplicationCommand ac = (ApplicationCommand) xstream.fromXML(message);
            ac.setResult(swingomatic.getUsage() + " \r\nreceived: " + ac.getCommand());
            if ("list-components".equalsIgnoreCase(ac.getCommand())) {
                ac = swingomatic.listComponents();
            } else if ("execute".equalsIgnoreCase(ac.getCommand())) {
                ac.setLastProcessedComponent(0);
                boolean ok = true;
                while (ok || swingomatic.componentsWereAdded) {
                    logger.debug("calling execute: " + ac.getLastProcessedComponent()
                            + " " + swingomatic.componentsWereAdded);
                    ok = swingomatic.executeCommand(ac);
                    logger.debug("execute result - lastProcessedComponent: " + ac.getLastProcessedComponent()
                            + " componentsWereAdded: " + swingomatic.componentsWereAdded
                            + " result: " + ok);
                    if (ok) {
                        if (ac.getLastProcessedComponent() >= ac.getComponents().size()) {
                            break;
                        }
                    } else {
                        if (ac.getUiRefreshTimeout() > 0) {
                            logger.debug("did not complete: waiting " + ac.getUiRefreshTimeout() + " milliseconds...");
                            try {
                                Thread.sleep(ac.getUiRefreshTimeout());
                            } catch (InterruptedException ex) {
                                ex.printStackTrace();
                            }
                        }
                    }
                }
            }
            sessionInfo.setResponse(xstream.toXML(ac));
            sendResponseToClient(sessionInfo);
            ((Server) o).terminate();
            createServer();
        }
    }