org.xnio.ChannelDestination Maven / Gradle / Ivy
Go to download
This artifact provides a single jar that contains all classes required to use remote EJB and JMS, including
all dependencies. It is intended for use by those not using maven, maven users should just import the EJB and
JMS BOM's instead (shaded JAR's cause lots of problems with maven, as it is very easy to inadvertently end up
with different versions on classes on the class path).
package org.xnio;
import java.nio.channels.Channel;
import org.xnio.channels.BoundChannel;
/**
* A channel destination. This is the inverse of {@code ChannelSource}; it is used to accept a single connection from a remote
* peer.
*
* @param the channel type
*
* @since 1.2
*/
public interface ChannelDestination {
/**
* Accept a connection. The bind listener will be called when the channel is bound; the open listener will be called
* when the connection is accepted. It is not guaranteed that the open listener will be called after the bind listener.
*
* @param openListener the listener which will be notified when the channel is open, or {@code null} for none
* @param bindListener the listener which will be notified when the channel is bound locally, or {@code null} for none
* @return the future connection
*/
IoFuture extends T> accept(ChannelListener super T> openListener, ChannelListener super BoundChannel> bindListener);
}