Package org.apache.commons.chain

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


        }

        // Map to the Command specified by the extra path info
        Catalog catalog = (Catalog) context.get(getCatalogKey());
        Command command = catalog.getCommand(servletPath);
        return (command.execute(context));

    }


}
View Full Code Here


     */
    public boolean execute(Context context) throws Exception {

        Command command = getCommand(context);
        if (command != null) {
            boolean result = (command.execute(context));
            if (isIgnoreExecuteResult()) {
                return false;
            }
            return result;
        } else {
View Full Code Here

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

        Command command = this.catalog.getCommand("servlet-standard");
        try {
            if (log.isDebugEnabled()) {
                log.debug("Using processing chain for this request");
            }
            command.execute(context);
        } catch (Exception e) {
            // Execute the exception processing chain??
            throw new ServletException(e);
        }
View Full Code Here

         if (cmd == null)
            throw new Exception("No 'displayResource' command found");
         ctx.put("path", currentPath);
         ctx.put("cache-control-max-age", getServletConfig().getInitParameter("cache-control-max-age"));
         cmd.execute(ctx);
      }
      catch (Exception e)
      {
         e.printStackTrace();
         throw new ServletException(e);
View Full Code Here

      if (cmd == null)
         throw new ServletException("No Command found " + commandName);
      try
      {
         cmd.execute(ctx);
      }
      catch (Exception e)
      {
         e.printStackTrace();
         throw new ServletException(e);
View Full Code Here

      ctx.put("name", "testProperty");
      ctx.put("propertyType", PropertyType.TYPENAME_STRING);
      ctx.put("values", "testValue");
      ctx.put("multiValued", Boolean.FALSE);

      c.execute(ctx);

      Command save = cservice.getCatalog().getCommand("save");
      save.execute(ctx);

   }
View Full Code Here

      ctx.put("multiValued", Boolean.FALSE);

      c.execute(ctx);

      Command save = cservice.getCatalog().getCommand("save");
      save.execute(ctx);

   }

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

   public void testGetNodes() throws Exception
   {

      Command c = cservice.getCatalog().getCommand("getNodes");
      ctx.put("currentNode", "/");
      c.execute(ctx);

      assertTrue(ctx.get("result") instanceof NodeIterator);
      NodeIterator nodes = (NodeIterator)ctx.get("result");

      // System.out.println("> getNodes >> "+nodes.getSize());
View Full Code Here

      ctx.put("currentNode", "/");
      ctx.put("path", "resource");
      ctx.put("data", "Node data");
      ctx.put("mimeType", "text/html");

      c.execute(ctx);

      Command save = cservice.getCatalog().getCommand("save");
      ctx.put("path", "/");
      save.execute(ctx);
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.