RXTX -> Rxtx for consistent naming convention

This commit is contained in:
Trustin Lee 2012-01-15 01:09:17 +09:00
parent b9b2366361
commit 0007e91923
6 changed files with 39 additions and 43 deletions

View File

@ -281,12 +281,8 @@
<configuration> <configuration>
<consoleOutput>true</consoleOutput> <consoleOutput>true</consoleOutput>
<logViolationsToConsole>true</logViolationsToConsole> <logViolationsToConsole>true</logViolationsToConsole>
<!-- Disabled temporarily until all violations are fixed.
<failsOnError>true</failsOnError> <failsOnError>true</failsOnError>
<failOnViolation>true</failOnViolation> <failOnViolation>true</failOnViolation>
-->
<failsOnError>false</failsOnError>
<failOnViolation>false</failOnViolation>
<configLocation>io/netty/checkstyle.xml</configLocation> <configLocation>io/netty/checkstyle.xml</configLocation>
</configuration> </configuration>
</execution> </execution>
@ -295,7 +291,7 @@
<dependency> <dependency>
<groupId>${project.groupId}</groupId> <groupId>${project.groupId}</groupId>
<artifactId>netty-build</artifactId> <artifactId>netty-build</artifactId>
<version>1</version> <version>2-SNAPSHOT</version>
</dependency> </dependency>
</dependencies> </dependencies>
</plugin> </plugin>

View File

