public abstract class BaseIntraband extends Object implements Intraband
| Modifier and Type | Class and Description |
|---|---|
protected static class |
BaseIntraband.SendSyncDatagramCompletionHandler |
| Modifier and Type | Field and Description |
|---|---|
protected AtomicReference<DatagramReceiveHandler[]> |
datagramReceiveHandlersReference |
protected long |
defaultTimeout |
protected boolean |
open |
protected static EnumSet<CompletionHandler.CompletionType> |
REPLIED_ENUM_SET |
protected Map<Long,Datagram> |
responseWaitingMap |
protected AtomicLong |
sequenceIdGenerator |
protected NavigableMap<Long,Long> |
timeoutMap |
| Constructor and Description |
|---|
BaseIntraband(long defaultTimeout) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitregisterChannel, registerChannelprotected static final EnumSet<CompletionHandler.CompletionType> REPLIED_ENUM_SET
protected final AtomicReference<DatagramReceiveHandler[]> datagramReceiveHandlersReference
protected final long defaultTimeout
protected volatile boolean open
protected final AtomicLong sequenceIdGenerator
protected final NavigableMap<Long,Long> timeoutMap
public void close()
throws InterruptedException,
IOException
close in interface IntrabandInterruptedExceptionIOExceptionpublic DatagramReceiveHandler[] getDatagramReceiveHandlers()
getDatagramReceiveHandlers in interface Intrabandpublic DatagramReceiveHandler registerDatagramReceiveHandler(byte type, DatagramReceiveHandler datagramReceiveHandler)
registerDatagramReceiveHandler in interface Intrabandpublic void sendDatagram(RegistrationReference registrationReference, Datagram datagram)
sendDatagram in interface Intrabandpublic <A> void sendDatagram(RegistrationReference registrationReference, Datagram datagram, A attachment, EnumSet<CompletionHandler.CompletionType> completionTypes, CompletionHandler<A> completionHandler)
sendDatagram in interface Intrabandpublic <A> void sendDatagram(RegistrationReference registrationReference, Datagram datagram, A attachment, EnumSet<CompletionHandler.CompletionType> completionTypes, CompletionHandler<A> completionHandler, long timeout, TimeUnit timeUnit)
sendDatagram in interface Intrabandpublic Datagram sendSyncDatagram(RegistrationReference registrationReference, Datagram datagram) throws InterruptedException, IOException, TimeoutException
sendSyncDatagram in interface IntrabandInterruptedExceptionIOExceptionTimeoutExceptionpublic Datagram sendSyncDatagram(RegistrationReference registrationReference, Datagram datagram, long timeout, TimeUnit timeUnit) throws InterruptedException, IOException, TimeoutException
sendSyncDatagram in interface IntrabandInterruptedExceptionIOExceptionTimeoutExceptionpublic DatagramReceiveHandler unregisterDatagramReceiveHandler(byte type)
unregisterDatagramReceiveHandler in interface Intrabandprotected void addResponseWaitingDatagram(Datagram requestDatagram)
protected void cleanUpTimeoutResponseWaitingDatagrams()
protected abstract void doSendDatagram(RegistrationReference registrationReference, Datagram datagram)
protected Datagram doSendSyncDatagram(RegistrationReference registrationReference, Datagram datagram, long timeout) throws InterruptedException, IOException, TimeoutException
protected void ensureOpen()
protected long generateSequenceId()
protected void handleReading(ScatteringByteChannel scatteringByteChannel, ChannelContext channelContext)
protected boolean handleWriting(GatheringByteChannel gatheringByteChannel, ChannelContext channelContext)