Creates a new channel with the specified listener and delivery guarantee, binds it to the specified name, and returns it.
If the specified {@code listener} is {@code null}, then any messages sent on the returned channel by any client session will be automatically forwarded, unfiltered, to all channel members.
If the specified {@code listener} isnon- {@code null}, then when any client session sends a message on the returned channel, the specified listener's {@link ChannelListener#receivedMessage(Channel,ClientSession,ByteBuffer) receivedMessage} method is invoked with the channel, clientsession and the message. The specified listener is not invoked for messages that the server sends on the channel via the channel's {@link Channel#send send} method. If the specified{@code listener} is non-{@code null}, then it must also be {@link Serializable}.
Supplying a non- {@code null} listener (although not required) isstrongly suggested. A listener's {@code receivedMessage}method provides an opportunity for an application to intervene when a client sends a channel message, to perform access control, filtering, or take other application-specific action on such channel messages.
If a non- {@code null} listener is provided, it is stronglysuggested that a different listener instance be provided for each channel created, in order to reduce the possible contention on channel listeners.
Messages sent on the returned channel are delivered in a manner that satisfies the minimum requirements of the specified delivery guarantee.
@param name a name
@param listener a channel listener, or {@code null}
@param delivery a delivery guarantee
@return a new channel bound to the specified name
@throws IllegalArgumentException if the specified listener isnon- {@code null} and is not serializable
@throws ResourceUnavailableException if there are not enoughresources to create the channel
@throws NameExistsException if a channel is already bound tothe specified name
@throws TransactionException if the operation failed because ofa problem with the current transaction