Another Hot Rod tutorial, this time with java, similar concept but using a Hot Rod java client. Just a reminder, basically TCP client that access the cache on JDG.
There is the `FootballManager` and the Team, which are pretty much the classes that play a role here (except for the user). So then a FootballManager has team(s) and so forth. The team just encapsulates the list of players and the name. The core part (talking with the cache itself) is on the FootballManager class.
ConfigurationBuilder builder = new ConfigurationBuilder();
cacheManager = new RemoteCacheManager(builder.build());
cache = cacheManager.getCache(“teams”);
The main part is then the builder adding the server with jdgProperty (from a file) and the port. Then it adds the players. The file has basically the host and the port:
To read the commands, it is used
– Originally the players added were Messi, Pedro, and Puyol. I changed for Pele, Tostao, and Rivelino (Tri-world champions on the1970th World Cup in Mexico)
– Comparing with the JS version: This version is done in Java,that’s the only difference. Although js has a simpler connection with JDG.
java.io.Console reading is faster than