IT. Expert System.

Android Reference

SelectableChannel


java.nio.channels

Class SelectableChannel

    • Constructor Detail

      • SelectableChannel

        protected SelectableChannel()
        Constructs a new SelectableChannel.
    • Method Detail

      • blockingLock

        public abstract Object blockingLock()
        Gets the blocking lock which synchronizes the configureBlocking and register methods.
        Returns:
        the blocking object as lock.
      • configureBlocking

        public abstract SelectableChannel configureBlocking(boolean block)
                                                     throws IOException
        Sets the blocking mode of this channel. A call to this method blocks if other calls to this method or to a register method are executing. The new blocking mode is valid for calls to other methods that are invoked after the call to this method. If other methods are already executing when this method is called, they still have the old mode and the call to this method might block depending on the implementation.
        Parameters:
        block - true for setting this channel's mode to blocking, false to set it to non-blocking.
        Returns:
        this channel.
        Throws:
        ClosedChannelException - if this channel is closed.
        IllegalBlockingModeException - if block is true and this channel has been registered with at least one selector.
        IOException - if an I/O error occurs.
      • isBlocking

        public abstract boolean isBlocking()
        Indicates whether this channel is in blocking mode.
        Returns:
        true if this channel is blocking, undefined if this channel is closed.
      • isRegistered

        public abstract boolean isRegistered()
        Indicates whether this channel is registered with at least one selector.
        Returns:
        true if this channel is registered, false otherwise.
      • keyFor

        public abstract SelectionKey keyFor(Selector sel)
        Gets this channel's selection key for the specified selector.
        Parameters:
        sel - the selector with which this channel has been registered.
        Returns:
        the selection key for the channel or null if this channel has not been registered with sel.
      • provider

        public abstract SelectorProvider provider()
        Gets the provider of this channel.
        Returns:
        the provider of this channel.
      • register

        public final SelectionKey register(Selector selector,
                            int operations)
                                    throws ClosedChannelException
        Registers this channel with the specified selector for the specified interest set. If the channel is already registered with the selector, the corresponding selection key is returned but the interest set is updated to operations. The returned key is canceled if the channel is closed while registering is in progress.

        Calling this method is valid at any time. If another thread executes this method or the configureBlocking(boolean method then this call is blocked until the other call finishes. After that, it will synchronize on the key set of the selector and thus may again block if other threads also hold locks on the key set of the same selector.

        Calling this method is equivalent to calling register(selector, operations, null).

        Parameters:
        selector - the selector with which to register this channel.
        operations - this channel's interest set.
        Returns:
        the selection key for this registration.
        Throws:
        ClosedChannelException - if the channel is closed.
        IllegalBlockingModeException - if the channel is in blocking mode.
        IllegalSelectorException - if this channel does not have the same provider as the given selector.
        CancelledKeyException - if this channel is registered but its key has been canceled.
        IllegalArgumentException - if the operation given is not supported by this channel.
      • register

        public abstract SelectionKey register(Selector sel,
                            int ops,
                            Object att)
                                       throws ClosedChannelException
        Registers this channel with the specified selector for the specified interest set and an object to attach. If the channel is already registered with the selector, the corresponding selection key is returned but its interest set is updated to ops and the attached object is updated to att. The returned key is canceled if the channel is closed while registering is in progress.

        Calling this method is valid at any time. If another thread executes this method or the configureBlocking(boolean) method then this call is blocked until the other call finishes. After that, it will synchronize on the key set of the selector and thus may again block if other threads also hold locks on the key set of the same selector.

        Parameters:
        sel - the selector with which to register this channel.
        ops - this channel's interest set.
        att - the object to attach, can be null.
        Returns:
        the selection key for this registration.
        Throws:
        ClosedChannelException - if this channel is closed.
        IllegalArgumentException - if ops is not supported by this channel.
        IllegalBlockingModeException - if this channel is in blocking mode.
        IllegalSelectorException - if this channel does not have the same provider as the given selector.
        CancelledKeyException - if this channel is registered but its key has been canceled.
      • validOps

        public abstract int validOps()
        Gets the set of valid operations of this channel. Instances of a concrete channel class always return the same value.
        Returns:
        the set of operations that this channel supports.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 3277 / . Delta: 0.02135 с