本文整理汇总了Java中org.apache.zookeeper.server.jersey.ZooKeeperService类的典型用法代码示例。如果您正苦于以下问题:Java ZooKeeperService类的具体用法?Java ZooKeeperService怎么用?Java ZooKeeperService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ZooKeeperService类属于org.apache.zookeeper.server.jersey包,在下文中一共展示了ZooKeeperService类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: ZNodeResource
import org.apache.zookeeper.server.jersey.ZooKeeperService; //导入依赖的package包/类
public ZNodeResource(@DefaultValue("") @QueryParam("session") String session,
@Context UriInfo ui,
@Context HttpServletRequest request
)
throws IOException {
String contextPath = request.getContextPath();
if (contextPath.equals("")) {
contextPath = "/";
}
if (session.equals("")) {
session = null;
} else if (!ZooKeeperService.isConnected(contextPath, session)) {
throw new WebApplicationException(Response.status(
Response.Status.UNAUTHORIZED).build());
}
zk = ZooKeeperService.getClient(contextPath, session);
}
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:19,代码来源:ZNodeResource.java
示例2: keepAliveSession
import org.apache.zookeeper.server.jersey.ZooKeeperService; //导入依赖的package包/类
@PUT
@Produces( { MediaType.APPLICATION_JSON, "application/javascript",
MediaType.APPLICATION_XML })
@Consumes(MediaType.APPLICATION_OCTET_STREAM)
public Response keepAliveSession(@PathParam("session") String session,
@Context UriInfo ui, byte[] data) {
if (!ZooKeeperService.isConnected(contextPath, session)) {
throwNotFound(session, ui);
}
ZooKeeperService.resetTimer(contextPath, session);
return Response.status(Response.Status.OK).build();
}
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:15,代码来源:SessionsResource.java
示例3: deleteSession
import org.apache.zookeeper.server.jersey.ZooKeeperService; //导入依赖的package包/类
@DELETE
@Produces( { MediaType.APPLICATION_JSON, "application/javascript",
MediaType.APPLICATION_XML, MediaType.APPLICATION_OCTET_STREAM })
public void deleteSession(@PathParam("session") String session,
@Context UriInfo ui) {
ZooKeeperService.close(contextPath, session);
}
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:8,代码来源:SessionsResource.java
示例4: ZNodeResource
import org.apache.zookeeper.server.jersey.ZooKeeperService; //导入依赖的package包/类
public ZNodeResource(@Context UriInfo ui) throws IOException {
zk = ZooKeeperService.getClient(ui.getBaseUri().toString());
}
开发者ID:prodigeni,项目名称:zookeeper.dsc,代码行数:4,代码来源:ZNodeResource.java
注:本文中的org.apache.zookeeper.server.jersey.ZooKeeperService类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论