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


Java GuiceResteasyBootstrapServletContextListener类代码示例

本文整理汇总了Java中org.jboss.resteasy.plugins.guice.GuiceResteasyBootstrapServletContextListener的典型用法代码示例。如果您正苦于以下问题:Java GuiceResteasyBootstrapServletContextListener类的具体用法?Java GuiceResteasyBootstrapServletContextListener怎么用?Java GuiceResteasyBootstrapServletContextListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: GitServerHandler

import org.jboss.resteasy.plugins.guice.GuiceResteasyBootstrapServletContextListener; //导入依赖的package包/类
private GitServerHandler(final Config config, final Module... overrides) {
	addEventListener(new GuiceResteasyBootstrapServletContextListener() {
		@Override
		protected List<Module> getModules(ServletContext context) {
			return ImmutableList.<Module> of(Modules.override(new GitServerModule(config)).with(overrides));
		}

		@Override
		protected void withInjector(Injector injector) {
			injectorAtomicReference.set(injector);
			// No interaction with injector required. Skipping...
		}
	});

	addServlet(HttpServletDispatcher.class, "/");
}
 
开发者ID:devhub-tud,项目名称:git-server,代码行数:17,代码来源:GitServer.java

示例2: main

import org.jboss.resteasy.plugins.guice.GuiceResteasyBootstrapServletContextListener; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
  Injector injector = Guice.createInjector(getModules(args));
  
  Server server = new Server(injector.getInstance(Key.get(Integer.class, Port.class)));
  ServletContextHandler handler = new ServletContextHandler(server, "/pvwatts");
  
  handler.addEventListener(injector.getInstance(
    GuiceResteasyBootstrapServletContextListener.class));

  ServletHolder sh = new ServletHolder(HttpServletDispatcher.class);
  handler.addServlet(sh, "/*");
  server.setHandler(handler);

  server.start();
  server.join();
}
 
开发者ID:spharris,项目名称:pvwatts-java,代码行数:17,代码来源:PvWattsServer.java

示例3: ServerRuntime

import org.jboss.resteasy.plugins.guice.GuiceResteasyBootstrapServletContextListener; //导入依赖的package包/类
public ServerRuntime(Options options,
                     GuiceResteasyBootstrapServletContextListener resteasyContextListener,
                     SwaggerServletContextListener swaggerContextListener,
                     HttpServletDispatcher httpServletDispatcher,
                     SecurityHandler securityHandler,
                     @Named("system.environment") String environment,
                     @Named("systemRuntime.resourceDir") String resourceDir) {
    this.options = options;
    this.resteasyContextListener = resteasyContextListener;
    this.swaggerContextListener = swaggerContextListener;
    this.httpServletDispatcher = httpServletDispatcher;
    this.securityHandler = securityHandler;
    this.environment = environment;
    this.resourceDir = resourceDir;
    RegisterBuiltin.register(ResteasyProviderFactory.getInstance());
}
 
开发者ID:labsai,项目名称:EDDI,代码行数:17,代码来源:ServerRuntime.java

示例4: main

import org.jboss.resteasy.plugins.guice.GuiceResteasyBootstrapServletContextListener; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
    Injector injector = Guice.createInjector(new HelloModule(args));

    injector.getAllBindings();

    injector.createChildInjector().getAllBindings();

    Server server = new Server(8080);
    ServletContextHandler servletHandler = new ServletContextHandler();
    servletHandler.addEventListener(injector.getInstance(GuiceResteasyBootstrapServletContextListener.class));

    ServletHolder sh = new ServletHolder(HttpServletDispatcher.class);
    servletHandler.setInitParameter("resteasy.role.based.security", "true");
    servletHandler.addFilter(new FilterHolder(injector.getInstance(HelloFilter.class)), "/*", null);
    //servletHandler.addServlet(DefaultServlet.class, "/*");
    servletHandler.addServlet(sh, "/*");

    server.setHandler(servletHandler);
    server.start();
    server.join();
}
 
开发者ID:szymex,项目名称:Embedded-Jetty-RESTEasy-Guice-Example,代码行数:22,代码来源:Main.java

示例5: configure

import org.jboss.resteasy.plugins.guice.GuiceResteasyBootstrapServletContextListener; //导入依赖的package包/类
@Override
public void configure() {
    binder().requireExplicitBindings();
    bind(GuiceResteasyBootstrapServletContextListener.class).in(Scopes.SINGLETON);

    bind(ObjectMapper.class).toProvider(this::customMapper).asEagerSingleton();

    bind(GuiceFilter.class);
    bind(HttpServletDispatcher.class).in(Scopes.SINGLETON);

    install(new HealthModule());
}
 
