Package dispatcher

Examples of dispatcher.Dispatcher


    buildCfg();
    // initDispatcher(null);
  }

  protected Dispatcher initDispatcher(Map<String, String> params) {
    Dispatcher du = StrutsTestCaseHelper.initDispatcher(new MockServletContext(), params);
    configurationManager = du.getConfigurationManager();
    configuration = configurationManager.getConfiguration();
    container = configuration.getContainer();
    return du;
  }
View Full Code Here


public class GaeInitOperations extends InitOperations {

  @Override
  public Dispatcher initDispatcher(HostConfig filterConfig) {
    Dispatcher dispatcher = createDispatcher(filterConfig);
    dispatcher.init();
    return dispatcher;
  }
View Full Code Here

  public void init(FilterConfig filterConfig) throws ServletException {
    InitOperations init = new GaeInitOperations();
    try {
      FilterHostConfig config = new FilterHostConfig(filterConfig);
      init.initLogging(config);
      Dispatcher dispatcher = init.initDispatcher(config);

      init.initStaticContentLoader(config, dispatcher);

      prepare = new PrepareOperations(filterConfig.getServletContext(),
          dispatcher);
View Full Code Here

    {
        if (params == null)
        {
            params = new HashMap<String, String>();
        }
        Dispatcher dispatcher = new Dispatcher(servletContext, params);
        dispatcher.init();
        Dispatcher.setInstance(dispatcher);
        return dispatcher;
    }
View Full Code Here

            String name = (String) e.nextElement();
            String value = cfg.getInitParameter(name);
            params.put(name, value);
        }
       
        dispatcherUtils = new Dispatcher(new PortletServletContext(cfg.getPortletContext()), params);
        dispatcherUtils.init();
       
        // For testability
        if (factory == null) {
            factory = dispatcherUtils.getConfigurationManager().getConfiguration().getContainer().getInstance(ActionProxyFactory.class);
View Full Code Here

    protected PrepareOperations prepare;
    protected List<Pattern> excludedPatterns = null;

    public void init(FilterConfig filterConfig) throws ServletException {
        InitOperations init = new InitOperations();
        Dispatcher dispatcher = null;
        try {
            FilterHostConfig config = new FilterHostConfig(filterConfig);
            init.initLogging(config);
            dispatcher = init.initDispatcher(config);

            prepare = new PrepareOperations(filterConfig.getServletContext(), dispatcher);
            this.excludedPatterns = init.buildExcludedPatternsList(dispatcher);

            postInit(dispatcher, filterConfig);
        } finally {
            if (dispatcher != null) {
                dispatcher.cleanUpAfterInit();
            }
            init.cleanup();
        }
    }
View Full Code Here

    }

    protected synchronized void lazyInit() {
        if (execute == null) {
            InitOperations init = new InitOperations();
            Dispatcher dispatcher = init.findDispatcherOnThread();
            init.initStaticContentLoader(new FilterHostConfig(filterConfig), dispatcher);

            prepare = new PrepareOperations(filterConfig.getServletContext(), dispatcher);
            execute = new ExecuteOperations(filterConfig.getServletContext(), dispatcher);
        }
View Full Code Here

*/
public class ClassInstantiationTest extends StrutsInternalTestCase {

    public void testCompositeActionMapperInstantiationWithList() throws Exception {
        // given
        Dispatcher du = initDispatcher(new HashMap<String, String>() {{
            put(StrutsConstants.STRUTS_I18N_ENCODING, "utf-8");
            put(StrutsConstants.STRUTS_MAPPER_COMPOSITE, "struts,restful");
        }});
        Container container = du.getContainer();

        // when
        ActionMapper instance = container.getInstance(ActionMapper.class, "composite");

        // then
View Full Code Here

        assertNotNull(instance);
    }

    public void testCompositeActionMapperInstantiationWithoutList() throws Exception {
        // given
        Dispatcher du = initDispatcher(new HashMap<String, String>() {{
            put(StrutsConstants.STRUTS_I18N_ENCODING, "utf-8");
        }});
        Container container = du.getContainer();

        // when
        try {
            container.getInstance(ActionMapper.class, "composite");
            fail();
View Full Code Here

        super.setUp();
        initDispatcher(null);
    }
   
    protected Dispatcher initDispatcher(Map<String,String> params) {
        Dispatcher du = StrutsTestCaseHelper.initDispatcher(new MockServletContext(), params);
        configurationManager = du.getConfigurationManager();
        configuration = configurationManager.getConfiguration();
        container = configuration.getContainer();
        return du;
    }
View Full Code Here

TOP

Related Classes of dispatcher.Dispatcher

Copyright © 2018 www.massapicom. 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.