Package org.apache.commons.chain

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


            return;
        }

        // Create a new context and pass it to the specified command
        try {
            command.execute(createContext(context, resourceId));
        } catch (Exception e) {
            if (log().isErrorEnabled()) {
                log().error("Exception executing command '" + commandName
                            + "' from catalog '" + catalogName + "' for resource '"
                            + resourceId + "'", e);
View Full Code Here


            String targetCommand = (String) vb.getValue(facesContext);

            if (targetCommand != null) {
               Command command = getCatalog().getCommand(targetCommand);
               if (command != null) {
                   return command.execute(context);
               }
            }
        }
        return super.execute(context);
    }
View Full Code Here

        }
        Command command = catalog
                 .getCommand(Globals.ADD_COMPONENT_COMMAND_NAME);

        try {
            command.execute(clayContext);
        } catch (Exception e) {
            log.error(e);
            throw new RuntimeException(e);
        }
View Full Code Here

                    command = catalog.getCommand(Globals.FIND_UNKNOWN_BUILDER_COMMAND_NAME);
                }

            }

            command.execute(context);

        } catch (Exception e) {
            log.error(e);
            throw new RuntimeException(e);
        }
View Full Code Here

                    subContext.setParent(child);

                    Catalog catalog = getCatalog();
                    Command command = catalog
                            .getCommand(Globals.ADD_VALUE_CHANGE_LISTENER_COMMAND_NAME);
                    command.execute(subContext);

                }
            } else {
                log.error(getMessages().getMessage(
                        "assign.valueChangeListener.error",
View Full Code Here

       clayContext.setChild(child);
       clayContext.setAttribute(attr);
       clayContext.setDisplayElement(displayElement);
             
       Command command = new PropertyValueCommand();
       boolean isFinal = command.execute(clayContext);
       assertEquals("command finished", true, isFinal);      
       assertEquals("value = 10", child.getValue(), "10");

      
       child = (javax.faces.component.html.HtmlOutputText)
View Full Code Here

      
       servletContext.setAttribute("goodYear", "1969");
       attr.setBindingType(AttributeBean.BINDING_TYPE_VALUE);
       attr.setValue("#{goodYear}");

       isFinal = command.execute(clayContext);
       assertEquals("command finished", true, isFinal);      
       assertEquals("value = 1969", "1969", child.getValue());
      
       child = (javax.faces.component.html.HtmlOutputText)
                             facesContext.getApplication().createComponent("javax.faces.HtmlOutputText");
View Full Code Here

      
       servletContext.setAttribute("ping", "pong");
       attr.setBindingType(AttributeBean.BINDING_TYPE_EARLY);
       attr.setValue("#{ping}");

       isFinal = command.execute(clayContext);
       assertEquals("command finished", true, isFinal);      
       assertEquals("value = pong", child.getValue(), "pong");


       child = (javax.faces.component.html.HtmlOutputText)
View Full Code Here

       clayContext.setChild(child);
      
       attr.setBindingType(AttributeBean.BINDING_TYPE_NONE);
       attr.setValue("#{forManfred}");

       isFinal = command.execute(clayContext);
       assertEquals("command finished", true, isFinal);      
       assertEquals("value = #{forManfred}", "#{forManfred}", child.getValue());

       
    }
View Full Code Here

           clayContext.setAttribute(attr);
           clayContext.setDisplayElement(displayElement);
           clayContext.setSymbols(displayElement.getSymbols());
          
           Command command = new PropertyValueCommand();
           boolean isFinal = command.execute(clayContext);
           assertEquals("command finished", true, isFinal);      
           assertEquals("value = 10", "10", child.getValue());

          
           // test a symbol value of an el value
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.