com.liferay.portal.kernel.nio.intraband
Class BaseIntraband
java.lang.Object
com.liferay.portal.kernel.nio.intraband.BaseIntraband
- All Implemented Interfaces:
- Intraband
- Direct Known Subclasses:
- ExecutorIntraband, SelectorIntraband
public abstract class BaseIntraband
- extends Object
- implements Intraband
Method Summary |
protected void |
addResponseWaitingDatagram(Datagram requestDatagram)
|
protected void |
cleanUpTimeoutResponseWaitingDatagrams()
|
void |
close()
|
protected abstract void |
doSendDatagram(RegistrationReference registrationReference,
Datagram datagram)
|
protected Datagram |
doSendSyncDatagram(RegistrationReference registrationReference,
Datagram datagram,
long timeout)
|
protected void |
ensureOpen()
|
protected long |
generateSequenceId()
|
DatagramReceiveHandler[] |
getDatagramReceiveHandlers()
|
protected void |
handleReading(ScatteringByteChannel scatteringByteChannel,
ChannelContext channelContext)
|
protected boolean |
handleWriting(GatheringByteChannel gatheringByteChannel,
ChannelContext channelContext)
|
boolean |
isOpen()
|
DatagramReceiveHandler |
registerDatagramReceiveHandler(byte type,
DatagramReceiveHandler datagramReceiveHandler)
|
protected Datagram |
removeResponseWaitingDatagram(Datagram responseDatagram)
|
void |
sendDatagram(RegistrationReference registrationReference,
Datagram datagram)
|
|
sendDatagram(RegistrationReference registrationReference,
Datagram datagram,
A attachment,
EnumSet<CompletionHandler.CompletionType> completionTypes,
CompletionHandler<A> completionHandler)
|
|
sendDatagram(RegistrationReference registrationReference,
Datagram datagram,
A attachment,
EnumSet<CompletionHandler.CompletionType> completionTypes,
CompletionHandler<A> completionHandler,
long timeout,
TimeUnit timeUnit)
|
Datagram |
sendSyncDatagram(RegistrationReference registrationReference,
Datagram datagram)
|
Datagram |
sendSyncDatagram(RegistrationReference registrationReference,
Datagram datagram,
long timeout,
TimeUnit timeUnit)
|
DatagramReceiveHandler |
unregisterDatagramReceiveHandler(byte type)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
REPLIED_ENUM_SET
protected static final EnumSet<CompletionHandler.CompletionType> REPLIED_ENUM_SET
defaultTimeout
protected final long defaultTimeout
datagramReceiveHandlersReference
protected final AtomicReference<DatagramReceiveHandler[]> datagramReceiveHandlersReference
open
protected volatile boolean open
responseWaitingMap
protected final Map<Long,Datagram> responseWaitingMap
sequenceIdGenerator
protected final AtomicLong sequenceIdGenerator
timeoutMap
protected final NavigableMap<Long,Long> timeoutMap
BaseIntraband
public BaseIntraband(long defaultTimeout)
close
public void close()
throws InterruptedException,
IOException
- Specified by:
close
in interface Intraband
- Throws:
InterruptedException
IOException
getDatagramReceiveHandlers
public DatagramReceiveHandler[] getDatagramReceiveHandlers()
- Specified by:
getDatagramReceiveHandlers
in interface Intraband
isOpen
public boolean isOpen()
- Specified by:
isOpen
in interface Intraband
registerDatagramReceiveHandler
public DatagramReceiveHandler registerDatagramReceiveHandler(byte type,
DatagramReceiveHandler datagramReceiveHandler)
- Specified by:
registerDatagramReceiveHandler
in interface Intraband
sendDatagram
public void sendDatagram(RegistrationReference registrationReference,
Datagram datagram)
- Specified by:
sendDatagram
in interface Intraband
sendDatagram
public <A> void sendDatagram(RegistrationReference registrationReference,
Datagram datagram,
A attachment,
EnumSet<CompletionHandler.CompletionType> completionTypes,
CompletionHandler<A> completionHandler)
- Specified by:
sendDatagram
in interface Intraband
sendDatagram
public <A> void sendDatagram(RegistrationReference registrationReference,
Datagram datagram,
A attachment,
EnumSet<CompletionHandler.CompletionType> completionTypes,
CompletionHandler<A> completionHandler,
long timeout,
TimeUnit timeUnit)
- Specified by:
sendDatagram
in interface Intraband
sendSyncDatagram
public Datagram sendSyncDatagram(RegistrationReference registrationReference,
Datagram datagram)
throws InterruptedException,
IOException,
TimeoutException
- Specified by:
sendSyncDatagram
in interface Intraband
- Throws:
InterruptedException
IOException
TimeoutException
sendSyncDatagram
public Datagram sendSyncDatagram(RegistrationReference registrationReference,
Datagram datagram,
long timeout,
TimeUnit timeUnit)
throws InterruptedException,
IOException,
TimeoutException
- Specified by:
sendSyncDatagram
in interface Intraband
- Throws:
InterruptedException
IOException
TimeoutException
unregisterDatagramReceiveHandler
public DatagramReceiveHandler unregisterDatagramReceiveHandler(byte type)
- Specified by:
unregisterDatagramReceiveHandler
in interface Intraband
addResponseWaitingDatagram
protected void addResponseWaitingDatagram(Datagram requestDatagram)
cleanUpTimeoutResponseWaitingDatagrams
protected void cleanUpTimeoutResponseWaitingDatagrams()
doSendDatagram
protected abstract void doSendDatagram(RegistrationReference registrationReference,
Datagram datagram)
doSendSyncDatagram
protected Datagram doSendSyncDatagram(RegistrationReference registrationReference,
Datagram datagram,
long timeout)
throws InterruptedException,
IOException,
TimeoutException
- Throws:
InterruptedException
IOException
TimeoutException
ensureOpen
protected void ensureOpen()
generateSequenceId
protected long generateSequenceId()
handleReading
protected void handleReading(ScatteringByteChannel scatteringByteChannel,
ChannelContext channelContext)
handleWriting
protected boolean handleWriting(GatheringByteChannel gatheringByteChannel,
ChannelContext channelContext)
removeResponseWaitingDatagram
protected Datagram removeResponseWaitingDatagram(Datagram responseDatagram)