Fix remaining TODOs

This commit is contained in:
Gary Russell
2010-03-06 23:49:14 +00:00
parent 5d1325ae90
commit 9b8150a732
6 changed files with 21 additions and 32 deletions

View File

@@ -104,8 +104,6 @@ public class NioSocketWriter extends AbstractSocketWriter {
*/
@Override
protected void writeCustomFormat(byte[] bytes) throws IOException {
// TODO Auto-generated method stub
}
/* (non-Javadoc)

View File

@@ -69,17 +69,16 @@ public class TcpNetReceivingChannelAdapter extends
}});
}
} catch (IOException e) {
if (!active) {
if (serverSocket != null) {
try {
serverSocket.close();
} catch (IOException e1) {}
}
serverSocket = null;
return;
if (serverSocket != null) {
try {
serverSocket.close();
} catch (IOException e1) {}
}
// TODO Auto-generated catch block
e.printStackTrace();
serverSocket = null;
if (active) {
logger.error("Error on ServerSocket", e);
}
}
}
@@ -101,8 +100,6 @@ public class TcpNetReceivingChannelAdapter extends
customSocketReader.getConstructor(Socket.class);
reader = BeanUtils.instantiateClass(ctor, socket);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
throw new MessageMappingException("Failed to instantiate custom reader", e);
}
}

View File

@@ -64,8 +64,7 @@ public class TcpNetSendingMessageHandler extends
writer.setMessageFormat(messageFormat);
this.writer = writer;
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
logger.error("Error creating SocketWriter", e);
}
}
return this.writer;

View File

@@ -74,18 +74,13 @@ public class TcpNioReceivingChannelAdapter extends
doSelect(serverChannel, selector);
} catch (IOException e) {
if (!active) {
try {
serverChannel.close();
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
serverChannel = null;
return;
try {
serverChannel.close();
} catch (IOException e1) { }
serverChannel = null;
if (active) {
logger.error("Error on ServerSocketChannel", e);
}
// TODO Auto-generated catch block
e.printStackTrace();
}
}
@@ -127,6 +122,9 @@ public class TcpNioReceivingChannelAdapter extends
key.interestOps(key.interestOps() - key.readyOps());
if (key.attachment() == null) {
NioSocketReader reader = createSocketReader(key);
if (reader == null) {
continue;
}
key.attach(reader);
}
this.threadPoolTaskScheduler.execute(new Runnable() {
@@ -162,8 +160,7 @@ public class TcpNioReceivingChannelAdapter extends
.getConstructor(SocketChannel.class);
reader = BeanUtils.instantiateClass(ctor, channel);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
logger.error("Error creating SocketReader", e);
}
} else {
reader = new NioSocketReader(channel);

View File

@@ -61,8 +61,7 @@ public class TcpNioSendingMessageHandler extends
writer.setUsingDirectBuffers(usingDirectBuffers);
this.writer = writer;
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
logger.error("Error creating SocketWriter", e);
}
}
return this.writer;

View File

@@ -38,7 +38,6 @@ import org.springframework.integration.message.StringMessage;
/**
* Sends and receives a simple message through to the Udp channel adapters.
* If run as a JUnit just sends one message and terminates (see console).
* TODO: Use a custom output stream and catch output to verify.
*
* If run from main(),
* hangs around for a couple of minutes to allow console interaction (enter a message on the