Interface ChannelManager
public interface ChannelManager
A manager handling custom payloads via
Channel
s to and from
EngineConnection
s.-
Method Summary
Modifier and TypeMethodDescriptionchannels()
Gets an immutable collection of all the channels that are registered.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 Details
-
get
Gets a channel binding if a channel exists for the given key.- Parameters:
channelKey
- The channel key- Returns:
- The channel if it exists
-
ofType
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
-