org.glassfish.grizzly.websockets.WebSocketHolder.get()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(6.7k)|赞(0)|评价(0)|浏览(126)

本文整理了Java中org.glassfish.grizzly.websockets.WebSocketHolder.get()方法的一些代码示例,展示了WebSocketHolder.get()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebSocketHolder.get()方法的具体详情如下:
包路径:org.glassfish.grizzly.websockets.WebSocketHolder
类名称:WebSocketHolder
方法名:get

WebSocketHolder.get介绍

暂无

代码示例

代码示例来源:origin: javaee/grizzly

  1. public static boolean isWebSocketInProgress(final Connection connection) {
  2. return (get(connection) != null);
  3. }

代码示例来源:origin: javaee/grizzly

  1. public static boolean isWebSocketInProgress(final Connection connection) {
  2. return (get(connection) != null);
  3. }

代码示例来源:origin: javaee/grizzly

  1. public static boolean isWebSocketInProgress(final Connection connection) {
  2. return (get(connection) != null);
  3. }

代码示例来源:origin: javaee/grizzly

  1. public static boolean isWebSocketInProgress(final Connection connection) {
  2. return (get(connection) != null);
  3. }

代码示例来源:origin: javaee/grizzly

  1. public static WebSocket getWebSocket(Connection connection) {
  2. final WebSocketHolder holder = get(connection);
  3. return holder == null ? null : holder.webSocket;
  4. }

代码示例来源:origin: javaee/grizzly

  1. public static WebSocket getWebSocket(Connection connection) {
  2. final WebSocketHolder holder = get(connection);
  3. return holder == null ? null : holder.webSocket;
  4. }

代码示例来源:origin: javaee/grizzly

  1. public static WebSocket getWebSocket(Connection connection) {
  2. final WebSocketHolder holder = get(connection);
  3. return holder == null ? null : holder.webSocket;
  4. }

代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server

  1. public static WebSocket getWebSocket(Connection connection) {
  2. final WebSocketHolder holder = get(connection);
  3. return holder == null ? null : holder.webSocket;
  4. }

代码示例来源:origin: javaee/grizzly

  1. public static WebSocket getWebSocket(Connection connection) {
  2. final WebSocketHolder holder = get(connection);
  3. return holder == null ? null : holder.webSocket;
  4. }

代码示例来源:origin: org.mule.glassfish.grizzly/grizzly-websockets

  1. public static WebSocket getWebSocket(Connection connection) {
  2. final WebSocketHolder holder = get(connection);
  3. return holder == null ? null : holder.webSocket;
  4. }

代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server

  1. public static boolean isWebSocketInProgress(final Connection connection) {
  2. return (get(connection) != null);
  3. }

代码示例来源:origin: org.mule.glassfish.grizzly/grizzly-websockets

  1. public static boolean isWebSocketInProgress(final Connection connection) {
  2. return (get(connection) != null);
  3. }

代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server

  1. private static NextAction handleClientHandShake(FilterChainContext ctx, HttpContent content) {
  2. final WebSocketHolder holder = WebSocketHolder.get(ctx.getConnection());
  3. holder.handshake.validateServerResponse((HttpResponsePacket) content.getHttpHeader());
  4. holder.webSocket.onConnect();
  5. if (content.getContent().hasRemaining()) {
  6. return ctx.getRerunFilterAction();
  7. } else {
  8. content.recycle();
  9. return ctx.getStopAction();
  10. }
  11. }
  12. }

代码示例来源:origin: javaee/grizzly

  1. private static NextAction handleClientHandShake(FilterChainContext ctx, HttpContent content) {
  2. final WebSocketHolder holder = WebSocketHolder.get(ctx.getConnection());
  3. holder.handshake.validateServerResponse((HttpResponsePacket) content.getHttpHeader());
  4. holder.webSocket.onConnect();
  5. if (content.getContent().hasRemaining()) {
  6. return ctx.getRerunFilterAction();
  7. } else {
  8. content.recycle();
  9. return ctx.getStopAction();
  10. }
  11. }
  12. }

代码示例来源:origin: javaee/grizzly

  1. private static NextAction handleClientHandShake(FilterChainContext ctx, HttpContent content) {
  2. final WebSocketHolder holder = WebSocketHolder.get(ctx.getConnection());
  3. holder.handshake.validateServerResponse((HttpResponsePacket) content.getHttpHeader());
  4. holder.webSocket.onConnect();
  5. if (content.getContent().hasRemaining()) {
  6. return ctx.getRerunFilterAction();
  7. } else {
  8. content.recycle();
  9. return ctx.getStopAction();
  10. }
  11. }
  12. }

