Java Lobby Announcements

Subscribe to Java Lobby Announcements feed
Recent posts in Java on
Updated: 3 hours 18 min ago

CUBA: Scheduled Tasks at Design Time

Mon, 2017-10-23 22:37

If you have developed at least one project on the CUBA Platform or even spent a few hours discovering it, you have probably noticed a strong intention to move a lot of things to runtime: role and row level security (CRUD permissions over entities and their attributes, screens and their elements, access to the row-level data), dynamic attributes (implementation for the EAV approach), entity log (for auditing all changes over entities), JMX console (for remote application maintenance), scheduled tasks (for managing repetitive tasks, such as cache updates or e-mail queue processing) and so on. Simply put, everything that could be managed at runtime is designed in this way.

Such a runtime-centric approach gives you great flexibility for maintaining an application on the fly. For example, if there is a need to disable some CRUD actions for a certain user or add a few properties to an entity, it will not require a long chain of development, testing, and redeployment procedures.

Categories: Java

PlantUML Pleasantness: Lay Out Elements With Hidden Lines

Mon, 2017-10-23 22:01

In a previous post, we learned how to use a together block to keep elements together. We can also layout elements in a different way: using hidden lines. We define our elements and by using the keyword [hidden] in our line definition the elements are laid out as if there was a line, but we don't see it. This gives us great flexibility on how we layout our elements.

In the following sample, we first have a PlantUML definition where we rely on the default layout:

Categories: Java

Java Code Coverage in Eclipse

Mon, 2017-10-23 18:01

People often think that Java code coverage tools are only used for testing. I beg to differ. I was recently investigating a JVM crash issue and had been interested in seeing which lines of code among those that were run could have had an influence on the crash.

To help with this, I used a tool that I recently discovered and have been using ever since called the EclEmma Java code coverage plugin. It’s for Eclipse and it’s free.

Categories: Java

Hamming Error Correction With Kotlin (Part 1)

Mon, 2017-10-23 12:01

Hamming code is one of the computer science/telecommunication classics.

In this article, we'll revisit the topic and implement a stateless Hamming(7,4) encoder using Kotlin.

Categories: Java

Inside the Java Virtual Machine (Part 2)

Mon, 2017-10-23 09:01

In my last article, I explained virtual machines, the Java Virtual Machine, and the JVM's more basic concepts. This video will go a little deeper into the JVM.

Categories: Java

The Monitoring Aspects of Eclipse MicroProfile 1.2

Mon, 2017-10-23 06:01

Eclipse MicroProfile (MP) aims at bringing Microservices to Enterprise Java by developing common standards that MP-compliant vendors then implement [1]. This not only applies for developer APIs but also to interfaces for running, configuring, and managing the servers.

The more classical specifications have often left out many details as vendor-specific especially in the area of setting up and running of the applications and servers. For the Java Enterprise Edition, there are standards like JMX and JSR-77, but those were not used most of the time or access from management stations was not specified. This made it harder in practice to monitor the health of an application or to port the application from one application server vendor than needed.

Categories: Java Java EE Microservices Done Right

Sun, 2017-10-22 07:01

The sample application built as a part of this article can be found on GitHub.

It's the year 2017 and we’re all building microservices, where shared a runtime environment represented by a single application server hosting many applications is passé. As a result, rightsizing application environments makes sense! The functionality is still required, but not all at once by a single application, if ever.

Categories: Java

A Deep Dive Into JMX

Sat, 2017-10-21 07:01

<!-- Google Tag Manager (noscript) --> <iframe src="" height="0" width="0" style="display:none;visibility:hidden"></iframe>

In this article, we’ll have a look at a core Java technology – Java Management Extension (JMX).

Categories: Java

Groovy Goodness: Making Sure Closeable Objects Are Closed [Snippet]

Fri, 2017-10-20 22:01

If a class implements the Closeable interface, Groovy adds the withCloseable method to the class. The withCloseable method has a closure as an argument. The code in the closure is executed and then the implementation of the close method of the Closeable interface is invoked. The Closeable object is passed as an argument to the closure so we can refer to it inside the closure.

In the following example, we have two objects that implement the Closeable interface. By using withCloseable, we know for sure the close method is invoked after all the code in the closure is executed:

Categories: Java

This Week in Spring: Spring Boot, Microservices, and OSS

Fri, 2017-10-20 18:01

Hi, Spring fans! Welcome to another installment of This Week in Spring! This week I’ve been in Dallas and Austin, Texas, first for customer meetings and then to attend and speak at the epic Reactive Summit. If you’re around, don’t hesitate to say hi on Twitter! We’ve got a lot to cover so let’s get to it!

Also, I’ll be doing a webinar with our friends at OCI on November 9th, 2017, on Grails for the Spring Developer, with my friend and Grails co-founder Jeff Scott Brown. I hope you’ll join us!

Categories: Java

How IBM Uses Reactive for Insights and Data Science

Fri, 2017-10-20 12:01

Sebastian Hassinger, Developer Partners and Ecosystems at IBM shared his thoughts on the current and future state of the reactive platform in advance of the Reactive Summit this week in Austin, Texas.

From IBM's point of view, why is Reactive such an important movement around the design characteristics for enterprise applications and systems?

Categories: Java

Java Command-Line Interfaces (Part 22): argparser

