Class ChannelStateException

  • All Implemented Interfaces:
    Serializable
    Direct Known Subclasses:
    ChannelClosedException

    public class ChannelStateException
    extends IOException
    Indicates invalid state of the channel during the operation. Exception stores the channel reference is a WeakReference, so the information may be deallocated at any moment. Former channel name can be retrieved via getChannelName(). The reference also will not be serialized.
    Since:
    3.15
    Author:
    Oleg Nenashev
    See Also:
    Serialized Form
    • Constructor Detail

      • ChannelStateException

        public ChannelStateException​(@CheckForNull
                                     Channel channel,
                                     @NonNull
                                     String message)
      • ChannelStateException

        public ChannelStateException​(@CheckForNull
                                     Channel channel,
                                     String message,
                                     @CheckForNull
                                     Throwable cause)
    • Method Detail

      • getChannelName

        @NonNull
        public String getChannelName()
        Gets channel name.
        Returns:
        Channel name ot unknown if it is not known.
      • getChannel

        @CheckForNull
        public Channel getChannel()
        Gets channel associated with the exception. The channel reference is a WeakReference, so the information may be deallocated at any moment. Former channel name can be retrieved via getChannelName(). The reference also will not be serialized.
        Returns:
        Channel reference if it is available. null otherwise.