Interface ChannelManager

    • Method Detail

      • get

        java.util.Optional<Channel> get​(ResourceKey channelKey)
        Gets a channel binding if a channel exists for the given key.
        Parameters:
        channelKey - The channel key
        Returns:
        The channel if it exists
      • ofType

        <C extends Channel> C ofType​(ResourceKey channelKey,
                                     java.lang.Class<C> channelType)
        Gets a Channel by the given channel key. If the channel exists and it matches the given channel type, it is returned. If the channel doesn't match a IllegalStateException is thrown.
        Parameters:
        channelKey - The channel key
        channelType - The channel type
        Returns:
        A new or existing channel binding
        Throws:
        java.lang.IllegalStateException - if the existing channel is not of the given type
      • channels

        java.util.Collection<Channel> channels()
        Gets an immutable collection of all the channels that are registered.
        Returns:
        The channels