Interface ChannelManager
-
public interface ChannelManager
A manager handling custom payloads viaChannel
s to and fromEngineConnection
s.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Collection<Channel>
channels()
Gets an immutable collection of all the channels that are registered.Optional<Channel>
get(ResourceKey channelKey)
Gets a channel binding if a channel exists for the given key.<C extends Channel>
CofType(ResourceKey channelKey, Class<C> channelType)
Gets aChannel
by the given channel key.
-
-
-
Method Detail
-
get
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, Class<C> channelType)
Gets aChannel
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 aIllegalStateException
is thrown.- Parameters:
channelKey
- The channel keychannelType
- The channel type- Returns:
- A new or existing channel binding
- Throws:
IllegalStateException
- if the existing channel is not of the given type
-
channels
Collection<Channel> channels()
Gets an immutable collection of all the channels that are registered.- Returns:
- The channels
-
-