开发者ID:benhardy,项目名称:lilrest,代码行数:13,代码来源:JaxRsServerModule.java

示例6: servletContext

import org.jboss.resteasy.plugins.guice.GuiceResteasyBootstrapServletContextListener; //导入依赖的package包/类
@Provides
public ServletContextHandler servletContext(GuiceResteasyBootstrapServletContextListener resteasyListener,
                                            GuiceFilter guiceFilter,
                                            GuiceServletContextListener guiceServletContextListener) {
    final FilterHolder guiceFilterHolder = new FilterHolder(guiceFilter);
    final ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
    context.addFilter(guiceFilterHolder, "/*", EnumSet.allOf(DispatcherType.class));
    context.addEventListener(resteasyListener);
    context.addEventListener(guiceServletContextListener);
    return context;
}
 
开发者ID:benhardy,项目名称:lilrest,代码行数:12,代码来源:JaxRsServerModule.java

示例7: setUp

import org.jboss.resteasy.plugins.guice.GuiceResteasyBootstrapServletContextListener; //导入依赖的package包/类
@Before
public void setUp() throws Exception {

    server = new Server(8080);
    ServletContextHandler servletHandler = new ServletContextHandler();
    servletHandler.addEventListener(Guice.createInjector(new TestModule()).getInstance((GuiceResteasyBootstrapServletContextListener.class)));
    servletHandler.addServlet(HttpServletDispatcher.class, "/*");

    server.setHandler(servletHandler);
    server.start();
}
 
开发者ID:szymex,项目名称:Embedded-Jetty-RESTEasy-Guice-Example,代码行数:12,代码来源:JettyGuiceRestEasyTest.java

示例8: ApiServer

import org.jboss.resteasy.plugins.guice.GuiceResteasyBootstrapServletContextListener; //导入依赖的package包/类
@Inject
public ApiServer(@Named("api.server.port") String port, GuiceResteasyBootstrapServletContextListener listener) {
  this.port = Integer.parseInt(port);
  this.listener = listener;
}
 
开发者ID:mnemonic-no,项目名称:act-platform,代码行数:6,代码来源:ApiServer.java

示例9: provideServerRuntime

import org.jboss.resteasy.plugins.guice.GuiceResteasyBootstrapServletContextListener; //导入依赖的package包/类
@Provides
@Singleton
public IServerRuntime provideServerRuntime(@Named("system.environment") String environment,
                                           @Named("systemRuntime.resourceDir") String resourceDir,
                                           @Named("webServer.applicationConfigurationClass") String applicationConfigurationClass,
                                           @Named("webServer.host") String host,
                                           @Named("webServer.httpPort") Integer httpPort,
                                           @Named("webServer.httpsPort") Integer httpsPort,
                                           @Named("webServer.keyStorePassword") String keyStorePassword,
                                           @Named("webServer.keyStorePath") String keyStorePath,
                                           @Named("webServer.defaultPath") String defaultPath,
                                           @Named("webServer.responseDelayInMillis") Long responseDelayInMillis,
                                           @Named("webServer.virtualHosts") String virtualHosts,
                                           @Named("webServer.useCrossSiteScriptingHeaderParam") Boolean useCrossSiteScriptingHeaderParam,
                                           @Named("webServer.idleTime") Long idleTime,
                                           @Named("webServer.outputBufferSize") Integer outputBufferSize,
                                           GuiceResteasyBootstrapServletContextListener contextListener,
                                           SwaggerServletContextListener swaggerContextListener,
                                           HttpServletDispatcher httpServletDispatcher,
                                           LoginService mongoLoginService) throws ClassNotFoundException {

    ServerRuntime.Options options = new ServerRuntime.Options();
    options.applicationConfiguration = Class.forName(applicationConfigurationClass);
    options.loginService = mongoLoginService;
    options.host = host;
    options.httpPort = httpPort;
    options.httpsPort = httpsPort;
    options.keyStorePassword = keyStorePassword;
    options.keyStorePath = StringUtilities.joinStrings(File.separator,
            System.getProperty("user.dir"), "resources",
            keyStorePath);
    options.defaultPath = defaultPath;
    options.responseDelayInMillis = responseDelayInMillis;
    options.virtualHosts = virtualHosts.split(";");
    options.useCrossSiteScripting = useCrossSiteScriptingHeaderParam;
    options.idleTime = idleTime;
    options.outputBufferSize = outputBufferSize;

    return new ServerRuntime(options, contextListener, swaggerContextListener, httpServletDispatcher,
            null, environment, resourceDir);
}
 
开发者ID:labsai,项目名称:EDDI,代码行数:42,代码来源:ServerRuntimeModule.java


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