org.entityfs.util.nio
Class LockAwareReadableByteChannel

java.lang.Object
  extended by org.entityfs.support.lang.ObjectProxySupport<T>
      extended by org.entityfs.support.io.ChannelProxy<T>
          extended by org.entityfs.support.io.ReadableByteChannelProxy<ReadableByteChannel>
              extended by org.entityfs.util.nio.LockAwareReadableByteChannel
All Implemented Interfaces:
Closeable, Channel, ReadableByteChannel

public class LockAwareReadableByteChannel
extends ReadableByteChannelProxy<ReadableByteChannel>


Constructor Summary
LockAwareReadableByteChannel(ReadableByteChannel proxied, EntityLock lock)
           
 
Method Summary
 void close()
          This will unlock the write lock if it is still locked by the current thread.
 int read(ByteBuffer src)
           
 
Methods inherited from class org.entityfs.support.io.ChannelProxy
isOpen
 
Methods inherited from class org.entityfs.support.lang.ObjectProxySupport
equals, getProxied, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.nio.channels.Channel
isOpen
 

Constructor Detail

LockAwareReadableByteChannel

public LockAwareReadableByteChannel(ReadableByteChannel proxied,
                                    EntityLock lock)
Method Detail

close

public void close()
           throws IOException
This will unlock the write lock if it is still locked by the current thread.

Specified by:
close in interface Closeable
Specified by:
close in interface Channel
Overrides:
close in class ChannelProxy<ReadableByteChannel>
Throws:
IOException

read

public int read(ByteBuffer src)
         throws IOException
Specified by:
read in interface ReadableByteChannel
Overrides:
read in class ReadableByteChannelProxy<ReadableByteChannel>
Throws:
IOException