Skip to main content

Posts

Showing posts from December, 2015

A web client for the Jolokia agents

I have just released the version 0.2 of jolokiaui ( https://github.com/virtualramblas/jolokiaui ), a web client for the Jolokia JVM agent ( https://jolokia.org/agent/jvm.html ) to monitor local and remote JVMs. It is implemented in R ( https://www.r-project.org/ ) using the Shiny framework ( http://shiny.rstudio.com/ ).  The current release is still an alpha, but new features would be added in the next months. Any feedback is welcome. Enjoy it.

One good reason to move to Java 8 (if you haven't already done so)

One of the most useful things introduced by Java 8 is the Optional class ( https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html ). It is a container object that wraps either a value or null , to represent the absence of a value. You can quickly understand the benefits coming from it: a better way to handle the existence of null values with no need to explicitly check for nulls and possibly less chance to have NullPointerException exceptions. Some code like this // The method call below could return null User currentUser = getUser(id); Role role = null; if(currentUser != null) {   role = getRole(currentUser); } becomes: Optional<User> currentUser = Optional.ofNullable(getUser(id)); Optional<Role> role = currentUser.map(u -> getRole(currentUser));