Fri, 2017-10-20 09:01

John Lloyd's argparser is the library covered in this twenty-second post of the series on Java-based command line argument parsing. The main page for the library provides links to Javadoc-based API documentation, a JAR file, a ZIP file, and a TAR file in addition to a single source code example. The example used in this post is similar to the examples used in the first twenty-one posts in this series and processes file path/name and verbosity options. The full code listing is available on GitHub.

The "definition" stage is accomplished in argparser with instances of "Holder" classes representing the expected options that are passed to the addOption(String,Object) method of an ArgParser instance. This is demonstrated in the next code listing.

Categories: Java

Passing by Value vs. Passing by Reference in Java

Fri, 2017-10-20 06:01

Understanding the technique used to pass information between variables and into methods can be a difficult task for a Java developer, especially those accustomed to a much more verbose programming language, such as C or C++. In these expressive languages, the developer is solely responsible for determining the technique used to pass information between different parts of the system. For example, C++ allows a developer to explicitly pass a piece of data either by value, by reference, or by pointer. The compiler simply ensures that the selected technique is properly implemented and that no invalid operation is performed.

In the case of Java, these low-level details are abstracted, which both reduces the onus on the developer to select a proper means of passing data and increases the security of the language (by inhibiting the manipulation of pointers and directly addressing memory). In addition, though, this level of abstraction hides the details of the technique performed, which can obfuscate a developer's understanding of how data is passed in a program. In this article, we will examine the various techniques used to pass data and deep-dive into the technique that the Java Virtual Machine (JVM) and the Java Programming Language use to pass data, as well as explore some examples that demonstrate in practical terms what these techniques mean for a developer.

Categories: Java

jQuery UI and Address Auto-Completion

Thu, 2017-10-19 22:01

jQuery UI has a little-known feature that makes interactive auto-completion very easy. In this hands-on tutorial, we put it together with the cloud-based Global Express Entry address auto-complete service from Melissa to smooth over one of the biggest problems in getting users to sign up.

There are many things that users hate having to do on a website, but they all come down to the same thing — they hate having to do work. Of all of the things you can ask a user to do, typing in their name and address probably qualifies as one that involves the most work. How many potential customers give up on a purchase because they find typing in a full address too irksome. Even if they do go through with it, how can you be sure they have done it correctly. Most users aren't expert typists and easily make a mess of their data entry. The cost of trying to ship something to an invalid address is obvious.

Categories: Java

The Top 3 Blockchain Libraries for Java Devs

Thu, 2017-10-19 18:01

Alright folks, we all have heard about Bitcoin, Ethereum, or other cryptocurrencies with funky names rolling around our news feeds, but do we as Java developers know how to easily interact with these blockchain technologies? Here are the top three Java projects that can be used to take advantage of the blockchain trend right now. The list is ordered based on GitHub repository stars. Comments and opinions are very appreciated.


The name is very descriptive, don't you think? If you have wondered how to create a bitcoin wallet and manage transactions between nodes, then you should give BitcoinJ a try. The project has a growing community and very good documentation, which makes it extremely lucrative for every developer. Of course, as most open source projects that try to gain popularity, it has limitations at the beginning. There are several known security issues aligned with open bugs and scalability problems. Still, it is extremely helpful if you want to understand how the bitcoin protocol operates. Personal opinion: Not suitable for production applications.

Categories: Java

Levels of Abstraction

Thu, 2017-10-19 12:01

Writing code is all about abstractions. They help us grasp the complexity of the code by hiding low-level details from high-level concepts. The key to readable code lies in grouping the right level of abstraction in the same unit of code.

Kent Beck originally came up with the following guidelines in his book Smalltalk best practice patterns:

Categories: Java

Spring Tips: Bootiful JAX-RS

Thu, 2017-10-19 09:01

Hi, Spring fans! In this tip, we'll look at how to integrate a Spring Boot application with JAX-RS (using the Jersey reference implementation). JAX-RS is a JCP standard for building REST applications.

Speaker: Josh Long

Categories: Java

Jersey Client Dependencies for JAX-RS 2.1

Wed, 2017-10-18 22:01

Jersey is the reference implementation of JAX-RS 2.1. The following Jersey dependencies are required in order to run a JAX-RS 2.1 client with JSON-P and JSON-B mapping outside of an enterprise container.

Jersey client version 2.6 implements the JAX-RS 2.1 API. The following dependencies add the client runtime to a project:

Categories: Java

Controlling the Parallelism Level of Java Parallel Streams

Wed, 2017-10-18 18:01

With the recent Java 9 release, we got many new goodies to play with to improve our solutions — once we grasp those new features. The release of Java 9 is also a good time to revise whether we have grasped Java 8's features.

In this post, I’d like to bust the most common misconception about Java parallel streams. It’s often said that you cannot control parallel streams’ parallelism level in a programmatic way, that parallel streams always run on a shared ForkJoinPool.commonPool() and there’s nothing you can do about it.

Categories: Java

Looking Into the Java Virtual Machine [Video]

Wed, 2017-10-18 12:01

A lot of Java developers, even experienced ones, struggle to understand the JVM. When I  interview people, I realize there are a lot of misconceptions around the JVM and virtual machines in general. So, with that in mind, I created a video to explain the important concepts of the JVM.

Categories: Java