Examples of unsafe()


Examples of io.netty.channel.Channel.unsafe()

    final ChannelFuture initAndRegister() {
        final Channel channel = channelFactory().newChannel();
        try {
            init(channel);
        } catch (Throwable t) {
            channel.unsafe().closeForcibly();
            // as the Channel is not registered yet we need to force the usage of the GlobalEventExecutor
            return new DefaultChannelPromise(channel, GlobalEventExecutor.INSTANCE).setFailure(t);
        }

        ChannelFuture regFuture = group().register(channel);
View Full Code Here

Examples of io.netty.channel.Channel.unsafe()

        ChannelFuture regFuture = group().register(channel);
        if (regFuture.cause() != null) {
            if (channel.isRegistered()) {
                channel.close();
            } else {
                channel.unsafe().closeForcibly();
            }
        }

        // If we are here and the promise is not failed, it's one of the following cases:
        // 1) If we attempted registration from the event loop, the registration has been completed at this point.
View Full Code Here

Examples of io.netty.channel.Channel.unsafe()

    final ChannelFuture initAndRegister() {
        final Channel channel = channelFactory().newChannel();
        try {
            init(channel);
        } catch (Throwable t) {
            channel.unsafe().closeForcibly();
            return channel.newFailedFuture(t);
        }

        ChannelPromise regPromise = channel.newPromise();
        group().register(channel, regPromise);
View Full Code Here

Examples of io.netty.channel.Channel.unsafe()

        group().register(channel, regPromise);
        if (regPromise.cause() != null) {
            if (channel.isRegistered()) {
                channel.close();
            } else {
                channel.unsafe().closeForcibly();
            }
        }

        // If we are here and the promise is not failed, it's one of the following cases:
        // 1) If we attempted registration from the event loop, the registration has been completed at this point.
View Full Code Here

Examples of io.netty.channel.Channel.unsafe()

                }

                try {
                    childGroup.register(child);
                } catch (Throwable t) {
                    child.unsafe().closeForcibly();
                    logger.warn("Failed to register an accepted channel: " + child, t);
                }
            }
        }
View Full Code Here

Examples of io.netty.channel.embedded.EmbeddedChannel.unsafe()

        // Ensure exceeding the low watermark does not make channel unwritable.
        ch.write(buffer().writeZero(128));
        assertThat(buf.toString(), is(""));

        ch.unsafe().outboundBuffer().addFlush();

        // Ensure exceeding the high watermark makes channel unwritable.
        ch.write(buffer().writeZero(128));
        assertThat(buf.toString(), is("false "));
View Full Code Here

Examples of io.netty.channel.local.LocalChannel.unsafe()

        loopA.execute(NOOP);
        loopB.execute(NOOP);

        LocalChannel channel = new LocalChannel();
        ChannelPromise registerPromise = channel.newPromise();
        channel.unsafe().register(loopA, registerPromise);
        registerPromise.sync();

        for (int i = 0; i < numtasks; i++) {
            Queue<Long> timestamps = new LinkedBlockingQueue<Long>();
            timestampsPerTask.add(timestamps);
View Full Code Here

Examples of org.infinispan.config.FluentConfiguration.unsafe()

      if (config.transaction().recovery().enabled()) {
         legacy.transaction().recovery().recoveryInfoCacheName(config.transaction().recovery().recoveryInfoCacheName());
      }

      legacy.unsafe().unreliableReturnValues(config.unsafe().unreliableReturnValues());

      if (config.versioning().enabled()) {
         legacy.versioning()
               .enable()
               .versioningScheme(config.versioning().scheme());
View Full Code Here

Examples of org.infinispan.config.FluentConfiguration.unsafe()

      if (config.transaction().recovery().enabled()) {
         legacy.transaction().recovery().recoveryInfoCacheName(config.transaction().recovery().recoveryInfoCacheName());
      }

      legacy.unsafe().unreliableReturnValues(config.unsafe().unreliableReturnValues());

      if (config.versioning().enabled()) {
         legacy.versioning()
               .enable()
               .versioningScheme(config.versioning().scheme());
View Full Code Here

Examples of org.infinispan.config.FluentConfiguration.unsafe()

     
      if (config.transaction().recovery().enabled()) {
         legacy.transaction().recovery().recoveryInfoCacheName(config.transaction().recovery().recoveryInfoCacheName());
      }
       
      legacy.unsafe().unreliableReturnValues(config.unsafe().unreliableReturnValues());

      if (config.versioning().enabled()) {
         legacy.versioning()
               .enable()
               .versioningScheme(config.versioning().scheme());
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.