Examples of AbstractCommand


Examples of org.apache.karaf.shell.commands.basic.AbstractCommand

            while (line != null) {
                line = line.trim();
                if (line.length() > 0 && line.charAt(0) != '#') {
                    final Class<Action> actionClass = (Class<Action>) cl.loadClass(line);
                    Command cmd = actionClass.getAnnotation(Command.class);
                    Function function = new AbstractCommand() {
                        @Override
                        public Action createNewAction() {
                            try {
                                return ((Class<? extends Action>) actionClass).newInstance();
                            } catch (InstantiationException e) {
View Full Code Here

Examples of org.apache.openejb.server.cli.command.AbstractCommand

                    recipe.allow(Option.CASE_INSENSITIVE_PROPERTIES);
                    recipe.allow(Option.IGNORE_MISSING_PROPERTIES);
                    recipe.allow(Option.NAMED_PARAMETERS);

                    try {
                        final AbstractCommand cmdInstance = (AbstractCommand) recipe.create();
                        cmdInstance.execute(line);
                    } catch (Exception e) {
                        streamManager.writeErr(e);
                    }
                } else {
                    streamManager.writeErr("sorry i don't understand '" + line + "'");
View Full Code Here

Examples of org.apache.openejb.server.cli.command.AbstractCommand

                    recipe.allow(Option.CASE_INSENSITIVE_PROPERTIES);
                    recipe.allow(Option.IGNORE_MISSING_PROPERTIES);
                    recipe.allow(Option.NAMED_PARAMETERS);

                    try {
                        final AbstractCommand cmdInstance = (AbstractCommand) recipe.create();
                        cmdInstance.execute(trunc(line, key));
                    } catch (final Exception e) {
                        streamManager.writeErr(e);
                    }
                } else {
                    streamManager.writeErr("sorry i don't understand '" + line + "'");
View Full Code Here

Examples of org.eclipse.emf.common.command.AbstractCommand

      return null;
    }

    final ModelSet papyrus = modelSet;
    CommandStack stack = modelSet.getTransactionalEditingDomain().getCommandStack();
    stack.execute(new AbstractCommand() {
      @Override
      public boolean canExecute() {
        return true;
      }
View Full Code Here

Examples of org.elfinder.servlets.commands.AbstractCommand

      if (config == null) {
        throw new Exception("Configuration problem");
      }

      // prepare command and run
      AbstractCommand command = prepareCommand((String) requestParams.get("cmd"), request, response, config);
      try {
        command.execute();
      } catch (ConnectorException e) {
        logger.warn("command returned an error", e);
        putResponse("error", e.getMessage());
      }

      // append init info if needed
      if (command.mustRunInit()) {
        try {
          command.initCommand();
        } catch (ConnectorException e) {
          logger.warn("command returned an error", e);
          putResponse("error", e.getMessage());
        }
      }

      // output if command didn't do it
      if (!command.isResponseOutputDone()) {
        output(response, command.isResponseTextHtml(), json, command.getResponseWriter());
        command.setResponseOutputDone(true);
      }
    } catch (Exception e) {
      logger.error("Unknown error", e);
      putResponse("error", "Unknown error");
View Full Code Here

Examples of org.elfinder.servlets.commands.AbstractCommand

    if (!config.isCommandAllowed(commandStr)) {
      putResponse("error", "Permission denied");
    }

    AbstractCommand command = null;
    if (commandStr != null) {
      command = instanciateCommand(commandStr);
      if (command == null) {
        putResponse("error", "Unknown command");
      }
    } else {
      String current = (String) request.getParameterMap().get("current");
      if (current != null) {
        command = new OpenCommand();
      } else {
        command = new ContentCommand();
      }
    }

    command.setRequest(request);
    command.setResponse(response);
    command.setJson(json);
    command.setRequestParameters(requestParams);
    command.setListFiles(listFiles);
    command.setListFileStreams(listFileStreams);
    command.setConfig(config);

    command.init();

    return command;
  }
View Full Code Here

Examples of org.elfinder.servlets.commands.AbstractCommand

   * Instanciate a command from its name.
   * @param commandName
   * @return
   */
  protected AbstractCommand instanciateCommand(String commandName) {
    AbstractCommand instance = null;
    try {
      Class<AbstractCommand> clazz = getCommandClass(commandName);
      if (clazz != null) {
        instance = clazz.newInstance();
        if (instance == null) {
View Full Code Here

Examples of org.jbpm.pvm.internal.cmd.AbstractCommand

  public <T> T execute(Command<T> command) {
    Environment environment;
   
    if (command instanceof AbstractCommand) {
      AbstractCommand abstractCommand = (AbstractCommand) command;
      List<WireObject> txWireObjects = abstractCommand.getTxWireObjects();
      environment = environmentFactory.openEnvironment(txWireObjects);

    } else {
      environment = environmentFactory.openEnvironment();
    }
View Full Code Here

Examples of org.locationtech.udig.project.command.AbstractCommand

            // layer is intended as a background layer
           
            // We can clear the background setting using a custom command
            IMap map = layer.getMap();
            final Layer modifyLayer = (Layer) layer;
            map.sendCommandASync( new AbstractCommand(){
                public void run(IProgressMonitor monitor) throws Exception {
                    modifyLayer.setInteraction( Interaction.BACKGROUND, false );
                }
                public String getName() {
                    return "Clear Interaction";
View Full Code Here

Examples of org.locationtech.udig.project.command.AbstractCommand

        Map map = MapTests.createNonDynamicMapAndRenderer(resource, new Dimension(500, 512));
        ValidateOverlaps validator = new ValidateOverlaps();
        validator.op(Display.getDefault(), map.getLayersInternal().get(0),
                new NullProgressMonitor());
        assertEquals(1, validator.genericResults.failedFeatures.size()); //only line[0] and line[1] should fail (counts as 1)
        map.sendCommandSync(new AbstractCommand(){

            public void run( IProgressMonitor monitor ) throws Exception {
            }

            public String getName() {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.