Examples of retain()


Examples of io.netty.handler.codec.http.FullHttpRequest.retain()

    @Test
    public void invalidHttpMethod() throws Exception {
        final SockJsConfig config = SockJsConfig.withPrefix("/echo").build();
        final EmbeddedChannel ch = webSocketChannel(config);
        final FullHttpRequest request = new DefaultFullHttpRequest(HTTP_1_1, POST, "dummy");
        request.retain();
        ch.writeInbound(request);
        final HttpResponse response = decode(ch);
        assertThat(response.getStatus(), is(METHOD_NOT_ALLOWED));
        assertThat(response.headers().get(ALLOW), is(GET.toString()));
    }
View Full Code Here

Examples of io.netty.handler.codec.http.FullHttpRequest.retain()

    @Test
    public void nonUpgradeRequest() throws Exception {
        final SockJsConfig config = SockJsConfig.withPrefix("/echo").build();
        final EmbeddedChannel ch = webSocketChannel(config);
        final FullHttpRequest request = new DefaultFullHttpRequest(HTTP_1_1, GET, "/websocket");
        request.retain();
        ch.writeInbound(request);
        final FullHttpResponse response = decodeFullHttpResponse(ch);
        assertThat(response.getStatus(), is(BAD_REQUEST));
        assertThat(response.headers().get(CONTENT_TYPE), is(Transports.CONTENT_TYPE_PLAIN));
        assertThat(response.content().toString(CharsetUtil.UTF_8), equalTo("Can \"Upgrade\" only to \"WebSocket\"."));
View Full Code Here

Examples of io.netty.handler.codec.http.websocketx.BinaryWebSocketFrame.retain()

        ContinuationWebSocketFrame compressedFrame3 = new ContinuationWebSocketFrame(true,
                WebSocketExtension.RSV3, compressedPayload.slice(oneThird * 2,
                        compressedPayload.readableBytes() - oneThird * 2));

        // execute
        decoderChannel.writeInbound(compressedFrame1.retain());
        decoderChannel.writeInbound(compressedFrame2.retain());
        decoderChannel.writeInbound(compressedFrame3);
        BinaryWebSocketFrame uncompressedFrame1 = decoderChannel.readInbound();
        ContinuationWebSocketFrame uncompressedFrame2 = decoderChannel.readInbound();
        ContinuationWebSocketFrame uncompressedFrame3 = decoderChannel.readInbound();
View Full Code Here

Examples of io.netty.handler.codec.http.websocketx.TextWebSocketFrame.retain()

        }

        final WebSocketFrame frame = (WebSocketFrame) msg;
        if (frame instanceof TextWebSocketFrame) {
            final TextWebSocketFrame textFrame = (TextWebSocketFrame) frame;
            textFrame.retain();
            textFrames.offer(textFrame);
        } else if (frame instanceof CloseWebSocketFrame) {
            ch.close();
        }
    }
View Full Code Here

Examples of io.netty.handler.codec.http.websocketx.WebSocketFrame.retain()

        }

        // a close frame doesn't mean much here.  errors raised from closed channels will mark the host as dead
        final WebSocketFrame frame = (WebSocketFrame) msg;
        if (frame instanceof TextWebSocketFrame) {
            ctx.fireChannelRead(frame.retain(2));
        } else if (frame instanceof PongWebSocketFrame) {
        } else if (frame instanceof BinaryWebSocketFrame) {
            ctx.fireChannelRead(frame.retain(2));
        } else if (frame instanceof CloseWebSocketFrame)
            ch.close();
View Full Code Here

Examples of io.netty.handler.codec.http.websocketx.WebSocketFrame.retain()

        final WebSocketFrame frame = (WebSocketFrame) msg;
        if (frame instanceof TextWebSocketFrame) {
            ctx.fireChannelRead(frame.retain(2));
        } else if (frame instanceof PongWebSocketFrame) {
        } else if (frame instanceof BinaryWebSocketFrame) {
            ctx.fireChannelRead(frame.retain(2));
        } else if (frame instanceof CloseWebSocketFrame)
            ch.close();

    }
View Full Code Here

Examples of net.tomp2p.storage.AlternativeCompositeByteBuf.retain()

          public AlternativeCompositeByteBuf compDirectBuffer() {
            return buf;
          }
        });
   
    buf.retain();
    ChannelHandlerContext ctx = mockChannelHandlerContext(buf, m2);
    encoder.write(ctx, m1, null);
    Decoder decoder = new Decoder(new DSASignatureFactory());
    decoder.decode(ctx, buf, m1.recipient().createSocketTCP(), m1
        .sender().createSocketTCP());
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.config.TesterRepositoryServiceConfigurationImpl.retain()

      File configPath = repositoryServiceConfiguration.getContentPath();
      final String configFileName = repositoryServiceConfiguration.getConfigFileName();

      for (int i = 1; i <= 10; i++)
      {
         repositoryServiceConfiguration.retain();
      }

      String[] files = configPath.list(new FilenameFilter()
      {
         public boolean accept(File dir, String name)
View Full Code Here

Examples of org.exoplatform.services.jcr.impl.config.TesterRepositoryServiceConfigurationImpl.retain()

      File configPath = repositoryServiceConfiguration.getContentPath();
      final String configFileName = repositoryServiceConfiguration.getConfigFileName();

      for (int i = 1; i <= 10; i++)
      {
         repositoryServiceConfiguration.retain();
      }

      String[] files = configPath.list(new FilenameFilter()
      {
         public boolean accept(File dir, String name)
View Full Code Here

Examples of org.fusesource.mqtt.codec.PUBLISH.retain()

        } else {
            qoS = message.isPersistent() ? QoS.AT_MOST_ONCE : QoS.AT_LEAST_ONCE;
        }
        result.qos(qoS);
        if (message.getBooleanProperty(RetainedMessageSubscriptionRecoveryPolicy.RETAINED_PROPERTY)) {
            result.retain(true);
        }

        String topicName;
        synchronized (mqttTopicMap) {
            topicName = mqttTopicMap.get(message.getJMSDestination());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.