org.entityfs.util.nio
Class LockAwareWritableByteChannel

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.WritableByteChannelProxy<WritableByteChannel>
              extended by org.entityfs.util.nio.LockAwareWritableByteChannel
All Implemented Interfaces:
Closeable, Channel, WritableByteChannel

public class LockAwareWritableByteChannel
extends WritableByteChannelProxy<WritableByteChannel>


Constructor Summary
LockAwareWritableByteChannel(WritableByteChannel gbc, EntityLock lock)
           
 
Method Summary
 void close()
          This will unlock the write lock if it is still locked by the current thread.
 int write(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

LockAwareWritableByteChannel

public LockAwareWritableByteChannel(WritableByteChannel gbc,
                                    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<WritableByteChannel>
Throws:
IOException

write

public int write(ByteBuffer src)
          throws IOException
Specified by:
write in interface WritableByteChannel
Overrides:
write in class WritableByteChannelProxy<WritableByteChannel>
Throws:
IOException