代码示例来源:origin: javaee/grizzly

  1. private static NextAction handleClientHandShake(FilterChainContext ctx, HttpContent content) {
  2. final WebSocketHolder holder = WebSocketHolder.get(ctx.getConnection());
  3. holder.handshake.validateServerResponse((HttpResponsePacket) content.getHttpHeader());
  4. holder.webSocket.onConnect();
  5. if (content.getContent().hasRemaining()) {
  6. return ctx.getRerunFilterAction();
  7. } else {
  8. content.recycle();
  9. return ctx.getStopAction();
  10. }
  11. }
  12. }

代码示例来源:origin: javaee/grizzly

  1. private static NextAction handleClientHandShake(FilterChainContext ctx, HttpContent content) {
  2. final WebSocketHolder holder = WebSocketHolder.get(ctx.getConnection());
  3. holder.handshake.validateServerResponse((HttpResponsePacket) content.getHttpHeader());
  4. holder.webSocket.onConnect();
  5. if (content.getContent().hasRemaining()) {
  6. return ctx.getRerunFilterAction();
  7. } else {
  8. content.recycle();
  9. return ctx.getStopAction();
  10. }
  11. }
  12. }

代码示例来源:origin: org.mule.glassfish.grizzly/grizzly-websockets

  1. private static NextAction handleClientHandShake(FilterChainContext ctx, HttpContent content) {
  2. final WebSocketHolder holder = WebSocketHolder.get(ctx.getConnection());
  3. holder.handshake.validateServerResponse((HttpResponsePacket) content.getHttpHeader());
  4. holder.webSocket.onConnect();
  5. if (content.getContent().hasRemaining()) {
  6. return ctx.getRerunFilterAction();
  7. } else {
  8. content.recycle();
  9. return ctx.getStopAction();
  10. }
  11. }
  12. }

代码示例来源:origin: javaee/grizzly

  1. /**
  2. * Handle Grizzly {@link Connection} write phase. If the {@link Connection} has associated {@link WebSocket} object
  3. * (websocket connection), we assume that message is websocket {@link DataFrame} and serialize it into a {@link
  4. * Buffer}.
  5. *
  6. * @param ctx {@link FilterChainContext}
  7. *
  8. * @return {@link NextAction} instruction for {@link FilterChain}, how it should continue the execution
  9. *
  10. * @throws java.io.IOException
  11. */
  12. @Override
  13. public NextAction handleWrite(FilterChainContext ctx) throws IOException {
  14. // get the associated websocket
  15. final WebSocket websocket = getWebSocket(ctx.getConnection());
  16. final Object msg = ctx.getMessage();
  17. // if there is one
  18. if (websocket != null && DataFrame.isDataFrame(msg)) {
  19. final DataFrame frame = (DataFrame) msg;
  20. final WebSocketHolder holder = WebSocketHolder.get(ctx.getConnection());
  21. final Buffer wrap = Buffers.wrap(ctx.getMemoryManager(), holder.handler.frame(frame));
  22. ctx.setMessage(wrap);
  23. }
  24. // invoke next filter in the chain
  25. return ctx.getInvokeAction();
  26. }

代码示例来源:origin: javaee/grizzly

  1. /**
  2. * Handle Grizzly {@link Connection} write phase. If the {@link Connection} has associated {@link WebSocket} object
  3. * (websocket connection), we assume that message is websocket {@link DataFrame} and serialize it into a {@link
  4. * Buffer}.
  5. *
  6. * @param ctx {@link FilterChainContext}
  7. *
  8. * @return {@link NextAction} instruction for {@link FilterChain}, how it should continue the execution
  9. *
  10. * @throws java.io.IOException
  11. */
  12. @Override
  13. public NextAction handleWrite(FilterChainContext ctx) throws IOException {
  14. // get the associated websocket
  15. final WebSocket websocket = getWebSocket(ctx.getConnection());
  16. final Object msg = ctx.getMessage();
  17. // if there is one
  18. if (websocket != null && DataFrame.isDataFrame(msg)) {
  19. final DataFrame frame = (DataFrame) msg;
  20. final WebSocketHolder holder = WebSocketHolder.get(ctx.getConnection());
  21. final Buffer wrap = Buffers.wrap(ctx.getMemoryManager(), holder.handler.frame(frame));
  22. ctx.setMessage(wrap);
  23. }
  24. // invoke next filter in the chain
  25. return ctx.getInvokeAction();
  26. }

相关文章