Interface ChannelManager
public interface ChannelManager
A manager handling custom payloads via
Channels to and from
EngineConnections.-
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 aChannelby 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 aChannelby the given channel key. If the channel exists and it matches the given channel type, it is returned. If the channel doesn't match aIllegalStateExceptionis 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
-