本文整理了Java中org.glassfish.grizzly.websockets.WebSocketHolder.get()
方法的一些代码示例,展示了WebSocketHolder.get()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebSocketHolder.get()
方法的具体详情如下:
包路径:org.glassfish.grizzly.websockets.WebSocketHolder
类名称:WebSocketHolder
方法名:get
暂无
代码示例来源:origin: javaee/grizzly
public static boolean isWebSocketInProgress(final Connection connection) {
return (get(connection) != null);
}
代码示例来源:origin: javaee/grizzly
public static boolean isWebSocketInProgress(final Connection connection) {
return (get(connection) != null);
}
代码示例来源:origin: javaee/grizzly
public static boolean isWebSocketInProgress(final Connection connection) {
return (get(connection) != null);
}
代码示例来源:origin: javaee/grizzly
public static boolean isWebSocketInProgress(final Connection connection) {
return (get(connection) != null);
}
代码示例来源:origin: javaee/grizzly
public static WebSocket getWebSocket(Connection connection) {
final WebSocketHolder holder = get(connection);
return holder == null ? null : holder.webSocket;
}
代码示例来源:origin: javaee/grizzly
public static WebSocket getWebSocket(Connection connection) {
final WebSocketHolder holder = get(connection);
return holder == null ? null : holder.webSocket;
}
代码示例来源:origin: javaee/grizzly
public static WebSocket getWebSocket(Connection connection) {
final WebSocketHolder holder = get(connection);
return holder == null ? null : holder.webSocket;
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server
public static WebSocket getWebSocket(Connection connection) {
final WebSocketHolder holder = get(connection);
return holder == null ? null : holder.webSocket;
}
代码示例来源:origin: javaee/grizzly
public static WebSocket getWebSocket(Connection connection) {
final WebSocketHolder holder = get(connection);
return holder == null ? null : holder.webSocket;
}
代码示例来源:origin: org.mule.glassfish.grizzly/grizzly-websockets
public static WebSocket getWebSocket(Connection connection) {
final WebSocketHolder holder = get(connection);
return holder == null ? null : holder.webSocket;
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server
public static boolean isWebSocketInProgress(final Connection connection) {
return (get(connection) != null);
}
代码示例来源:origin: org.mule.glassfish.grizzly/grizzly-websockets
public static boolean isWebSocketInProgress(final Connection connection) {
return (get(connection) != null);
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server
private static NextAction handleClientHandShake(FilterChainContext ctx, HttpContent content) {
final WebSocketHolder holder = WebSocketHolder.get(ctx.getConnection());
holder.handshake.validateServerResponse((HttpResponsePacket) content.getHttpHeader());
holder.webSocket.onConnect();
if (content.getContent().hasRemaining()) {
return ctx.getRerunFilterAction();
} else {
content.recycle();
return ctx.getStopAction();
}
}
}
代码示例来源:origin: javaee/grizzly
private static NextAction handleClientHandShake(FilterChainContext ctx, HttpContent content) {
final WebSocketHolder holder = WebSocketHolder.get(ctx.getConnection());
holder.handshake.validateServerResponse((HttpResponsePacket) content.getHttpHeader());
holder.webSocket.onConnect();
if (content.getContent().hasRemaining()) {
return ctx.getRerunFilterAction();
} else {
content.recycle();
return ctx.getStopAction();
}
}
}
代码示例来源:origin: javaee/grizzly
private static NextAction handleClientHandShake(FilterChainContext ctx, HttpContent content) {
final WebSocketHolder holder = WebSocketHolder.get(ctx.getConnection());
holder.handshake.validateServerResponse((HttpResponsePacket) content.getHttpHeader());
holder.webSocket.onConnect();
if (content.getContent().hasRemaining()) {
return ctx.getRerunFilterAction();
} else {
content.recycle();
return ctx.getStopAction();
}
}
}
代码示例来源:origin: javaee/grizzly
private static NextAction handleClientHandShake(FilterChainContext ctx, HttpContent content) {
final WebSocketHolder holder = WebSocketHolder.get(ctx.getConnection());
holder.handshake.validateServerResponse((HttpResponsePacket) content.getHttpHeader());
holder.webSocket.onConnect();
if (content.getContent().hasRemaining()) {
return ctx.getRerunFilterAction();
} else {
content.recycle();
return ctx.getStopAction();
}
}
}
代码示例来源:origin: javaee/grizzly
private static NextAction handleClientHandShake(FilterChainContext ctx, HttpContent content) {
final WebSocketHolder holder = WebSocketHolder.get(ctx.getConnection());
holder.handshake.validateServerResponse((HttpResponsePacket) content.getHttpHeader());
holder.webSocket.onConnect();
if (content.getContent().hasRemaining()) {
return ctx.getRerunFilterAction();
} else {
content.recycle();
return ctx.getStopAction();
}
}
}
代码示例来源:origin: org.mule.glassfish.grizzly/grizzly-websockets
private static NextAction handleClientHandShake(FilterChainContext ctx, HttpContent content) {
final WebSocketHolder holder = WebSocketHolder.get(ctx.getConnection());
holder.handshake.validateServerResponse((HttpResponsePacket) content.getHttpHeader());
holder.webSocket.onConnect();
if (content.getContent().hasRemaining()) {
return ctx.getRerunFilterAction();
} else {
content.recycle();
return ctx.getStopAction();
}
}
}
代码示例来源:origin: javaee/grizzly
/**
* Handle Grizzly {@link Connection} write phase. If the {@link Connection} has associated {@link WebSocket} object
* (websocket connection), we assume that message is websocket {@link DataFrame} and serialize it into a {@link
* Buffer}.
*
* @param ctx {@link FilterChainContext}
*
* @return {@link NextAction} instruction for {@link FilterChain}, how it should continue the execution
*
* @throws java.io.IOException
*/
@Override
public NextAction handleWrite(FilterChainContext ctx) throws IOException {
// get the associated websocket
final WebSocket websocket = getWebSocket(ctx.getConnection());
final Object msg = ctx.getMessage();
// if there is one
if (websocket != null && DataFrame.isDataFrame(msg)) {
final DataFrame frame = (DataFrame) msg;
final WebSocketHolder holder = WebSocketHolder.get(ctx.getConnection());
final Buffer wrap = Buffers.wrap(ctx.getMemoryManager(), holder.handler.frame(frame));
ctx.setMessage(wrap);
}
// invoke next filter in the chain
return ctx.getInvokeAction();
}
代码示例来源:origin: javaee/grizzly
/**
* Handle Grizzly {@link Connection} write phase. If the {@link Connection} has associated {@link WebSocket} object
* (websocket connection), we assume that message is websocket {@link DataFrame} and serialize it into a {@link
* Buffer}.
*
* @param ctx {@link FilterChainContext}
*
* @return {@link NextAction} instruction for {@link FilterChain}, how it should continue the execution
*
* @throws java.io.IOException
*/
@Override
public NextAction handleWrite(FilterChainContext ctx) throws IOException {
// get the associated websocket
final WebSocket websocket = getWebSocket(ctx.getConnection());
final Object msg = ctx.getMessage();
// if there is one
if (websocket != null && DataFrame.isDataFrame(msg)) {
final DataFrame frame = (DataFrame) msg;
final WebSocketHolder holder = WebSocketHolder.get(ctx.getConnection());
final Buffer wrap = Buffers.wrap(ctx.getMemoryManager(), holder.handler.frame(frame));
ctx.setMessage(wrap);
}
// invoke next filter in the chain
return ctx.getInvokeAction();
}
内容来源于网络,如有侵权,请联系作者删除!