当前位置: 首页>>代码示例>>Java>>正文


Java Context.SESSIONS属性代码示例

本文整理汇总了Java中org.mortbay.jetty.servlet.Context.SESSIONS属性的典型用法代码示例。如果您正苦于以下问题:Java Context.SESSIONS属性的具体用法?Java Context.SESSIONS怎么用?Java Context.SESSIONS使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.mortbay.jetty.servlet.Context的用法示例。


在下文中一共展示了Context.SESSIONS属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: startServer

private static void startServer() throws Exception, InterruptedException {
  Server server = new Server(port);
  Context context = new Context(server, "/", Context.SESSIONS);
  context.addServlet(DefaultServlet.class, "/*");

  context.addEventListener(new ContextLoaderListener(getContext()));
  context.addEventListener(new RequestContextListener());

  WicketFilter filter = new WicketFilter();
  filter.setFilterPath("/");
  FilterHolder holder = new FilterHolder(filter);
  holder.setInitParameter("applicationFactoryClassName", APP_FACTORY_NAME);
  context.addFilter(holder, "/*", Handler.DEFAULT);

  server.setHandler(context);
  server.start();
  server.join();
}
 
开发者ID:jorcox,项目名称:GeoCrawler,代码行数:18,代码来源:NutchUiServer.java

示例2: setupPspMithraService

protected void setupPspMithraService()
    {
        server = new Server(this.getApplicationPort1());
        Context context = new Context (server,"/",Context.SESSIONS);
        ServletHolder holder = context.addServlet(PspServlet.class, "/PspServlet");
        holder.setInitParameter("serviceInterface.MasterCacheService", "com.gs.fw.common.mithra.cache.offheap.MasterCacheService");
        holder.setInitParameter("serviceClass.MasterCacheService", "com.gs.fw.common.mithra.cache.offheap.MasterCacheServiceImpl");
        holder.setInitOrder(10);
//        System.out.println(holder.getServlet().getClass().getName());

        try
        {
            server.start();
        }
        catch (Exception e)
        {
            throw new RuntimeException("could not start server", e);
        }
        finally
        {
        }
    }
 
开发者ID:goldmansachs,项目名称:reladomo,代码行数:22,代码来源:CacheReplicationTestCase.java

示例3: setupServerWithHandler

protected void setupServerWithHandler(
        Handler handler) throws Exception
{
    this.port = (int) (Math.random() * 10000.0 + 10000.0);
    this.pspUrl = "http://localhost:" + this.port + "/PspServlet";
    this.server = new Server(this.port);
    Context context = new Context(server, "/", Context.SESSIONS);
    if (handler != null)
    {
        context.addHandler(handler);
    }
    ServletHolder holder = context.addServlet(PspServlet.class, "/PspServlet");
    holder.setInitParameter("serviceInterface.Echo", "com.gs.fw.common.mithra.test.tinyproxy.Echo");
    holder.setInitParameter("serviceClass.Echo", "com.gs.fw.common.mithra.test.tinyproxy.EchoImpl");
    holder.setInitOrder(10);

    this.server.start();
    this.servlet = (PspServlet) holder.getServlet();
}
 
开发者ID:goldmansachs,项目名称:reladomo,代码行数:19,代码来源:PspTestCase.java

示例4: setupPspMithraService

protected void setupPspMithraService()
{
    server = new Server(this.getApplicationPort1());
    Context context = new Context (server,"/",Context.SESSIONS);
    ServletHolder holder = context.addServlet(PspServlet.class, "/PspServlet");
    holder.setInitParameter("serviceInterface.RemoteMithraService", "com.gs.fw.common.mithra.remote.RemoteMithraService");
    holder.setInitParameter("serviceClass.RemoteMithraService", "com.gs.fw.common.mithra.remote.RemoteMithraServiceImpl");
    holder.setInitOrder(10);

    try
    {
        server.start();
    }
    catch (Exception e)
    {
        throw new RuntimeException("could not start server", e);
    }
    finally
    {
    }
}
 
开发者ID:goldmansachs,项目名称:reladomo,代码行数:21,代码来源:RemoteMithraServerTestCase.java

示例5: setup

@BeforeClass
public static void setup() throws Exception {
  try {
    JobCallbackRequestMaker.initialize(new Props());
    jobCBMaker = JobCallbackRequestMaker.getInstance();

    contextInfo = new HashMap<String, String>();
    contextInfo.put(CONTEXT_SERVER_TOKEN, SERVER_NAME);
    contextInfo.put(CONTEXT_PROJECT_TOKEN, PROJECT_NANE);
    contextInfo.put(CONTEXT_FLOW_TOKEN, FLOW_NANE);
    contextInfo.put(CONTEXT_EXECUTION_ID_TOKEN, EXECUTION_ID);
    contextInfo.put(CONTEXT_JOB_TOKEN, JOB_NANE);
    contextInfo.put(CONTEXT_JOB_STATUS_TOKEN, JobCallbackStatusEnum.STARTED.name());

    embeddedJettyServer = new Server(PORT_NUMBER);

    Context context = new Context(embeddedJettyServer, "/", Context.SESSIONS);
    context.addServlet(new ServletHolder(new DelayServlet()), "/delay");

    System.out.println("Start server");
    embeddedJettyServer.start();
  } catch (Exception e) {
    e.printStackTrace();
    throw e;
  }
}
 
