Category: Java


17 May 2017 / / Scala / Akka / Java
We all know the classic Consumer-producer programming exercise. There is even an entire wiki page available for it. In this article, I start out with the classic implementation that is used in the Java land. Although there is nothing wrong with this approach, some issues can arise when using this implementation. What happens if we do not have control over the producer and want him to wait with sending new data to use (Backpressure), Errors during the processing (Fault tolerance)
18 November 2016 / / Java / Howto
This post describes a implementation for streaming a String of space separated Key Values with Java 8. In order to implement a streaming keyvalue reader two simple classes are implemented. One to handle navigation in the string and one to make a Iterable from the String. The implementation I provide is basic but has enough extension points to meet more extensive requirements. The problem. We all have faced the same problem when dealing with data from other sources.
This post is part of a multipart series about creating a graph off all available Maven dependencies. In the article for the Neo4j extension I described the input for the extension. This article describes the model that is used to create the required JSon. I start of with a small introduction to Vertices and edges before going into the implementation. Vertices and Edges In mathematics, and more specifically in graph theory, a vertex (plural vertices) or node is the fundamental unit of which graphs are formed: an undirected graph consists of a set of vertices and a set of edges (unordered pairs of vertices), while a directed graph consists of a set of vertices and a set of arcs (ordered pairs of vertices).
This post is part of a multipart series about creating a graph off all available Maven dependencies. Resolving maven dependencies is something we in general leave to our dependency management system, Maven, Ivvy, …. For the purpose to the application we are developing we required a detailed control on how the the dependencies are resolved and the JSon representation of this sub-graph. I start off with a short intro on where to find documentation on the Maven resolving mechanism and then go into the details for each of the parts that are required to do so.
07 October 2016 / / Maven / Java / Howto / Github / neo4j
This post is part of a multipart series about creating a graph off all available Maven dependencies. This article describes the drivers behind and the implementation of the Unmanaged Neo4j Extension written for our Maven graph analysis. When a the processing cluster is sending the sub graphs that need to be merged into a single database locking issues will occur. We opted to use a queuing mechanism to prevent. From the choices we had to implement this as a component for the Neo4J server we choose to this as a unmanaged extension.
Video of code & comedy Recently Casper Koning and myself did a presentation about machine learning and motion sensors titled: Are you doing it the right way. The presentation explains the steps we have taken on how to utilize a motion detector and machine learning to predict the execution of an exercise. The general idea behind it is that when a subject does a exercise a feedback is required in order to do it efficiently and correctly.
10 February 2015 / / Maven / Java / JAX-WS
The latest JAX-WS standards make the implementation of a webservice a breeze. lately i needed to implement a client from which a WSDL is available. That proces is simple, but the client has issues when starting, the WSDL defined in the generated code is not available. In this post i describe a (the) solution to overcome this. By means of the maven jax-ws plugin it is simple to generate all the required code for the client implementation.
23 December 2014 / / Java / fun
For Java: After importing java.awt.right.foot.* import java.awt.gun.right.hand.* And writing the classes and methods of those classes needed, you’ve forgotten what the hell you’re doing.  More languages can be found at: The real mighty Guru
05 September 2014 / / Java / JAX-WS
Since the introduction of the JAX-WS in Java EE building SOAP web-services have never been easier (as compared to i.e. Spring WS). Just a few annotations and you are up and running. Disadvantage of this all is that it always goes from a Contract first or Java first approach. While in a lot of environments this is the case, situations are there when its a mixed case. Just recently I ran into the mixed case.
15 April 2014 / / Java / ME
In the previous post I started out happy on enrolling with the Embedded course from Oracle. But i got hit in the face for not running a Windows-based development environment. A well installing a VirtualBox is not that hard i thought. To be honest it is once you figured out all the specifics. The following is a list of actions I performed to get it up and running. Install VirtualBox The site actually provides an excellent description on how to install it on a Debian based system.
08 April 2014 / / Java / ME
Just recently I showed interest for the oracle class for Java Embedded. Since I always had an interest for hardware and similar things I thought this is an opportunity. Getting the hardware imposed to be a problem. The preferred supplier could not deliver the goods in any reasonable time frame, or at least I was told so by a colleague. But my employer arranged a study group. They even supplied us with the required hardware.
07 March 2014 / / Java / CDI / EE
Since the introduction of Java CDI container my focus is on building applications without the usage of any Spring libraries. It’s not that I do not like Spring, but since CDI I don’t really need a heavy weight DI container in my application anymore. When looking at EE 7 even more of the stuff that is provided by Spring comes out of the box. One thing that I do miss in the EE specification is the handling of properties.
Today I needed some performance improvements on a application that makes quite a few calls to a database. My default statement is not to implement performance improvements unless there is a issue. Well it just happened. I did not wanted to change any of the existing code so what to do. In Spring 3.x the added a caching mechanism. Implementing this is simple: @Configuration @EnableCaching public class SpringConfiguration { /** * Name of the available Cache */ public final static String CORE_CACHE = "default"; /** * Creates a in memory cache using a concurrent HasMap.
20 November 2012 / / Java / EE
Just a few days ago I attended the DEVOXX conference in Belgium. The last session I attended was from Adam Bien’s session Real World Java EE. As usual i was amazed by the speed and manner of presentation performed by Adam. Just 5 slides and the rest is on the keyboard and a IDE. Juggling between questions from the audience and the message he wants to be passed. Besides that I was triggered (and more people I think) by the statement that he does not use the private keyword anymore.
For the umpteenth time I have been asked, do you like refactoring? The answer yes I like doing it. when reading books like Clean Code: A Handbook of Agile Software Craftsmanship, The Clean Coder: A Code of Conduct for Professional Programmers and The Art of Readable Code it becomes clear that refactoring is a something you need to learn. It’s not about the language specifics, any body can learn the language.
It took me some time to get all for the annotation builder into central but it’s there. see previous article for details on usage Insert the following dependencies to your maven build: <dependency> <groupId> nl.elucidator.patterns.builder.annotations </groupId> <artifactId>builder-annotations-processor</artifactId> <version>1.0.0</version> </dependency> <dependency> <groupId> nl.elucidator.patterns.builder.annotations </groupId> <artifactId>builder-annotations</artifactId> <version>1.0.0</version> </dependency> <dependency> <groupId>net.jcip</groupId> <artifactId>jcip-annotations</artifactId> <version>1.0</version> </dependency> And you can generate all your builders.
I Think every body should know their patterns. the GoF created that book a long time ago but still not every body knows them by heart? One of the patterns that is becoming more prominent in the ever-changing world is the requirement for immutable objects grows. The definition found in the books: Defines an instance for creating an object but letting subclasses decide which class to instantiate Refers to the newly created object through a common interface Well that’s not exactly what we right?
25 April 2012 / / Maven / Java / OSS / Sonatype
Ever had a project that you want to share with every body and not want them to get your source code, build and install it public repository? For quite some time there you can do this. Just visit the url: follow all the instructions and within 3 days you are up and running and publishing you own artifact in the maven public repository.  Note: When using a linux environment with github as a scm read: http://help.