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


Java GrizzlyServerFactory类代码示例

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


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

示例1: main

import com.sun.jersey.api.container.grizzly.GrizzlyServerFactory; //导入依赖的package包/类
public static void main(String[] args) throws IOException {
  // TODO(markf): Eventually we'll figure out how to appropriately start and stop the server when
  // it's run in a production environment.   For now, just kill the process

  CmdLineParser cmdLineParser = new CmdLineParser(commandLineOptions);
  try {
    cmdLineParser.parseArgument(args);
  } catch (CmdLineException e) {
    LOG.severe(e.getMessage());
    cmdLineParser.printUsage(System.err);
    System.exit(1);
  }

  // Now that the command line options have been processed, we can create the buildExecutor.
  buildExecutor = new NonQueuingExecutor(commandLineOptions.maxSimultaneousBuilds);

  int port = commandLineOptions.port;
  SelectorThread threadSelector = GrizzlyServerFactory.create("http://localhost:" + port + "/");
  String hostAddress = InetAddress.getLocalHost().getHostAddress();
  LOG.info("App Inventor Build Server - Version: " + GitBuildId.getVersion());
  LOG.info("App Inventor Build Server - Git Fingerprint: " + GitBuildId.getFingerprint());
  LOG.info("Running at: http://" + hostAddress + ":" + port + "/buildserver");
  if (commandLineOptions.maxSimultaneousBuilds == 0) {
    LOG.info("Maximum simultanous builds = unlimited!");
  } else {
    LOG.info("Maximum simultanous builds = " + commandLineOptions.maxSimultaneousBuilds);
  }
  LOG.info("Visit: http://" + hostAddress + ":" + port +
    "/buildserver/health for server health");
  LOG.info("Visit: http://" + hostAddress + ":" + port +
    "/buildserver/vars for server values");
  LOG.info("Server running");
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:34,代码来源:BuildServer.java

示例2: getSelectorThread

import com.sun.jersey.api.container.grizzly.GrizzlyServerFactory; //导入依赖的package包/类
public static SelectorThread getSelectorThread(Class<?> applicationConfigClass,
		String testServerUri, int testServerPort,
		String testContextPath, String testServletPath, String[] springContextFiles, boolean enableJPA)
				throws IllegalArgumentException, IOException {
	final URI baseUri = UriBuilder.fromUri(testServerUri).port(testServerPort).build();
	
	final ServletAdapter adapter = initRestTestServletAdapter(applicationConfigClass, testServerPort,
			testContextPath, testServletPath, enableJPA);
	
	adapter.addContextParameter(ContextLoader.CONFIG_LOCATION_PARAM,
			StringUtils.arrayToCommaDelimitedString(springContextFiles));
	
	return GrizzlyServerFactory.create(baseUri, adapter);
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:15,代码来源:RestTestUtils.java


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