本文整理汇总了Java中org.glassfish.grizzly.GrizzlyFuture类的典型用法代码示例。如果您正苦于以下问题:Java GrizzlyFuture类的具体用法?Java GrizzlyFuture怎么用?Java GrizzlyFuture使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GrizzlyFuture类属于org.glassfish.grizzly包,在下文中一共展示了GrizzlyFuture类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: shutDown
import org.glassfish.grizzly.GrizzlyFuture; //导入依赖的package包/类
/**
* Gracefully stop REST service.
*/
@Override
protected void shutDown() throws Exception {
long traceId = LoggerHelpers.traceEnterWithContext(log, this.objectId, "shutDown");
try {
log.info("Stopping REST server listening on port: {}", this.restServerConfig.getPort());
final GrizzlyFuture<HttpServer> shutdown = httpServer.shutdown(30, TimeUnit.SECONDS);
log.info("Awaiting termination of REST server");
shutdown.get();
log.info("REST server terminated");
} finally {
LoggerHelpers.traceLeave(log, this.objectId, "shutDown", traceId);
}
}
示例2: shutdownAndAwait
import org.glassfish.grizzly.GrizzlyFuture; //导入依赖的package包/类
public void shutdownAndAwait(final long timeoutMillis) {
try {
logger.info("Shutting down REST server");
if (httpServer != null) {
final GrizzlyFuture<HttpServer> future = httpServer.shutdown(timeoutMillis, TimeUnit.MILLISECONDS);
future.get();
}
logger.info("Shutdown of REST server complete");
} catch (final Exception e) {
throw new IllegalStateException(e);
}
}
示例3: send
import org.glassfish.grizzly.GrizzlyFuture; //导入依赖的package包/类
@Override
public GrizzlyFuture<DataFrame> send(String data) {
sentData.add(data);
return new SafeFutureImpl<>();
}
示例4: sendPing
import org.glassfish.grizzly.GrizzlyFuture; //导入依赖的package包/类
@Override
public GrizzlyFuture<DataFrame> sendPing(byte[] data) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
示例5: sendPong
import org.glassfish.grizzly.GrizzlyFuture; //导入依赖的package包/类
@Override
public GrizzlyFuture<DataFrame> sendPong(byte[] data) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
示例6: stream
import org.glassfish.grizzly.GrizzlyFuture; //导入依赖的package包/类
@Override
public GrizzlyFuture<DataFrame> stream(boolean arg0, String arg1) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}