本文整理汇总了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");
}
示例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);
}