开发者ID:JasonBian,项目名称:azkaban,代码行数:26,代码来源:JobCallbackRequestMakerTest.java

示例6: createHandler

private Context createHandler(
    Map<String, Path> runfiles,
    ImmutableList<Route> routes,
    ImmutableList<Class<? extends Filter>> filters) {
  Context context = new Context(server, CONTEXT_PATH, Context.SESSIONS);
  context.addServlet(new ServletHolder(HealthzServlet.class), "/healthz");
  for (Map.Entry<String, Path> runfile : runfiles.entrySet()) {
    context.addServlet(
        StaticResourceServlet.create(runfile.getKey(), runfile.getValue()),
        runfile.getKey());
  }
  for (Route route : routes) {
    context.addServlet(
        new ServletHolder(wrapServlet(route.servletClass(), filters)), route.path());
  }
  ServletHolder holder = new ServletHolder(DefaultServlet.class);
  holder.setInitParameter("aliases", "1");
  context.addServlet(holder, "/*");
  return context;
}
 
开发者ID:google,项目名称:nomulus,代码行数:20,代码来源:TestServer.java

示例7: main

public static void main( String[] args )
    throws Exception
{
    Server server = new Server( 8080 );

    WebAppContext webappcontext = new WebAppContext( "src/main/webapp", "/xdocreport-webapp" );

    ContextHandlerCollection servlet_contexts = new ContextHandlerCollection();
    webappcontext.setClassLoader( Thread.currentThread().getContextClassLoader() );
    HandlerCollection handlers = new HandlerCollection();
    handlers.setHandlers( new Handler[] { servlet_contexts, webappcontext, new DefaultHandler() } );

    server.setHandler( handlers );

    // JSP Servlet + Context
    Context jsp_ctx = new Context( servlet_contexts, "/jsp", Context.SESSIONS );
    jsp_ctx.addServlet( new ServletHolder( new org.apache.jasper.servlet.JspServlet() ), "*.jsp" );

    server.start();
    server.join();
}
 
开发者ID:DistX,项目名称:Learning,代码行数:21,代码来源:EmbeddedServer.java

示例8: startServer

public void startServer(int port, String classBound) throws BindException,
		Exception {
	sh = new ServletHolder(ServletContainer.class);

	sh.setInitParameter(
			"com.sun.jersey.config.property.resourceConfigClass",
			"com.sun.jersey.api.core.PackagesResourceConfig");
	sh.setInitParameter("com.sun.jersey.config.property.packages",
			classBound);

	// custom parameters
	// Map<String, Object> initParameters = getCustomInitParamters(port);
	// sh.setInitParameters(initParameters);

	Server server = new Server(port);

	Context context = new Context(server, "/", Context.SESSIONS);

	context.addServlet(sh, "/*");
	server.start();

}
 
开发者ID:Aeronbroker,项目名称:Aeron,代码行数:22,代码来源:ServerDummy.java

示例9: start

public void start() throws Exception {

        RealmService realmService = new InMemoryRealmService();
        RegistryContext regContext = RegistryContext.getBaseInstance(realmService);
        regContext.selectDBConfig("in-memory");
        //RegistryContext.setSingleton(regContext);

        server = new Server(port);
        Context context = new Context(server, null/*RegistryProvider.baseURI*/, Context.SESSIONS);
        ServletHolder servletHolder = new ServletHolder(new AbderaServlet());
        servletHolder.setInitParameter(ServiceManager.PROVIDER,
                                       RegistryProvider.class.getName());
        context.addServlet(servletHolder, "/*");
        server.start();

//        root.addServlet(new ServletHolder(new RegistryServlet()), "/resources/*");
//        root.addServlet(new ServletHolder(new AbderaServlet()), "/atom/*");
//        server.start();
    }
 
开发者ID:wso2,项目名称:carbon-registry,代码行数:19,代码来源:RegistryServer.java

示例10: setup

@BeforeMethod
public void         setup() throws Exception
{
    RestEasyApplication.singletonsRef.set(new RestEasySingletons());

    ResteasyProviderFactory.setInstance(new ResteasyProviderFactory());

    HttpServletDispatcher   dispatcher = new HttpServletDispatcher();

    port = InstanceSpec.getRandomPort();
    server = new Server(port);
    Context root = new Context(server, "/", Context.SESSIONS);
    root.getInitParams().put("javax.ws.rs.Application", RestEasyApplication.class.getName());
    root.addServlet(new ServletHolder(dispatcher), "/*");
    root.addEventListener(new ResteasyBootstrap());
    server.start();
}
 
开发者ID:apache,项目名称:curator,代码行数:17,代码来源:TestStringsWithRestEasy.java

示例11: startServer

/**
 * Starts the jetty web server.
 * @return true on successful start.
 */
