Subscribe: Javalobby - The heart of the Java developer community
Added By: Feedage Forager Feedage Grade A rated
Language: English
article  context annotation  context  core context  dsl  java  javax core  jdk  kotlin  make  new  part  programming  spring boot  spring 
Rate this Feed
Rate this feedRate this feedRate this feedRate this feedRate this feed
Rate this feed 1 starRate this feed 2 starRate this feed 3 starRate this feed 4 starRate this feed 5 star

Comments (0)

Feed Details and Statistics Feed Statistics
Preview: Javalobby - The heart of the Java developer community

DZone Java Zone

Recent posts in Java on


A Look at ''Gradle Kotlin DSL''

Wed, 23 Aug 2017 20:01:01 GMT

Gradle build scripts can now be written using a DSL with Kotlin. All the concepts that work with traditional Gradle builds translate to a very intuitive DSL in Kotlin and have two additional features — it is typesafe and the script has excellent IDE support using IntelliJ IDEA.

My experience with the Gradle Kotlin DSL is fairly limited: It's all of one build script, which happens to be the subject of this article.

This Week in Spring: Reactive, Code Quality, and Serverless

Wed, 23 Aug 2017 16:01:11 GMT

Hi, Spring fans! Welcome to another installation of This Week in Spring. Can you believe we're already nearing the end of August? Time sure flies!

Last week and over the weekend I was in Hangzhou, China, visiting with Alibaba, talking to a few of the teams using Spring Boot and Spring Cloud at China-scale.

Simplifying Monads in Scala

Wed, 23 Aug 2017 10:01:01 GMT

Monads are not at all a complex topic, but yet it comes under the advanced section of Scala language. So basically, Monads are structures that represent sequential computations.

Let's be clear: A Monad is not a class or a trait; it is a concept.

Introducing Actuator Endpoints in Spring Boot 2.0

Wed, 23 Aug 2017 07:01:02 GMT

Spring Boot 2 brings important changes to Actuator and I am pleased, on behalf of the team, to give you a sneak peek to what's coming in 2.0.0.M4.

Working on a major new release gives us the opportunity to revisit some of the public contracts and improve them. We quickly felt that the endpoint infrastructure was one of them: currently, the web endpoints in the Actuator are only supported with Spring MVC (no JAX-RS support). Also, creating a new endpoint that exposes several operations requires writing quite a lot of boiler plate: you need to write a main endpoint, the Spring MVC extension (as a @RestController), a JMX MBean and the necessary auto-configuration. As of Spring Boot 2 support for a "reactive" actuator became an obvious requirement that also brings several new challenges.

Why I'm Excited About Scalaz 8

Wed, 23 Aug 2017 04:01:01 GMT

Historically, functional programming in Scala has not been for the faint of heart.

The JVM was built for Java, which is object-oriented, not functional, and Scala allows functional programming but isn't a functional-first programming language (like Haskell or PureScript).

What Is (Part 3)

Tue, 22 Aug 2017 20:01:00 GMT

In part 2 of What Is, you learned how to use the @Context annotation to retrieve security information from an injected instance of the SecurityContext class and how to use JAX-RS resource class via an instance of ResourceContext.

In this article, you will learn about using the @Context annotation with Request, Configuration, Providers, and Application.

JDK 9: XXtra Command Line Options

Tue, 22 Aug 2017 16:01:01 GMT

In my last blog entry on JDK 9 compatibility, I included a list of the command line options that had been removed between JDK 8 and JDK 9. For this blog, I thought I’d do the inverse and look at the new command-line options available in JDK 9. I’m going to limit things to the less well documented –XX options, so this applies to OpenJDK code only. To construct my list, I ran the latest versions of JDK 8 and JDK 9 with the command:

java -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions

Thoughts on Opening Up Java EE

Tue, 22 Aug 2017 10:01:07 GMT

Oracle just announced opening up Java EE by planning to move its specifications, TCKs, and RIs to an open-source foundation. The reason for that is that the current process is not seen as flexible and agile enough. Oracle would “like to do better” and hopes “to address the perception about the openness […] of the current process.”

Of course, these are just plans for now. There are many questions unanswered and I don’t want to join the speculations here. However, here are some thoughts and hopes from my side.


As you might know, I’m quite involved in Java Enterprise technology. I work a lot in this area, offering consultation and workshops to my clients. I’m also involved in two JSR Expert Groups, JAX-RS 2.1 and JSON-P 1.1, both being part of Java EE 8.

The Rise and Fall of JVM Languages

Tue, 22 Aug 2017 07:01:00 GMT

Every now and then, there’s a post predicting the death of the Java language. The funny thing is that none of them writes about a date. But to be honest, they are all probably true. This is the fate of every language: to disappear into oblivion — or more precisely to be used less and less for new projects. The question is what will replace them?

Last week saw another such article on InfoQ. At least, this one told about a possible replacement, Kotlin. It got me thinking about the state of the JVM languages and trends. Note that trends have nothing to do with the technical merits and flaws of each language.

The Bean Class for Java Programming

Tue, 22 Aug 2017 04:01:01 GMT

In the courses that you take with me, I define a bean as a class used to aggregate or collect both primitive data types and other classes for modeling data in a program. Most programs require the definition of multiple elements or values to describe the data that they interact with. Rather than list each element individually, these elements are grouped together into a single class.

