Java has come a long way since I first started developing with Java back when the gold standard was
JDK 1.1 (1997). We now have Generics, hooray no more writing wrappers for container classes to add type safety. Anonymous classes, great for providing glue logic, not as good as lambdas.
Over this time the focus has moved away from threads as the solution, as they limit scalability.
Java now supports asynchronous IO but a shame that the standard Future (java.util.concurrent.Future) interface does not include callbacks, you have to poll it to find out when the IO has completed. This results in a number of incompatible extensions to Future.
I look back at the changes and I see the influence from other sources. i.e. C++ STL (Standard Template Language) for generics. Soon we will be writing functional code in Java!
A Console server
A while back I wrote a console server in Python, when I came across the apache Mina project along with
its ssh server and a terminal handler for mina. I could see I had the pieces to implement this in Java.
A console server is a terminal server working in reverse. Instead of connecting to a serial port with your terminal to talk to the computer, you connect over a network connection (SSH preferably) to talk to an external device (network router) on its serial management port. In the network world this can be out of band and allow you to access a device that is having problems.
The code for this is up on github, it is currently a work in progress.
Observations
You very quickly end up with a number of JARs on your class path, the dependancies within Java Open source seem to mount up very quickly.
Although documentation is there, you do need to dig into the source code. The examples can be very simple. I found with the python libraries I used that the dependencies where not so large and that the
eco system of examples was much larger and more complex.
Futures
I have yet to complete the command parser and persist the configuration. The python version also
logs all data on the serial ports and allows you to connect to any port from the master
connection.