Add javadocs to the *ChannelConfig interfaces to make clear which ChannelOptions implementations are expect to support

This commit is contained in:
Norman Maurer 2013-01-20 08:10:15 +01:00
parent 8b72a4c1e2
commit 57e504a7e6
8 changed files with 109 additions and 52 deletions

View File

@ -17,6 +17,7 @@ package io.netty.channel.rxtx;
import gnu.io.SerialPort;
import io.netty.channel.ChannelOption;
import io.netty.channel.ChannelConfig;
import io.netty.channel.DefaultChannelConfig;
import java.util.Map;
@ -25,6 +26,29 @@ import static io.netty.channel.rxtx.RxtxChannelOption.*;
/**
* A configuration class for RXTX device connections.
*
* <h3>Available options</h3>
*
* In addition to the options provided by {@link ChannelConfig},
* {@link RxtxChannelConfig} allows the following options in the option map:
*
* <table border="1" cellspacing="0" cellpadding="6">
* <tr>
* <th>Name</th><th>Associated setter method</th>
* </tr><tr>
* <td>{@link io.netty.channel.rxtx.RxtxChannelOption#BAUD_RATE}</td><td>{@link #setBaudrate(int)}</td>
* </tr><tr>
* <td>{@link io.netty.channel.rxtx.RxtxChannelOption#DTR}</td><td>{@link #setDtr(boolean)}</td>
* </tr><tr>
* <td>{@link io.netty.channel.rxtx.RxtxChannelOption#RTS}</td><td>{@link #setRts(boolean)}</td>
* </tr><tr>
* <td>{@link io.netty.channel.rxtx.RxtxChannelOption#STOP_BITS}</td><td>{@link #setStopbits(Stopbits)}</td>
* </tr><tr>
* <td>{@link io.netty.channel.rxtx.RxtxChannelOption#DATA_BITS}</td><td>{@link #setDatabits(Databits)}</td>
* </tr><tr>
* <td>{@link io.netty.channel.rxtx.RxtxChannelOption#PARITY_BIT}</td><td>{@link #setParitybit(Paritybit)}</td>
* </tr>
* </table>
*/
public class RxtxChannelConfig extends DefaultChannelConfig {

View File

@ -32,14 +32,13 @@ import static com.sun.nio.sctp.SctpStandardSocketOptions.*;
* <tr>
* <th>Name</th><th>Associated setter method</th>
* </tr><tr>
* <td>{@code "sctpNoDelay"}</td><td>{@link #setSctpNoDelay(boolean)}}</td>
* <td>{@link SctpChannelOption#SCTP_NODELAY}</td><td>{@link #setSctpNoDelay(boolean)}}</td>
* </tr><tr>
* <td>{@code "receiveBufferSize"}</td><td>{@link #setReceiveBufferSize(int)}</td>
* <td>{@link SctpChannelOption#SO_RCVBUF}</td><td>{@link #setReceiveBufferSize(int)}</td>
* </tr><tr>
* <td>{@code "sendBufferSize"}</td><td>{@link #setSendBufferSize(int)}</td>
* <td>{@link SctpChannelOption#SO_SNDBUF}</td><td>{@link #setSendBufferSize(int)}</td>
* </tr><tr>
* <td>{@code "sctpInitMaxStreams"}</td>
* <td>{@link #setInitMaxStreams(InitMaxStreams)}</td>
* <td>{@link SctpChannelOption#SCTP_INIT_MAXSTREAMS}</td><td>{@link #setInitMaxStreams(InitMaxStreams)}</td>
* </tr>
* </table>
*/

View File

@ -33,14 +33,13 @@ import static com.sun.nio.sctp.SctpStandardSocketOptions.*;
* <tr>
* <th>Name</th><th>Associated setter method</th>
* </tr><tr>
* <td>{@code "backlog"}</td><td>{@link #setBacklog(int)}</td>
* <td>{@link SctpChannelOption#SO_BACKLOG}</td><td>{@link #setBacklog(int)}</td>
* </tr><tr>
* * <td>{@code "receiveBufferSize"}</td><td>{@link #setReceiveBufferSize(int)}</td>
* <td>{@link SctpChannelOption#SO_RCVBUF}</td><td>{@link #setReceiveBufferSize(int)}</td>
* </tr><tr>
* <td>{@code "sendBufferSize"}</td><td>{@link #setSendBufferSize(int)}</td>
* <td>{@link SctpChannelOption#SO_SNDBUF}</td><td>{@link #setSendBufferSize(int)}</td>
* </tr><tr>
* <td>{@code "sctpInitMaxStreams"}</td>
* <td>{@link #setInitMaxStreams(InitMaxStreams)} (int)}}</td>
* <td>{@link SctpChannelOption#SCTP_INIT_MAXSTREAMS}</td><td>{@link #setInitMaxStreams(InitMaxStreams)}</td>
* </tr>
* </table>
*/

View File

@ -34,31 +34,34 @@ import com.barchart.udt.nio.KindUDT;
* <tr>
* <th>Name</th>
* <th>Associated setter method</th>
* </tr>
* <tr>
* <td>{@code "reuseAddress"}</td>
* <td>{@link #setReuseAddress(boolean)}</td>
* </tr>
* <tr>
* <td>{@code "soLinger"}</td>
* <td>{@link #setSoLinger(int)}</td>
* </tr>
* <tr>
* <td>{@code "receiveBufferSize"}</td>
* <td>{@link #setReceiveBufferSize(int)}</td>
* </tr>
* <tr>
* <td>{@code "sendBufferSize"}</td>
* <td>{@link #setSendBufferSize(int)}</td>
* </tr>
* <tr>
* <td>{@code "protocolReceiveBuferSize"}</td>
* </tr><tr>
* <td>{@link io.netty.channel.ChannelOption#SO_REUSEADDR}</td><td>{@link #setReuseAddress(boolean)}</td>
* </tr><tr>
* <td>{@link io.netty.channel.ChannelOption#SO_RCVBUF}</td><td>{@link #setReceiveBufferSize(int)}</td>
* </tr><tr>
* <td>{@link io.netty.channel.ChannelOption#SO_SNDBUF}</td><td>{@link #setSendBufferSize(int)}</td>
* </tr><tr>
* <td>{@link io.netty.channel.ChannelOption#SO_REUSEADDR}</td><td>{@link #setReuseAddress(boolean)}</td>
* </tr><tr>
* <td>{@link io.netty.channel.ChannelOption#SO_LINGER}</td><td>{@link #setSoLinger(int)}</td>
* </tr><tr>
* <td>{@link io.netty.channel.ChannelOption#SO_RCVBUF}</td><td>{@link #setReceiveBufferSize(int)}</td>
* </tr><tr>
* <td>{@link io.netty.channel.ChannelOption#SO_SNDBUF}</td><td>{@link #setSendBufferSize(int)}</td>
* </tr><tr>
* <td>{@link io.netty.channel.udt.UdtChannelOption#PROTOCOL_RECEIVE_BUFFER_SIZE}</td>
* <td>{@link #setProtocolReceiveBufferSize(int)}</td>
* <tr>
* <tr>
* <td>{@code "systemReceiveBufferSize"}</td>
* <td>{@link #setProtocolReceiveBufferSize(int)}</td>
* <tr>
* </tr><tr>
* <td>{@link io.netty.channel.udt.UdtChannelOption#PROTOCOL_SEND_BUFFER_SIZE}</td>
* <td>{@link #setProtocolSendBufferSize(int)}</td>
* </tr><tr>
* <td>{@link io.netty.channel.udt.UdtChannelOption#SYSTEM_RECEIVE_BUFFER_SIZE}</td>
* <td>{@link #setSystemReceiveBufferSize(int)}</td>
* </tr><tr>
* <td>{@link io.netty.channel.udt.UdtChannelOption#SYSTEM_SEND_BUFFER_SIZE}</td>
* <td>{@link #setSystemSendBufferSize(int)}</td>
* </tr>
* </table>
* <p>
* Note that {@link TypeUDT#DATAGRAM} message oriented channels treat

View File

@ -46,7 +46,13 @@ import java.util.Map;
* <tr>
* <th>Name</th><th>Associated setter method</th>
* </tr><tr>
* <td>{@code "connectTimeoutMillis"}</td><td>{@link #setConnectTimeoutMillis(int)}</td>
* <td>{@link io.netty.channel.ChannelOption#CONNECT_TIMEOUT_MILLIS}</td><td>{@link #setConnectTimeoutMillis(int)}</td>
* </tr><tr>
* <td>{@link io.netty.channel.ChannelOption#WRITE_SPIN_COUNT}</td><td>{@link #setWriteSpinCount(int)}</td>
* </tr><tr>
* <td>{@link io.netty.channel.ChannelOption#ALLOCATOR}</td><td>{@link #setAllocator(ByteBufAllocator)}</td>
* </tr><tr>
* <td>{@link io.netty.channel.ChannelOption#AUTO_READ}</td><td>{@link #setAutoRead(boolean)}</td>
* </tr>
* </table>
* <p>

View File

@ -17,7 +17,6 @@ package io.netty.channel.socket;
import io.netty.buffer.ByteBufAllocator;
import io.netty.channel.ChannelConfig;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.StandardSocketOptions;
@ -34,23 +33,27 @@ import java.net.StandardSocketOptions;
* <tr>
* <th>Name</th><th>Associated setter method</th>
* </tr><tr>
* <td>{@code "broadcast"}</td><td>{@link #setBroadcast(boolean)}</td>
* <td>{@link io.netty.channel.ChannelOption#SO_BROADCAST}</td><td>{@link #setBroadcast(boolean)}</td>
* </tr><tr>
* <td>{@code "interface"}</td><td>{@link #setInterface(InetAddress)}</td>
* <td>{@link io.netty.channel.ChannelOption#IP_MULTICAST_ADDR}</td><td>{@link #setInterface(InetAddress)}</td>
* </tr><tr>
* <td>{@code "loopbackModeDisabled"}</td><td>{@link #setLoopbackModeDisabled(boolean)}</td>
* <td>{@link io.netty.channel.ChannelOption#IP_MULTICAST_LOOP_DISABLED}</td>
* <td>{@link #setLoopbackModeDisabled(boolean)}</td>
* </tr><tr>
* <td>{@code "networkInterface"}</td><td>{@link #setNetworkInterface(NetworkInterface)}</td>
* <td>{@link io.netty.channel.ChannelOption#IP_MULTICAST_IF}</td>
* <td>{@link #setNetworkInterface(NetworkInterface)}</td>
* </tr><tr>
* <td>{@code "reuseAddress"}</td><td>{@link #setReuseAddress(boolean)}</td>
* <td>{@link io.netty.channel.ChannelOption#SO_REUSEADDR}</td><td>{@link #setReuseAddress(boolean)}</td>
* </tr><tr>
* <td>{@code "receiveBufferSize"}</td><td>{@link #setReceiveBufferSize(int)}</td>
* <td>{@link io.netty.channel.ChannelOption#SO_RCVBUF}</td><td>{@link #setReceiveBufferSize(int)}</td>
* </tr><tr>
* <td>{@code "sendBufferSize"}</td><td>{@link #setSendBufferSize(int)}</td>
* <td>{@link io.netty.channel.ChannelOption#SO_SNDBUF}</td><td>{@link #setSendBufferSize(int)}</td>
* </tr><tr>
* <td>{@code "timeToLive"}</td><td>{@link #setTimeToLive(int)}</td>
* <td>{@link io.netty.channel.ChannelOption#IP_MULTICAST_TTL}</td><td>{@link #setTimeToLive(int)}</td>
* </tr><tr>
* <td>{@code "trafficClass"}</td><td>{@link #setTrafficClass(int)}</td>
* <td>{@link io.netty.channel.ChannelOption#IP_TOS}</td><td>{@link #setTrafficClass(int)}</td>
* </tr><tr>
* <td>{@link io.netty.channel.ChannelOption#UDP_RECEIVE_PACKET_SIZE}</td><td>{@link #setReceivePacketSize(int)}</td>
* </tr>
* </table>
*/
@ -76,8 +79,16 @@ public interface DatagramChannelConfig extends ChannelConfig {
*/
DatagramChannelConfig setReceiveBufferSize(int receiveBufferSize);
/**
* Gets the size of the {@link DatagramPacket#data()} which will be used to store the received data.
* This should match the maximal packet size that you expect to receive.
*/
int getReceivePacketSize();
/**
* Sets the size of the {@link DatagramPacket#data()} which will be used to store the received data.
* This should match the maximal packet size that you expect to receive.
*/
DatagramChannelConfig setReceivePacketSize(int receivePacketSize);
/**

View File

@ -35,19 +35,21 @@ import java.net.StandardSocketOptions;
* <tr>
* <th>Name</th><th>Associated setter method</th>
* </tr><tr>
* <td>{@code "keepAlive"}</td><td>{@link #setKeepAlive(boolean)}</td>
* <td>{@link io.netty.channel.ChannelOption#SO_KEEPALIVE}</td><td>{@link #setKeepAlive(boolean)}</td>
* </tr><tr>
* <td>{@code "reuseAddress"}</td><td>{@link #setReuseAddress(boolean)}</td>
* <td>{@link io.netty.channel.ChannelOption#SO_REUSEADDR}</td><td>{@link #setReuseAddress(boolean)}</td>
* </tr><tr>
* <td>{@code "soLinger"}</td><td>{@link #setSoLinger(int)}</td>
* <td>{@link io.netty.channel.ChannelOption#SO_LINGER}</td><td>{@link #setSoLinger(int)}</td>
* </tr><tr>
* <td>{@code "tcpNoDelay"}</td><td>{@link #setTcpNoDelay(boolean)}</td>
* <td>{@link io.netty.channel.ChannelOption#TCP_NODELAY}</td><td>{@link #setTcpNoDelay(boolean)}</td>
* </tr><tr>
* <td>{@code "receiveBufferSize"}</td><td>{@link #setReceiveBufferSize(int)}</td>
* <td>{@link io.netty.channel.ChannelOption#SO_RCVBUF}</td><td>{@link #setReceiveBufferSize(int)}</td>
* </tr><tr>
* <td>{@code "sendBufferSize"}</td><td>{@link #setSendBufferSize(int)}</td>
* <td>{@link io.netty.channel.ChannelOption#SO_SNDBUF}</td><td>{@link #setSendBufferSize(int)}</td>
* </tr><tr>
* <td>{@code "trafficClass"}</td><td>{@link #setTrafficClass(int)}</td>
* <td>{@link io.netty.channel.ChannelOption#IP_TOS}</td><td>{@link #setTrafficClass(int)}</td>
* </tr><tr>
* <td>{@link io.netty.channel.ChannelOption#ALLOW_HALF_CLOSURE}</td><td>{@link #setAllowHalfClosure(boolean)}</td>
* </tr>
* </table>
*/

View File

@ -24,6 +24,19 @@ import java.nio.channels.InterruptedByTimeoutException;
/**
* Special {@link SocketChannelConfig} which is used for the {@link AioSocketChannel} to expose extra configuration
* possiblilites.
*
* In addition to the options provided by {@link SocketChannelConfig},
* {@link AioSocketChannelConfig} allows the following options in the option map:
*
* <table border="1" cellspacing="0" cellpadding="6">
* <tr>
* <th>Name</th><th>Associated setter method</th>
* </tr><tr>
* <td>{@link io.netty.channel.ChannelOption#AIO_READ_TIMEOUT}</td><td>{@link #setReadTimeout(long)}</td>
* </tr><tr>
* <td>{@link io.netty.channel.ChannelOption#AIO_WRITE_TIMEOUT}</td><td>{@link #setWriteTimeout(long)}</td>
* </tr>
* </table>
*/
public interface AioSocketChannelConfig extends SocketChannelConfig {
@Override