|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.activeio.FilterSynchChannel
org.activeio.filter.SynchornizedSynchChannel
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 |
| Constructor Summary | |
SynchornizedSynchChannel(SynchChannel next)
|
|
SynchornizedSynchChannel(SynchChannel next,
EDU.oswego.cs.dl.util.concurrent.Sync readLock,
EDU.oswego.cs.dl.util.concurrent.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. |
EDU.oswego.cs.dl.util.concurrent.Sync |
getReadLock()
|
EDU.oswego.cs.dl.util.concurrent.Sync |
getWriteLock()
|
java.lang.Object |
narrow(java.lang.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 synchonously 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.FilterSynchChannel |
getNext, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public SynchornizedSynchChannel(SynchChannel next)
public SynchornizedSynchChannel(SynchChannel next,
EDU.oswego.cs.dl.util.concurrent.Sync readLock,
EDU.oswego.cs.dl.util.concurrent.Sync writeLock)
| Method Detail |
public Packet read(long timeout)
throws java.io.IOException
InputSynchChannel
read in interface InputSynchChannelread in class FilterSynchChanneljava.io.IOExceptionInputSynchChannel.read(long)
public void write(Packet packet)
throws java.io.IOException
OutputChannel
write in interface OutputChannelwrite in class FilterSynchChanneljava.io.IOExceptionorg.activeio.Channel#write(org.activeio.channel.Packet)
public void flush()
throws java.io.IOException
OutputChannel
flush in interface OutputChannelflush in class FilterSynchChanneljava.io.IOExceptionorg.activeio.Channel#flush()public void dispose()
Disposable
dispose in interface Disposabledispose in class FilterSynchChannelDisposable.dispose()public java.lang.Object narrow(java.lang.Class target)
Channel
narrow in interface Channelnarrow in class FilterSynchChannel
public void start()
throws java.io.IOException
Service
start in interface Servicestart in class FilterSynchChanneljava.io.IOExceptionService.start()
public void stop(long timeout)
throws java.io.IOException
Service
stop in interface Servicestop in class FilterSynchChanneljava.io.IOExceptionService.stop(long)public EDU.oswego.cs.dl.util.concurrent.Sync getReadLock()
public EDU.oswego.cs.dl.util.concurrent.Sync getWriteLock()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||