public boolean startServer() {
    if (server != null && server.isRunning()) {
        return true;
    } else {
        server = new Server(port);
        ContextHandlerCollection contexts = new ContextHandlerCollection();
        server.setHandler(contexts);

        Context mjpg = new Context(contexts, MPEG, Context.SESSIONS);
        mjpg.addServlet(new ServletHolder(new AxisServlet()), "/*");
        
        try {
            server.start();
            return true;
        } catch (Exception e1) {
            log.error("Could not start server", e1);
        }
    }
    return false;
}
 
开发者ID:Comcast,项目名称:cats,代码行数:24,代码来源:JettyAxisCameraServer.java

示例12: MsTeamsNotificationTestServer

public MsTeamsNotificationTestServer(String host, Integer port) {
	server = new Server(port);
	Context root = new Context(server,"/",Context.SESSIONS);
	root.addServlet(new ServletHolder(new MyHttpServlet(HttpServletResponse.SC_OK)), "/200");
	root.addServlet(new ServletHolder(new MyHttpServlet(HttpServletResponse.SC_MOVED_TEMPORARILY)), "/302");
	root.addServlet(new ServletHolder(new MyHttpServlet(HttpServletResponse.SC_INTERNAL_SERVER_ERROR)), "/500");
}
 
开发者ID:spyder007,项目名称:teamcity-msteams-notifier,代码行数:7,代码来源:MsTeamsNotificationTestServer.java

示例13: main

/**
 * Sets up and runs server.
 * @param args
 */
public static void main(String[] args)
{
    final Server server = new Server();

    SelectChannelConnector connector = new SelectChannelConnector();
    connector.setPort(8080);
    server.addConnector(connector);

    Context htmlContext = new Context(server, "/", Context.SESSIONS);

    ResourceHandler htmlHandler = new ResourceHandler();
    htmlHandler.setResourceBase("web");
    htmlContext.setHandler(htmlHandler);

    Context servletContext = new Context(server, "/", Context.SESSIONS);

    GenericWebApplicationContext springContext = new GenericWebApplicationContext();
    springContext.setParent(new ClassPathXmlApplicationContext("org/getahead/dwrdemo/cli/spring.xml"));
    servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, springContext);

    ServletHolder holder = new ServletHolder(new DwrSpringServlet());
    holder.setInitParameter("pollAndCometEnabled", "true");
    holder.setInitParameter("debug", "true");
    servletContext.addServlet(holder, "/dwr/*");

    try
    {
        JettyShutdown.addShutdownHook(server);
        server.start();
        server.join();
    }
    catch (Exception ex)
    {
        ex.printStackTrace();
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:40,代码来源:JettySpringLauncher.java

示例14: main

/**
 * Sets up and runs server.
 * @param args
 */
public static void main(String[] args)
{
    Server server = new Server();

    SelectChannelConnector connector = new SelectChannelConnector();
    connector.setPort(8080);
    server.addConnector(connector);

    Context htmlContext = new Context(server, "/", Context.SESSIONS);
    ResourceHandler htmlHandler = new ResourceHandler();
    htmlHandler.setResourceBase("web");
    htmlContext.setHandler(htmlHandler);

    Context servletContext = new Context(server, "/", Context.SESSIONS);
    ServletHolder holder = new ServletHolder(new DwrServlet());
    holder.setInitParameter("activeReverseAjaxEnabled", "true");
    holder.setInitParameter("debug", "true");
    servletContext.addServlet(holder, "/dwr/*");
    servletContext.setResourceBase("web");

    try
    {
        JettyShutdown.addShutdownHook(server);
        server.start();
        server.join();
    }
    catch (Exception ex)
    {
        ex.printStackTrace();
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:35,代码来源:JettyLauncher.java

示例15: JettyServer

public JettyServer(int port, HttpsConfiguration httpsConf)
{
    server = new Server();

    SslSelectChannelConnector connector = new SslSelectChannelConnector();
    connector.setPort(port);
    connector.setKeystore(httpsConf.getServerKeystorePath());
    connector.setKeyPassword(httpsConf.getServerKeystorePassword());

    if ( httpsConf.isVerifyPeerCert() )
    {
        connector.setTruststore(httpsConf.getTruststorePath());
        connector.setTrustPassword(httpsConf.getTruststorePassword());
        connector.setNeedClientAuth(true);
    }

    connector.setWantClientAuth(httpsConf.isRequireClientCert());

    connector.setAcceptors(8);
    connector.setMaxIdleTime(5000);
    connector.setAcceptQueueSize(32);

    server.addConnector(connector);
    server.setStopAtShutdown(true);

    DefaultResourceConfig config = new DefaultResourceConfig(JettyServer.RestService.class);
    ServletContainer container = new ServletContainer(config);

    Context context = new Context(server, "/", Context.SESSIONS);
    context.addServlet(new ServletHolder(container), "/*");
}
 
开发者ID:dcos,项目名称:exhibitor,代码行数:31,代码来源:JettyServer.java


注:本文中的org.mortbay.jetty.servlet.Context.SESSIONS属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。