Wednesday, November 24, 2021

JavaFX and GraalVM

 JavaFX in the new era of GraalVM

Gluon Substrate takes away most of the complexity of using GraalVM Native Image. You can create an app in Java, test it on your desktop, and then compile and link the Java bytecode to a native image for a specific platform by defining a profile in Maven. The resulting binary can be deployed to the AppStore or Google Play. For a short intro on how this works, see this video about creating an app for iOS using the Gluon plug-in in Netbeans.

It’s needless to say that GraalVM Native Image opens an abundance of opportunities for JavaFX. Let’s take a look at the impact this evolution could have on the development of mobile applications.

Thursday, February 28, 2019

JavaFX pane for scaling arbitrary content nodes

JavaFX pane for scaling arbitrary content nodes (used in Vworkflows) by applying scale transformations. The ScalableContentPane scales its content to always fit the container bounds.

Saturday, November 17, 2018

AspectJ tutorials

AspectJ and AOP – The black magic of programming

AspectJ – Dictionary


The easiest way to describe aspects is as a funky Java Class. An Aspect contains other things than a normal class such as; pointcuts, advice, advice bodies and inner-type declarations. An aspect may also contain regular java classes and methods.


Defines, in a multitude of different ways, a point in the code. The pointcut defines when an advice should be run.

Advice / Advice Body

Similar to a java method; contains the code that will be run once a pointcut has been triggered.

Annotation – Not AOP specific

Consists of meta-data and can be used at methods, classes, parameters, packages and in variables.
Annotations can contain an optional list of element-value pairs, such as ‘yourProperty = “someValue”‘ in the example above. In AspectJ we can define a pointcut by looking for annotations. The pointcut and advice can then use the element-value pairs from the annotation.

Weaving / Aspect weaving

There are a few different ways to inject the AOP code in our application, but one common denominator is that they all require some type of extra step to be applied to our code. This extra step is called weaving.

Compile-time weaving

If you have both the source code of the aspect and the code that you are using aspects in, you can compile your source-code and the aspect directly with an AspectJ compiler.

Post-compile weaving / Binary weaving

If you can’t, or don’t want to use source-code transforms to weave the aspects into the code, you can take already compiled classes or jars and inject aspects.

Load-time weaving

Acts the same way as post-compile weaving / binary weaving but waits to inject aspects into the code until the class loader loads the class file. This requires one or more weaving class loaders.

Saturday, September 22, 2018

Friday, September 7, 2018

ByteBuffer flip vs rewind

flip() makes it ready for write() (or for get())
         rewind() makes it ready for read() (or for put())

get() Example;
You might want to read data from the buffer (assuming that you had initially stored it in there)and use it for something else such as converting to a string and manipulate it for further use.
ByteBuffer buf = ByteBuffer.allocateDirect(80);
private String method(){
byte[] bytes = byte[10]; //creates a byte array where you can place your data 
buf.get(bytes); //reads data from buffer and places it in the byte array created above
return bytes;
write() Example; After you have read data from socket channel into the buffer you might want to write it back to socket channel - assuming that you want to implement something like a server that echos same message received from client.
So you will read from channel to buffer and from buffer back to channel
SocketChannel socketChannel =;

ByteBuffer buf = ByteBuffer.allocateDirect(80);

int data =; // Reads from channel and places it into the buffer
while(data != -1){ //checks if not end of reading
buf.flip();        //prepares for writing
socketChannel.write(buf) // if you had initially placed data into buf and you want to read 
                         //from it so that you can write it back into the channel


Saturday, July 7, 2018

How to build smaller Docker containers

In this episode of Kubernetes Best Practices, Sandeep Dinesh shows how you can build small containers to make your Kubernetes deployments faster and more secure. See the associated article here → Google Container Registry → Google Container Builder → Container Registry Vulnerability Scanning → Google Kubernetes Engine → Docker Multistage Builds →

Tuesday, June 26, 2018

Lambda expression performance

An anonymous inner class (AIC) is a class, which means that it has scope for variable defined inside the inner class.
Whereas,lambda expression is not a scope of its own, but is part of the enclosing scope.
 At runtime anonymous inner classes (AIC) require class loading, memory allocation and object initialization and invocation of a non-static method while lambda expression is pure compile time activity and don’t incur extra cost during runtime. So performance of lambda expression is better as compare to anonymous inner classes.**