|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.activeio.FilterAsyncChannel
org.activeio.filter.SynchornizedAsyncChannel
Used to synchronize concurrent access to an ASynchChannel.
Uses a Sync
object
for write operations. All other operations such as stop(long)
and stop(long)
just do a normal java synchronization against the SynchornizedSynchChannel
object instance. It is assumed that the Async message delivery is not
concurrent and therefore does not require synchronization.
Field Summary |
Fields inherited from class org.activeio.FilterAsyncChannel |
channelListener, next |
Fields inherited from interface org.activeio.Service |
NO_WAIT_TIMEOUT, WAIT_FOREVER_TIMEOUT |
Constructor Summary | |
SynchornizedAsyncChannel(AsyncChannel next)
|
|
SynchornizedAsyncChannel(AsyncChannel next,
Sync writeLock)
|
Method Summary | |
void |
dispose()
This method should not throw any exceptions. |
void |
flush()
Some channels may buffer data which may be sent down if flush() is called. |
Sync |
getWriteLock()
|
Object |
narrow(Class target)
Since a Channel may be composed from a chain of other Channel obejcts, this method allows you to query the chain for the specified interface. |
void |
start()
Starts the channel. |
void |
stop(long timeout)
Stops the channel. |
void |
write(Packet packet)
Sends a packet down the channel towards the media. |
Methods inherited from class org.activeio.FilterAsyncChannel |
getAsyncChannelListener, getNext, onPacket, onPacketError, setAsyncChannelListener, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SynchornizedAsyncChannel(AsyncChannel next)
public SynchornizedAsyncChannel(AsyncChannel next, Sync writeLock)
Method Detail |
public void write(Packet packet) throws IOException
OutputChannel
write
in interface OutputChannel
write
in class FilterAsyncChannel
IOException
public void flush() throws IOException
OutputChannel
flush
in interface OutputChannel
flush
in class FilterAsyncChannel
IOException
public void dispose()
Disposable
dispose
in interface Disposable
dispose
in class FilterAsyncChannel
Disposable.dispose()
public Object narrow(Class target)
Channel
narrow
in interface Channel
narrow
in class FilterAsyncChannel
public void start() throws IOException
Service
start
in interface Service
start
in class FilterAsyncChannel
IOException
- if the next channel has not been set.Service.start()
public void stop(long timeout) throws IOException
Service
stop
in interface Service
stop
in class FilterAsyncChannel
IOException
Service.stop(long)
public Sync getWriteLock()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |