com.sleepycat.je.rep.utilint
Class NamedChannel
java.lang.Object
com.sleepycat.je.rep.utilint.NamedChannel
- All Implemented Interfaces:
- Closeable, ByteChannel, Channel, ReadableByteChannel, WritableByteChannel
- Direct Known Subclasses:
- NamedChannelWithTimeout
public class NamedChannel
- extends Object
- implements ByteChannel
Packages a SocketChannel and a NameIdPair together so that logging
messages can show the node name instead of the channel toString();
channel
protected final SocketChannel channel
NamedChannel
public NamedChannel(SocketChannel channel,
NameIdPair nameIdPair)
NamedChannel
public NamedChannel(SocketChannel channel)
setNameIdPair
public void setNameIdPair(NameIdPair nameIdPair)
getNameIdPair
public NameIdPair getNameIdPair()
getChannel
public SocketChannel getChannel()
toString
public String toString()
- Overrides:
toString
in class Object
read
public int read(ByteBuffer dst)
throws IOException
- Specified by:
read
in interface ReadableByteChannel
- Throws:
IOException
close
public void close()
throws IOException
- Specified by:
close
in interface Closeable
- Specified by:
close
in interface Channel
- Throws:
IOException
isOpen
public boolean isOpen()
- Specified by:
isOpen
in interface Channel
write
public int write(ByteBuffer src)
throws IOException
- Specified by:
write
in interface WritableByteChannel
- Throws:
IOException
Copyright (c) 2004-2012 Oracle. All rights reserved.