The original concept of a bean—called a JavaBean—dates to 1996. It was intended to be a component model for visual elements of a program. These components could then be easily manipulated by a visual modeling tool. You can read the current specification at that was last updated in 1997.

How to Intercept and Modify Java Stacktraces

Mon, 21 Aug 2017 20:01:01 GMT

(image) This ticket was triggered by a “simple” requirement: “Change all the package names in the logs of a Java application (especially the stacktraces) from ‘abc.efg’ (put whatever you want as the name) to ‘hij.klm’ (also put whatever you want to name it here, of course). The first idea that popped into my mind was to change the packages' names at the code level, but this was not feasible because of the (rather) big codebase, the use of (Java) reflection, and the tight timeline.

In the following lines, I will discuss possible solutions to implement this (weird) requirement.

Using Eclipse With Its Local Version of the JVM

Mon, 21 Aug 2017 16:01:12 GMT

Eclipse is probably the most used and de facto standard IDE for any development for ARM Cortex or any other devices. It is very easy these days to construct an unlimited and unrestricted IDE (see Breathing with Oxygen: DIY ARM Cortex-M C/C++ IDE and Toolchain with Eclipse Oxygen). Up to the point that I can pack it into a .zip file and pass it around, e.g. in a classroom environment, so no installer at all is needed with the exception of the debug probe USB drivers. As Eclipse is using a Java Virtual Machine (VM), it is a good idea to bundle the VM with the IDE, and this article is about how to do this.


Eclipse Oxygen running with its own Java Virtual Machine

RxJava 1.x to 2.x Migration: Observable vs. Observable

Mon, 21 Aug 2017 16:01:00 GMT

The title is not a mistake.

rx.Observable from RxJava 1.x is a completely different beast than io.reactivex.Observable from 2.x.

Examining Kotlin: also, apply, let, run, and with

Mon, 21 Aug 2017 10:01:01 GMT

One of the things that puzzled me when I started with Kotlin was why there were so many similar functions which call lambdas on some objects and return a value. After many lines of code and many lines of user group discussions, I found out that they represent a small DSL for easier monadic-style coding. An explanation of this DSL and the intent of each function are missing from the Kotlin documentation, so this article will hopefully shed some light on them. There is also a short style guide on GitHub.


With this function, you say “also do this with the object.” I often use it to add debugging to the call chains or to do some additional processing:

Getting to Know java.nio.file.Path (Part 1)

Mon, 21 Aug 2017 07:01:01 GMT

The last few releases of Java, namely Java 7, Java 8, and the upcoming Java 9, have quite a lot of features to make the lives of Java developers easier. (I know Java 9 will make it tougher, but only while you adopt the new paradigm. After that, it’s going to be much better).

One of the new features is the enhancement of the File API introduced in Java 7. One of the new classes of that feature set is java.nio.file.Path and its factory java.nio.file.Paths.

What Is (Part 2)

Mon, 21 Aug 2017 04:01:01 GMT

In part 1 of What is, you learned how to use the @Context annotation to retrieve HTTP Header information from an injected instance of the HttpHeaders class and how to retrieve URI information from the UriInfo instance, such as URI parameters and variables.

In this article, you will learn about using the @Context annotation with the SecurityContext and the ResourceContext classes.

RxJava: Generating Backpressure-Aware Streams

Sun, 20 Aug 2017 05:01:53 GMT

RxJava is missing a factory to create an infinite stream of natural numbers. Such a stream is useful, e.g. when you want to assign unique sequence numbers to a possibly infinite stream of events by zipping both of them:

Flowable naturalNumbers = //???

Flowable someInfiniteEventStream = //...
Flowable> sequenced =

What the Singleton Pattern Costs You

Sat, 19 Aug 2017 05:02:00 GMT

Do you use the singleton pattern? If not, I’m assuming that you either don’t know what it is or that you deliberately avoid it. If you do use it, you’re probably sick of people judging you for it. The pattern is something of a lightning rod in the world of object-oriented programming.

You can always use Stack Overflow as a litmus test for programming controversy. Someone asked “what was so bad” about singletons, and voting, responding, and commenting went off the charts. Most of those responses fell into the negative category. Outside of Stack Overflow, people call singletons evil, pathological liars, and anti-patterns. People really seem to hate this design pattern — at least some of them do, anyway.

Oracle Opening Up Java EE

Fri, 18 Aug 2017 19:16:13 GMT

There's exciting news in the Java EE world! This morning, Oracle announced that Java EE will begin a transition to open sourcing. In case you didn't see it, here was the announcement from David Delabassee on The Aquarium:

We continue to make great progress on Java EE 8. Specifications are nearly complete, and we expect to deliver the reference implementation this summer. As we approach the delivery of Java EE 8 and the JavaOne 2017 conference, we believe there is an opportunity to rethink how Java EE is developed in order to make it more agile and responsive to changing industry and technology demands.

From Nonsense Mathematics to Awesome Visualization

Fri, 18 Aug 2017 14:06:29 GMT

Visualization is always a good way to learn things faster and make sense of conceptual things such as algorithms, mathematical formulas, or physical phenomena. You may have seen a lot of visualizations created by JavaScript and some other tools other than Java. Surely, they were more beautiful in comparison with Applets or Swing-based applications. That was true in the era before JavaFX!

Nowadays, you can create fancier UIs with JavaFX more easily. In this post, I am going to show you how to convert an abstract mathematical formula to an awesome JavaFX 3D visualization.