@ -29,26 +29,26 @@ import io.netty.channel.ChannelSink;
/** /**
* A channel to a serial device using the RXTX library. * A channel to a serial device using the RXTX library.
*/ */
public class RRXTXChannel extends AbstractChannel { public class RxtxChannel extends AbstractChannel {
RRXTXChannel(final Channel parent, final ChannelFactory factory, final ChannelPipeline pipeline, RxtxChannel(final Channel parent, final ChannelFactory factory, final ChannelPipeline pipeline,
final ChannelSink sink) { final ChannelSink sink) {
super(parent, factory, pipeline, sink); super(parent, factory, pipeline, sink);
} }
@Override @Override
public ChannelConfig getConfig() { public ChannelConfig getConfig() {
return ((RRXTXChannelSink) getPipeline().getSink()).getConfig(); return ((RxtxChannelSink) getPipeline().getSink()).getConfig();
} }
@Override @Override
public boolean isBound() { public boolean isBound() {
return ((RRXTXChannelSink) getPipeline().getSink()).isBound(); return ((RxtxChannelSink) getPipeline().getSink()).isBound();
} }
@Override @Override
public boolean isConnected() { public boolean isConnected() {
return ((RRXTXChannelSink) getPipeline().getSink()).isConnected(); return ((RxtxChannelSink) getPipeline().getSink()).isConnected();
} }
@Override @Override
@ -58,7 +58,7 @@ public class RRXTXChannel extends AbstractChannel {
@Override @Override
public SocketAddress getRemoteAddress() { public SocketAddress getRemoteAddress() {
return ((RRXTXChannelSink) getPipeline().getSink()).getRemoteAddress(); return ((RxtxChannelSink) getPipeline().getSink()).getRemoteAddress();
} }
@Override @Override

View File

@ -23,7 +23,7 @@ import io.netty.util.internal.ConversionUtil;
/** /**
* A configuration class for RXTX device connections. * A configuration class for RXTX device connections.
*/ */
public class RRXTXChannelConfig extends DefaultChannelConfig { public class RxtxChannelConfig extends DefaultChannelConfig {
public enum Stopbits { public enum Stopbits {
@ -112,17 +112,17 @@ public class RRXTXChannelConfig extends DefaultChannelConfig {
private boolean rts; private boolean rts;
private Stopbits stopbits = RRXTXChannelConfig.Stopbits.STOPBITS_1; private Stopbits stopbits = RxtxChannelConfig.Stopbits.STOPBITS_1;
private Databits databits = RRXTXChannelConfig.Databits.DATABITS_8; private Databits databits = RxtxChannelConfig.Databits.DATABITS_8;
private Paritybit paritybit = RRXTXChannelConfig.Paritybit.NONE; private Paritybit paritybit = RxtxChannelConfig.Paritybit.NONE;
public RRXTXChannelConfig() { public RxtxChannelConfig() {
// work with defaults ... // work with defaults ...
} }
public RRXTXChannelConfig(final int baudrate, final boolean dtr, final boolean rts, final Stopbits stopbits, public RxtxChannelConfig(final int baudrate, final boolean dtr, final boolean rts, final Stopbits stopbits,
final Databits databits, final Paritybit paritybit) { final Databits databits, final Paritybit paritybit) {
this.baudrate = baudrate; this.baudrate = baudrate;
this.dtr = dtr; this.dtr = dtr;

View File

@ -27,22 +27,22 @@ import io.netty.channel.group.DefaultChannelGroup;
import io.netty.util.internal.ExecutorUtil; import io.netty.util.internal.ExecutorUtil;
/** /**
* A {@link ChannelFactory} for creating {@link RRXTXChannel} instances. * A {@link ChannelFactory} for creating {@link RxtxChannel} instances.
*/ */
public class RRXTXChannelFactory implements ChannelFactory { public class RxtxChannelFactory implements ChannelFactory {
private final ChannelGroup channels = new DefaultChannelGroup("RXTXChannelFactory-ChannelGroup"); private final ChannelGroup channels = new DefaultChannelGroup("RXTXChannelFactory-ChannelGroup");
private final ExecutorService executor; private final ExecutorService executor;
public RRXTXChannelFactory(ExecutorService executor) { public RxtxChannelFactory(ExecutorService executor) {
this.executor = executor; this.executor = executor;
} }
@Override @Override
public Channel newChannel(final ChannelPipeline pipeline) { public Channel newChannel(final ChannelPipeline pipeline) {
RRXTXChannelSink sink = new RRXTXChannelSink(executor); RxtxChannelSink sink = new RxtxChannelSink(executor);
RRXTXChannel channel = new RRXTXChannel(null, this, pipeline, sink); RxtxChannel channel = new RxtxChannel(null, this, pipeline, sink);
sink.setChannel(channel); sink.setChannel(channel);
channels.add(channel); channels.add(channel);
return channel; return channel;

View File

@ -48,17 +48,17 @@ import io.netty.channel.UpstreamMessageEvent;
/** /**
* A {@link ChannelSink} implementation of the RXTX support for Netty. * A {@link ChannelSink} implementation of the RXTX support for Netty.
*/ */
public class RRXTXChannelSink extends AbstractChannelSink { public class RxtxChannelSink extends AbstractChannelSink {
private static class WriteRunnable implements Runnable { private static class WriteRunnable implements Runnable {
private final DefaultChannelFuture future; private final DefaultChannelFuture future;
private final RRXTXChannelSink channelSink; private final RxtxChannelSink channelSink;
private final ChannelBuffer message; private final ChannelBuffer message;
public WriteRunnable(final DefaultChannelFuture future, final RRXTXChannelSink channelSink, public WriteRunnable(final DefaultChannelFuture future, final RxtxChannelSink channelSink,
final ChannelBuffer message) { final ChannelBuffer message) {
this.future = future; this.future = future;
this.channelSink = channelSink; this.channelSink = channelSink;
@ -83,9 +83,9 @@ public class RRXTXChannelSink extends AbstractChannelSink {
private final DefaultChannelFuture channelFuture; private final DefaultChannelFuture channelFuture;
private final RRXTXChannelSink channelSink; private final RxtxChannelSink channelSink;
ConnectRunnable(final DefaultChannelFuture channelFuture, final RRXTXChannelSink channelSink) { ConnectRunnable(final DefaultChannelFuture channelFuture, final RxtxChannelSink channelSink) {
this.channelFuture = channelFuture; this.channelFuture = channelFuture;
this.channelSink = channelSink; this.channelSink = channelSink;
} }
@ -145,9 +145,9 @@ public class RRXTXChannelSink extends AbstractChannelSink {
private final DefaultChannelFuture channelFuture; private final DefaultChannelFuture channelFuture;
private final RRXTXChannelSink channelSink; private final RxtxChannelSink channelSink;
public DisconnectRunnable(final DefaultChannelFuture channelFuture, final RRXTXChannelSink channelSink) { public DisconnectRunnable(final DefaultChannelFuture channelFuture, final RxtxChannelSink channelSink) {
this.channelFuture = channelFuture; this.channelFuture = channelFuture;
this.channelSink = channelSink; this.channelSink = channelSink;
} }
@ -203,20 +203,20 @@ public class RRXTXChannelSink extends AbstractChannelSink {
private final Executor executor; private final Executor executor;
final RRXTXChannelConfig config; final RxtxChannelConfig config;
RRXTXChannel channel; RxtxChannel channel;
public RRXTXChannelSink(final Executor executor) { public RxtxChannelSink(final Executor executor) {
this.executor = executor; this.executor = executor;
config = new RRXTXChannelConfig(); config = new RxtxChannelConfig();
} }
public boolean isConnected() { public boolean isConnected() {
return inputStream != null && outputStream != null; return inputStream != null && outputStream != null;
} }
public RRXTXDeviceAddress getRemoteAddress() { public RxtxDeviceAddress getRemoteAddress() {
return remoteAddress; return remoteAddress;
} }
@ -228,15 +228,15 @@ public class RRXTXChannelSink extends AbstractChannelSink {
return config; return config;
} }
public void setChannel(final RRXTXChannel channel) { public void setChannel(final RxtxChannel channel) {
this.channel = channel; this.channel = channel;
} }
private static class RXTXSerialPortEventListener implements SerialPortEventListener { private static class RXTXSerialPortEventListener implements SerialPortEventListener {
private final RRXTXChannelSink channelSink; private final RxtxChannelSink channelSink;
public RXTXSerialPortEventListener(final RRXTXChannelSink channelSink) { public RXTXSerialPortEventListener(final RxtxChannelSink channelSink) {
this.channelSink = channelSink; this.channelSink = channelSink;
} }
@ -268,7 +268,7 @@ public class RRXTXChannelSink extends AbstractChannelSink {
} }
} }
RRXTXDeviceAddress remoteAddress; RxtxDeviceAddress remoteAddress;
BufferedOutputStream outputStream; BufferedOutputStream outputStream;
@ -302,7 +302,7 @@ public class RRXTXChannelSink extends AbstractChannelSink {
case CONNECTED: case CONNECTED:
if (value != null) { if (value != null) {
remoteAddress = (RRXTXDeviceAddress) value; remoteAddress = (RxtxDeviceAddress) value;
executor.execute(new ConnectRunnable((DefaultChannelFuture) future, this)); executor.execute(new ConnectRunnable((DefaultChannelFuture) future, this));
} else { } else {
executor.execute(new DisconnectRunnable((DefaultChannelFuture) future, this)); executor.execute(new DisconnectRunnable((DefaultChannelFuture) future, this));

View File

@ -21,7 +21,7 @@ import java.net.SocketAddress;
* A {@link SocketAddress} subclass to wrap the serial port address of a RXTX * A {@link SocketAddress} subclass to wrap the serial port address of a RXTX
* device (e.g. COM1, /dev/ttyUSB0). * device (e.g. COM1, /dev/ttyUSB0).
*/ */
public class RRXTXDeviceAddress extends SocketAddress { public class RxtxDeviceAddress extends SocketAddress {
private static final long serialVersionUID = -2907820090993709523L; private static final long serialVersionUID = -2907820090993709523L;
@ -31,7 +31,7 @@ public class RRXTXDeviceAddress extends SocketAddress {
* *
* @param deviceAddress the address of the device (e.g. COM1, /dev/ttyUSB0, ...) * @param deviceAddress the address of the device (e.g. COM1, /dev/ttyUSB0, ...)
*/ */
public RRXTXDeviceAddress(String deviceAddress) { public RxtxDeviceAddress(String deviceAddress) {
this.deviceAddress = deviceAddress; this.deviceAddress = deviceAddress;
} }