private void processMessage() throws InterruptedException {
        try {
            MessageUnit mu = messageQueue.take();
            Message m = mu.msg;
            Object result = null;
            if (m instanceof SubmitWorkerMessage) {
                SubmitWorkerMessage swm = ((SubmitWorkerMessage) m);
                submitWorker(swm.getUid(), swm.getWorker());
            } else if (m instanceof CancelWorkerMessage) {
                CancelWorkerMessage cm = ((CancelWorkerMessage) m);
                result = cancelWorker(cm.getUid());
            } else if (m instanceof GetStateMessage) {
                GetStateMessage gsm = ((GetStateMessage) m);
                result = getWorker(gsm.getUid());
            } else if(m instanceof ShutdownMessage) {
                shutdownController();
            }
            mu.cb.process(result);
        } catch (RuntimeException e) {
            Logger.getGlobal().log(Level.SEVERE, e.getMessage(), e);
        }
    }