|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.asyncobjects.vats.Vat net.sf.asyncobjects.net.nio.NIOSelectorVat
public class NIOSelectorVat
This is a vat that uses NIO services provided by NIOSelectorRunner
.
The vat support detaching and ataching to such runners.
Currently detach is not supported for this vat.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class net.sf.asyncobjects.vats.Vat |
---|
Vat.VatState |
Field Summary |
---|
Fields inherited from class net.sf.asyncobjects.vats.Vat |
---|
attachmentLock, detach, state, stateLock, ticket |
Constructor Summary | |
---|---|
NIOSelectorVat(NIOSelectorRunner runner,
String name)
A constructor |
Method Summary | |
---|---|
void |
detachFromRunner(boolean waitForIt)
Detach from runner. |
SelectionKey |
registerChannel(SelectableChannel ch)
register channel with listener |
NIOSelectorRunner |
runner()
|
Promise<Void> |
waitAcceptable(SelectionKey key)
wait until socket will became acceptable |
Promise<Void> |
waitConnectable(SelectionKey key)
wait until socket will became ready to finish connection |
Promise<Void> |
waitReadable(SelectionKey key)
wait until socket will became readable |
Promise<Void> |
waitWritable(SelectionKey key)
wait until socket will became writable |
Methods inherited from class net.sf.asyncobjects.vats.Vat |
---|
attachToRunner, current, dispatchEventBatch, dispatchVatEvents, enqueue, generateVatName, getName, getRunner, hasEvents, isDetached, offerSensor, resetCurrentVat, setCurrentVat |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NIOSelectorVat(NIOSelectorRunner runner, String name)
runner
- a runnername
- a name of vatMethod Detail |
---|
public void detachFromRunner(boolean waitForIt) throws InterruptedException
Vat
detachFromRunner
in class Vat
waitForIt
- if true, the method does not returns until vat
InterruptedException
- operation was interrupted, detach process is possibly
incompleteVat.detachFromRunner(boolean)
public SelectionKey registerChannel(SelectableChannel ch) throws Exception
ch
- a channel used by component
Exception
- if there is IO problmepublic NIOSelectorRunner runner()
runner
in class Vat
Vat.runner()
public Promise<Void> waitAcceptable(SelectionKey key)
key
- to wait on
public Promise<Void> waitReadable(SelectionKey key)
key
- to wait on
public Promise<Void> waitWritable(SelectionKey key)
key
- to wait on
public Promise<Void> waitConnectable(SelectionKey key)
key
- to wait on
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |