class DebuggerActor {

    public void executeCommand(final CommandMessage message)
            throws ReadValueException, ChangeValueException, InvalidArgumentException,
                SessionNotFoundException {
        debuggerAddress = message.getDebuggerAddress();
        String command = message.getCommand();

        try {
            if (globalCommands.containsKey(command)) {
                Object args = message.getCommandArguments();

                if (null == args) {
                    args = message.getSessionId();
                }

                message.setCommandResult(globalCommands.get(command).execute(args));
            } else {
                String sessionId = message.getSessionId();
                Object args = message.getCommandArguments();

                message.setCommandResult(getSession(sessionId).executeCommand(command, args));
            }
        } catch (CommandExecutionException e) {
            message.setException(e);
        }
    }

}