Archives annuelles : 2019

GitLab application

GitLab components Summarize – ngnix : web server in front of the UI application (serve static resources and proxy to unicorn). We could have multiple instances of it : for unicor and for the container registry – unicorn : the … Continuer la lecture

Publié dans Non classé | Laisser un commentaire

Java 1.5+ : Lock API : an alternative to the synchronized keyword

Plan Synchronized keyword limitations Locking on an Object field : the premises of the lock API ReentrantLock : the basic lock ReentrantLock versus synchronized statement benchmark A scenario example where ReentrantLock can help us Synchronized keyword limitations The java.util.concurrent.locks package from … Continuer la lecture

Publié dans Non classé | Laisser un commentaire

network commands

Windows appsresmon.exe Display applications that binds a port Windows netstat -a -b -n -o | findstr 5005 Linux …. List applications Windows tasklist Linux ps -aux Kill an application Windows Taskkill /PID 9424 /F Linux kill …

Publié dans Non classé | Laisser un commentaire

Maven commands

Base Helpful Flags : -am,–also-make If project list is specified, also build projects required by the list -amd,–also-make-dependents If project list is specified, also build projects that depend on projects on the list -B,–batch-mode Run in non-interactive (batch) mode -D,–define … Continuer la lecture

Publié dans Non classé | Laisser un commentaire

Comparator : how to implement it

Plan Model to illustrate Way to never use  Way acceptable only for Java 6 and below Favor methods of built-in basic type Comparable implementations in Java 7 Favor Comparator construction methods in Java 8 This post is inspired by the … Continuer la lecture

Publié dans java, java 8 | Laisser un commentaire

Defining a custom Collector in Java 8

Plan Reasons to write its own collector The requirement to illustrate : a collect that cannot be done straightly with built-in Stream/Collector methods Implementing it with built-in collectors but without extracted functions is terrible Implementing it with built-in collectors and … Continuer la lecture

Publié dans Non classé | 3 commentaires

The builder pattern (not the builder design pattern) in Java

Plan Builder pattern, builder design pattern, fluent API. Are these the same thing ? When do we want to consider the builder pattern? A simple builder The same builder with consistency checks Builder with inheritance Disclaimer : Sure that we … Continuer la lecture

Publié dans Non classé | Laisser un commentaire