|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.activeio.FilterSyncChannel
org.activeio.filter.SynchornizedSyncChannel
public class SynchornizedSyncChannel
Used to synchronize concurrent access to a SynchChannel.
Uses two different Sync objects
for write and read operations. All other operations such as stop(long)
and stop(long) just do a normal java synchronization against the SynchornizedSynchChannel
object instance.
| Field Summary |
|---|
| Fields inherited from interface org.activeio.Service |
|---|
NO_WAIT_TIMEOUT, WAIT_FOREVER_TIMEOUT |
| Fields inherited from interface org.activeio.Service |
|---|
NO_WAIT_TIMEOUT, WAIT_FOREVER_TIMEOUT |
| Constructor Summary | |
|---|---|
SynchornizedSyncChannel(SyncChannel next)
|
|
SynchornizedSyncChannel(SyncChannel next,
Sync readLock,
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 |
getReadLock()
|
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. |
Packet |
read(long timeout)
Used to synchronously receive a packet of information going 'up' the channel. |
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.FilterSyncChannel |
|---|
getNext, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SynchornizedSyncChannel(SyncChannel next)
public SynchornizedSyncChannel(SyncChannel next,
Sync readLock,
Sync writeLock)
| Method Detail |
|---|
public Packet read(long timeout)
throws IOException
InputSyncChannel
read in interface InputSyncChannelread in class FilterSyncChannelIOExceptionInputSyncChannel.read(long)
public void write(Packet packet)
throws IOException
OutputChannel
write in interface OutputChannelwrite in class FilterSyncChannelIOExceptionorg.activeio.Channel#write(org.activeio.Packet)
public void flush()
throws IOException
OutputChannel
flush in interface OutputChannelflush in class FilterSyncChannelIOExceptionorg.activeio.Channel#flush()public void dispose()
Disposable
dispose in interface Disposabledispose in class FilterSyncChannelDisposable.dispose()public Object narrow(Class target)
Channel
narrow in interface Channelnarrow in class FilterSyncChannel
public void start()
throws IOException
Service
start in interface Servicestart in class FilterSyncChannelIOExceptionService.start()
public void stop(long timeout)
throws IOException
Service
stop in interface Servicestop in class FilterSyncChanneltimeout - The amount of time the channel is allowed to take to gracefully stop. If the timeout
is exceeded, the channel should do a forcefull stop.
IOExceptionService.stop(long)public Sync getReadLock()
public Sync getWriteLock()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||