/*
(non-Javadoc)

@see org.uiautomation.ios.command.Handler#handle()
4185
@Override
  public Response handle() throws Exception {
    StatusGenerator gen = new StatusGenerator(getServer());


    JSONObject res = gen.generate();

    List<ServerSideSession> sessions = getServer().getSessions();
    Response resp = new Response();

    resp.setStatus(0);
    resp.setValue(res);
    if (sessions.size() == 0) {
      resp.setSessionId(null);
    } else if (sessions.size() == 1) {
      resp.setSessionId(sessions.get(0).getSessionId());
    } else {
      throw new WebDriverException("NI multi sessions per server.");
    }
    return resp;
  }
1123132
public function handle()
    {
        parent::handle();

        $controllerGenerator = new APIControllerGenerator($this->commandData);
        $controllerGenerator->generate();

        $this->performPostActions();
    }
833115
@Override
    public void run() {
        try {
            handle();
        } catch (Exception e) {
            Throwables.throwIfUnchecked(e);
            throw new RuntimeException(e);
        }
    }
683142
@RequestMapping(method = POST)
    public void handle(@Valid @RequestBody P payload) {
        logger.debug("{} handlers", handlers.size());
        for (H handler : handlers) {
            executor.execute(runnableHandler(handler, payload));
        }
    }
864784
@Override
  public Response handle() throws Exception {
    Object p = getRequest().getPayload().get("id");

    if (JSONObject.NULL.equals(p)) {
      getWebDriver().getContext().setCurrentFrame(null, null, null);
    } else {
      RemoteWebElement iframe;
      if (p instanceof String) {
        iframe = getIframe((String) p);
      } else if (p instanceof Integer) {
        iframe = getIframe((Integer) p);
      } else if (p instanceof JSONObject) {
        String id = ((JSONObject) p).getString("ELEMENT");
        iframe = getWebDriver().createElement(id);
      } else {
        throw new UnsupportedCommandException("not supported : frame selection by " + p.getClass());
      }

      RemoteWebElement document = iframe.getContentDocument();
      RemoteWebElement window = iframe.getContentWindow();
      getWebDriver().getContext().setCurrentFrame(iframe, document, window);
    }

    Response res = new Response();
    res.setSessionId(getSession().getSessionId());
    res.setStatus(0);
    res.setValue(new JSONObject());
    return res;
  }
737945
public function handle()
    {

        // Ask what command
        $command = $this->choice('What command are you running?', $this->availableCommands->toArray());

        if (!$this->availableCommands->has($command)) {
            $this->info('The specified command does not exist.');
            return;
        }

        $method = 'make' . ucfirst($command);
        call_user_func([$this, $method]);

        $this->call('make:'. $command, $this->options);
    }
923917
protected void handle() {

        Element e = m_widget.getElement();
        if (e instanceof TextAreaElement) {
            TextAreaElement elem = (TextAreaElement)e;
            int scrollHeight = elem.getScrollHeight();
            // allow text area to shrink
            if (m_lastValue.length() > elem.getValue().length()) {
                elem.setRows(getState().getMinRows());
            }
            int currentRows = elem.getRows();
            if (m_lineHeight == 0) {
                elem.setRows(2);
                int heightTwo = elem.getClientHeight();
                elem.setRows(1);
                int heightOne = elem.getClientHeight();
                m_lineHeight = heightTwo - heightOne;
                m_paddingHeight = heightOne - m_lineHeight;
                elem.setRows(currentRows);
            }
            if (m_lineHeight > 0) {
                int totalHeight = scrollHeight - m_paddingHeight;
                int requiredRows = ((scrollHeight - m_paddingHeight) / m_lineHeight);
                if ((totalHeight % m_lineHeight) > 0) {
                    requiredRows++;
                }
                int minRows = getState().getMinRows();
                int maxRows = getState().getMaxRows();
                if ((requiredRows <= minRows) && (currentRows != minRows)) {
                    elem.setRows(minRows);
                } else if ((requiredRows >= maxRows) && (currentRows != maxRows)) {
                    elem.setRows(maxRows);
                } else if (requiredRows != currentRows) {
                    elem.setRows(requiredRows);
                }
            }
        }
    }
487855
public function handle()
    {

        $this->exceptionName = $this->formatModel($this->argument('ExceptionName'));

        $this->view = $this->formatModelPath($this->exceptionName);

        $this->setCommandType($this->argument('command'));

        $this->setExceptionPaths();

        if ( $this->deleteFiles() ) {

            $this->sendSuccessMessage();

            return;

        }

        $this->error('No Such Directory');


    }
476826
public function handle() {
        $actions = func_get_args();

        if ($actions === array('*') || empty($actions)) {
            $this->_handled = array('*');
        } else {
            $this->_handled = array_unique(array_intersect($actions, get_class_methods($this->controller)));
        }
    }
1116826
public function handle()
    {
        parent::handle();

        $controllerGenerator = new ControllerGenerator($this->commandData);
        $controllerGenerator->generate();

        $this->performPostActions();
    }
788946
public function handle()
    {
        $command = $this->option('command');

        ob_start();
        $result = $this->executeCode(
            trim(trim($command), ';').';'
        );
        $output = ob_get_clean();

        if (empty($output) === false) {
            $this->line($output);
            $result = null;
        }

        $this->getOutput()->write('=> ');
        switch (gettype($result)) {
            case 'object':
            case 'array':
                $this->line(var_export($result, true));
                break;
            case 'string':
                $this->comment($result);
                break;
            case 'NULL':
                $this->line('');
                break;
            default:
                is_numeric($result) === true ? $this->info($result) : $this->line($result);
                break;
        }
    }
611363
public static function handleCommand() {
        try {
            global $argv;
            $tokens = array_slice($argv, 1);

            if (empty($tokens)) {
                throw new RuntimeException("Command name is required !!");
            }

            $commandName = (string)$tokens[0];
            $commandTokens = array_slice($tokens, 1);

            $commandParameters = [];
            $currentCommandName = null;

            for ($i = 0; $i < sizeof($commandTokens); $i++) {
                $commandToken = $commandTokens[$i];

                if (substr($commandToken, 0, 2) == '--') {
                    if ($currentCommandName != null) {
                        $commandParameters[$currentCommandName] = true;
                    }
                    $currentCommandName = substr($commandToken, 2);
                }
                else {
                    if ($currentCommandName == null) {
                        throw new RuntimeException("Invalid argument \"$commandToken\". Arguments must start with \"--\"");
                    }
                    $commandParameters[$currentCommandName] = $commandToken;
                    $currentCommandName = null;
                }
            }

            if ($currentCommandName != null) {
                $commandParameters[$currentCommandName] = true;
            }

            self::executeCommand($commandName, $commandParameters);
        }
        catch (CommandNotFoundException $exception) {
            get_logger()->warning($exception->getMessage());
            echo $exception->getMessage() . "\n";
        }
    }
377090
public void handleCommand() throws IOException {
        this.currentLine = this.reader.readLine();

        if (this.currentLine == null) {
            LOGGER.severe("Current line is null!");
            this.exit();
            return;
        }

        final StringTokenizer st = new StringTokenizer(this.currentLine, " ");
        final String commandName = st.nextToken().toUpperCase();
        final String arg = st.hasMoreTokens() ? st.nextToken() : null;
        if (commandName == null) {
            LOGGER.severe("Command name is empty!");
            this.exit();
            return;
        }

        if (commandName.equals("STAT")) {
            this.stat();
        } else if (commandName.equals("LIST")) {
            this.list();
        } else if (commandName.equals("RETR")) {
            this.retr(arg);
        } else if (commandName.equals("DELE")) {
            this.dele();
        } else if (commandName.equals("NOOP")) {
            this.noop();
        } else if (commandName.equals("RSET")) {
            this.rset();
        } else if (commandName.equals("QUIT")) {
            this.quit();
        } else if (commandName.equals("TOP")) {
            this.top(arg);
        } else if (commandName.equals("UIDL")) {
            this.uidl();
        } else if (commandName.equals("USER")) {
            this.user();
        } else if (commandName.equals("PASS")) {
            this.pass();
        } else if (commandName.equals("CAPA")) {
            this.println("-ERR CAPA not supported");
        } else {
            LOGGER.log(Level.SEVERE, "ERROR command unknown: {0}", commandName);
            this.println("-ERR unknown command");
        }
    }
402411
public function handle()
    {
        if (!$this->passesAuthorization()) {
            return;
        }
        $uri        = uri();
        $handler    = $this->createMenu();
        $handler->uri($uri);
        $components = app('ui-components')->findAllByResource($uri);



        foreach ($components as $component) {
            if (array_get($component, 'data.dispatchable') === false) {
                continue;
            }
            if (!$component['name']) {
                continue;
            }
            $this->createItem($component);
        }
    }
754795
@CommandHandler
    public void handle(RequestStartTransactionAcceptedCommand command) {
        apply(new RequestStartTransactionAcceptedEvent(command.getChargingStationId(), command.getEvseId(), command.getIdentifyingToken(), command.getIdentityContext()));
    }
685171
@Override
    public Object handle(Message msg) throws Exception {
        if(req_handler != null)
            return req_handler.handle(msg);
        return null;
    }
873929
public S handle(Class<? extends Throwable> failure) {
    Assert.notNull(failure, "failure");
    return handle(Arrays.asList(failure));
  }