Package org.apache.commons.chain

Examples of org.apache.commons.chain.Command.execute()


      c.execute(ctx);

      Command save = cservice.getCatalog().getCommand("save");
      ctx.put("path", "/");
      save.execute(ctx);

   }

   public void testGetNodeChain() throws Exception
   {
View Full Code Here


   public void testGetNodeChain() throws Exception
   {
      Command cmd = cservice.getCatalog().getCommand("retrieveNodeCommand");
      ctx.put("currentNode", "/");
      ctx.put("path", "test");
      cmd.execute(ctx);
   }
}
View Full Code Here

            }
            if (log.isTraceEnabled()) {
                log.trace("Calling exceptionCommand '" + exceptionCommand
                          + "'");
            }
            command.execute(context);
        } catch (Exception e) {
            log.warn("Exception from exceptionCommand '" +
                     exceptionCommand + "'", e);
            throw new IllegalStateException("Exception chain threw exception");
        }
View Full Code Here

        context.put("form", form);

        // Delegate to the specified command
        String name = mapping.getParameter();
        Command command = getCatalog().getCommand(request.getParameter(name));
        command.execute(context); // Ignore return state

        // Return results as appropriate
        Exception exception = null;
        try {
            exception = (Exception) context.get("exception");
View Full Code Here

        context.put("mapping", mapping);
        context.put("form", form);

        // Delegate to the specified command
        Command command = getCatalog().getCommand(mapping.getParameter());
        command.execute(context); // Ignore return state

        // Return results as appropriate
        Exception exception = null;
        try {
            exception = (Exception) context.get("exception");
View Full Code Here

  public boolean execute(ActionContext actionCtx) throws Exception {
    if (shouldProcess(actionCtx)) {
      Command command = getCommand(actionCtx);

      if (command != null) {
        return (command.execute(actionCtx));
      }
    }

    return (false);
  }
View Full Code Here

      if (LOG.isTraceEnabled()) {
        LOG.trace("Calling exceptionCommand '" + exceptionCommand + "'");
      }

      command.execute(context);
    } catch (Exception e) {
      LOG.warn("Exception from exceptionCommand '" + exceptionCommand + "'", e);
      throw new IllegalStateException("Exception chain threw exception");
    }
View Full Code Here

    }

    Command command = getCommand(context);

    if (command != null) {
      return command.execute(getContext(context));
    } else {
      return false;
    }
  }
View Full Code Here

         {
            // Set the portal classloader to get all the resources defined within the portal context
            Thread.currentThread().setContextClassLoader(pcClassLoader);
            hasChanged = true;
         }        
         cmd.execute(ctx);
      }
      catch (Exception e)
      {
         log.error("An error occurs while executing the command " + commandName, e);
         throw new ServletException(e);
View Full Code Here

      Catalog c = cservice.getCatalog();

      Context ctx = new ContextBase();
      ctx.put("test", Integer.valueOf(0));
      c1.execute(ctx);
      c2.execute(ctx);
      assertEquals(3, ((Integer)ctx.get("test")).intValue());

   }

}
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.