Sep 13, 2017

Easy event bus for your Java applications

I'll show you how to use simple event bus, that is suitable for any Java application and can be seamlessly integrated with spring or any other DI framework.

This is MiniBus project:

You may wonder why you should use this event processing bus instead of other implementation from big companies? The answer is, because it follows KISS principle (Keep It Simply, Stupid). It contains only several hundreds lines of code. Every one can read it, understand it and modify it.

If you do not really know why you need event bus, than maybe your app is small and does not require publishing/handling events flow.

Jan 12, 2017

Sony SRS-X55 how to fix huge bass and sub-woofer rattling

If you are owner of portable speaker Sony SRS-X55 you may found that despite of height sound quality it has one major downside - tremendously huge bass. And this also implies sub-woofer rattling on bass peaks. From my point of view Sony engineers screwed up here really bad.

But there is a good news - you can fix this. In order to do this, your hands must grow from the right place and you should be familiar with soldering stuff.

Jul 1, 2015

Creating custom JSF components or widgets library

If you are using JSF you can easily move some parts of your code and widgets/components into external library. Here I will describe how to do in quick and correct way.

In this particular example I will show you how to create your own JSF converters library, but you can use this approach to make any other JSF libraries. You can see complete example of working JSF library here

Jun 5, 2015

Mybatis support for Java 8 time (JSR 310)

Mybatis is pretty cool library for mapping your database queries. Unfortunately it does not know anything about Java8 time API (JSR 310). Thus you can not yous in your POJO new date/time types like LocalDate, LocalDateTime, ZonedDate, ZonedDateTime etc.

You can solve this problem by creating your own mapper for mybatis, or you can use mappers I have created.

Jun 2, 2015

Synchronize code over multiple JVM instances on the same machine

Several years ago I had to build Java application which can have only one running instance on same computer. This leads me to idea using file lock to block other application instances from running.
Not so long ago I have extended this locking functionality and publish it as artifact absolutely with no reason.

Apr 21, 2015

JSF view scope for Spring beans

Hello everyone.

If you are using JSF with spring beans, than you may notice that there are no alternative for JSF view scope for spring beans.

If you will try to add JSF annotations to Spring beans - you will fail. It will not work because native JSF  beans actually have another context environment than spring. Thus all JSF annotations and configuration from faces-config.xml can not be applied to Spring beans.

Jan 2, 2015

Howto run only single Java application instance

Sometimes in software development you need to run only one application instance. If you want to do this in Java you will have to think about realization, because this feature is not implement in the standard Java language library. I've found 2 basic approaches to make it work. They are based on port lock and file lock concepts.

My code is based on the file lock idea, because I think that port lock usage is not really reliable because of possible conflict in ports usage. I was trying to create really reusable piece of code :) which can handle cross application and cross platrom lock.