本文整理汇总了Java中com.sun.jersey.api.container.grizzly.GrizzlyWebContainerFactory类的典型用法代码示例。如果您正苦于以下问题:Java GrizzlyWebContainerFactory类的具体用法?Java GrizzlyWebContainerFactory怎么用?Java GrizzlyWebContainerFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GrizzlyWebContainerFactory类属于com.sun.jersey.api.container.grizzly包,在下文中一共展示了GrizzlyWebContainerFactory类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: runServer
import com.sun.jersey.api.container.grizzly.GrizzlyWebContainerFactory; //导入依赖的package包/类
private static void runServer(RefAppConfigurator configurator) throws IOException, InterruptedException {
URI baseUri = UriBuilder.fromUri("http://localhost/").port(configurator.getServerPort()).build();
Map<String, String> params = new HashMap<String, String>();
params.put("com.sun.jersey.config.property.packages", "com.comcast.xfinity.sirius.refapplication.endpoints");
SelectorThread thread = GrizzlyWebContainerFactory.create(baseUri, params);
System.out.println();
System.out.println("Server fired up, using akka over TCP. Akka address for this server:");
System.out.println(configurator.getAkkaPath());
System.out.println("Hit ctrl-c to quit.");
try {
while (true) {
// put the local thread to sleep, let grizzly do its thing
Thread.sleep(1000L);
}
} finally {
thread.stopEndpoint();
}
}
示例2: startServer
import com.sun.jersey.api.container.grizzly.GrizzlyWebContainerFactory; //导入依赖的package包/类
protected static SelectorThread startServer() throws IOException {
final Map<String, String> initParams = new HashMap<String, String>();
initParams.put("com.sun.jersey.config.property.packages",
"com.melon");
System.out.println("Starting grizzly...");
SelectorThread threadSelector = GrizzlyWebContainerFactory.create(BASE_URI, initParams);
return threadSelector;
}
示例3: startWebServices
import com.sun.jersey.api.container.grizzly.GrizzlyWebContainerFactory; //导入依赖的package包/类
public static void startWebServices(final String baseUri) throws IOException, IllegalArgumentException {
final Map<String, String> initParams = new HashMap<String, String>();
initParams.put("com.sun.jersey.config.property.packages", "org.caboclo.webservices");
System.out.println("Starting backup server on " + baseUri);
SelectorThread threadSelector = GrizzlyWebContainerFactory.create(baseUri, initParams);
System.in.read();
threadSelector.stopEndpoint();
System.exit(0);
}
示例4: startServer
import com.sun.jersey.api.container.grizzly.GrizzlyWebContainerFactory; //导入依赖的package包/类
private static SelectorThread startServer()
throws IllegalArgumentException, IOException {
// TODO Auto-generated method stub
Map<String, String> initParams = new HashMap<String, String>();
initParams.put("com.sun.jersey.config.property.packages",
"course.cloud.computing.rest");
SelectorThread factory = GrizzlyWebContainerFactory.create(BASE_URI, initParams);
return factory;
}
示例5: execute
import com.sun.jersey.api.container.grizzly.GrizzlyWebContainerFactory; //导入依赖的package包/类
public SelectorThread execute() throws IOException {
final Map<String, String> initParams = new HashMap<String, String>();
initParams.put("com.sun.jersey.config.property.packages",
"org.apache.zookeeper.server.jersey.resources");
System.out.println("Starting grizzly...");
SelectorThread threadSelector =
GrizzlyWebContainerFactory.create(baseUri, initParams);
return threadSelector;
}
示例6: start
import com.sun.jersey.api.container.grizzly.GrizzlyWebContainerFactory; //导入依赖的package包/类
/**
* Start the server on the BASE_URI using resources located in RESOURCE_PACKAGE
* @return true if the server started normally, false otherwise
*/
public static boolean start() {
final Map<String, String> initParams = new HashMap<String, String>();
initParams.put("com.sun.jersey.config.property.packages", RESOURCE_PACKAGE);
try {
threadSelector = GrizzlyWebContainerFactory.create(BASE_URI, initParams);
return true;
} catch (IOException e) {}
return false;
}