Package org.mortbay.jetty.servlet

Examples of org.mortbay.jetty.servlet.Context.addEventListener()


    URL resource = EndToEndTest.class.getResource("/endtoend");
    resources.setBaseResource(Resource.newResource(resource));
    newServer.addHandler(resources);

    Context context = new Context(newServer, "/", Context.SESSIONS);
    context.addEventListener(new GuiceServletContextListener());

    Map<String, String> initParams = Maps.newHashMap();
    String modules = Joiner.on(":")
        .join(SocialApiGuiceModule.class.getName(),
              SampleModule.class.getName(),
View Full Code Here


   }

   protected Context createRESTEndpoint(int port, EmbeddedCacheManager cacheManager, RestServerConfiguration configuration) {
      Context ctx = new Context(new org.mortbay.jetty.Server(port), "/", Context.SESSIONS);
      ctx.setInitParams(Collections.singletonMap("resteasy.resources", "org.infinispan.rest.Server"));
      ctx.addEventListener(new ResteasyBootstrap());
      ctx.addServlet(HttpServletDispatcher.class, "/rest/*");
      ServletContext servletContext = ctx.getServletContext();
      ServerBootstrap.setCacheManager(servletContext, cacheManager);
      ServerBootstrap.setConfiguration(servletContext, configuration);
      return ctx;
View Full Code Here

        comet.setInitParameter("maxInterval", "10000");
        comet.setInitParameter("multiFrameInterval", "5000");
        comet.setInitParameter("logLevel", "0");
        comet.setInitOrder(2);

        context.addEventListener(listener);

        server.start();
    }

    public void setUp() throws Exception
View Full Code Here

    context.setResourceBase(Resource.newClassPathResource("/endtoend").getFile().getAbsolutePath());

    ServletHolder defaultHolder = new ServletHolder(new DefaultServlet());
    context.addServlet(defaultHolder, "/");

    context.addEventListener(new GuiceServletContextListener());
                                                                                                  
    Map<String, String> initParams = Maps.newHashMap();
    String modules = Joiner.on(":")
        .join(SampleModule.class.getName(), DefaultGuiceModule.class.getName(),
            PropertiesModule.class.getName(), OAuthModule.class.getName());
View Full Code Here

    URL resource = EndToEndTest.class.getResource("/endtoend");
    resources.setBaseResource(Resource.newResource(resource));
    newServer.addHandler(resources);

    Context context = new Context(newServer, "/", Context.SESSIONS);
    context.addEventListener(new GuiceServletContextListener());

    Map<String, String> initParams = Maps.newHashMap();
    String modules = Joiner.on(":")
        .join(SampleModule.class.getName(), DefaultGuiceModule.class.getName(),
            PropertiesModule.class.getName(), OAuthModule.class.getName());
View Full Code Here

    {
         httpServer = new Server(port);

        Context c = new Context(httpServer, contextPath, Context.SESSIONS);
        c.addServlet(new ServletHolder(servlet), servletPath);
        c.addEventListener(new ServletContextListener() {
            public void contextInitialized(ServletContextEvent sce)
            {
                sce.getServletContext().setAttribute(MuleProperties.MULE_CONTEXT_PROPERTY, context);
            }
View Full Code Here

        HTTP_PORT = getPorts().get(0);
        httpServer = new Server(HTTP_PORT);

        Context c = new Context(httpServer, "/", Context.SESSIONS);
        c.addServlet(new ServletHolder(new MuleReceiverServlet()), "/services/*");
        c.addEventListener(new ServletContextListener() {
            public void contextInitialized(ServletContextEvent sce)
            {
                sce.getServletContext().setAttribute(MuleProperties.MULE_CONTEXT_PROPERTY, muleContext);
            }

View Full Code Here

        }

        ContextHandlerCollection handlerCollection = new ContextHandlerCollection();
        Context context = new Context(handlerCollection, ROOT, Context.NO_SECURITY);
        context.setConnectorNames(new String[]{connector.getName()});
        context.addEventListener(new MuleServletContextListener(muleContext, getName()));

        if (resourceBase != null)
        {
            Context resourceContext = new Context(handlerCollection, path, Context.NO_SECURITY);
            resourceContext.setResourceBase(resourceBase);
View Full Code Here

        // at this point and we can't move super.doSetUp() above this
        httpServer = new Server(getPorts().get(0));

        Context c = new Context(httpServer, "/", Context.SESSIONS);
        c.addServlet(new ServletHolder(new MuleAjaxServlet()), "/ajax/*");
        c.addEventListener(new MuleServletContextListener(muleContext, null));

        httpServer.start();

        super.doSetUp();

View Full Code Here

        // at this point and we can't move super.doSetUp() above this       
        httpServer = new Server(getPorts().get(0));

        Context c = new Context(httpServer, "/", Context.SESSIONS);
        c.addServlet(new ServletHolder(new MuleAjaxServlet()), "/ajax/*");
        c.addEventListener(new MuleServletContextListener(muleContext, null));

        httpServer.start();

        super.doSetUp();
    }
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.