Skip to main content

Archive

I’ll admit, my blog’s Archive section is showing its age. While those older posts were relevant when written, many are now outdated and less useful. I keep them for completeness, but readers looking for the latest info are better off checking out my newer articles outside the Archive.

Useful Code Templates for Jetbrains Idea

Jetbrains Idea is a perfect IDE (sorry, Eclipse fans). But, like every tool, sometimes it needs some customization to fit your needs. Today I want to show how to adjust it’s code-generation templates.

When you generates a new class or method using Idea, it creates one using predefined templates. You may modify that template in “Settings -> File and Code templates” section.

Modifying file

WebJars: Easy Packaging Client Libraries

When developing java web application it is often annoying to manage third-party javascript libraries. Especially, when it is necessary to upgrade some of them.

The project “WebJars” makes a life easier for such lazyefficient developers, like me :-)

There is a wide range of popular javascript libraries packaged int Jar archives and ready to be included as a dependencies into your project. It is described in the documentation how to configure resource mapping in a web framework of your choice.

Jolokia: HTTP/JSON bridge for JMX

Very often there is a need to monitor the Java application server. For example, external monitoring tool, like Nagious/Zenoss/Zabbix needs to get some metrics, like heap memory usage or thread count.

Usual way to get that metrics is to setup access to application server via JMX.

But, sometimes, it is not possible to leave some other port opened for JMX and the only port available is HTTP(80 or 8080) or HTTPS(443 or 8443).

Here the Jolokia comes to rescue!

JSON Validation with JSON Schema

JSON has became a de-facto standard for webservices, replacing XML web services. It has native support in web browser clients.

That makes JSON is the standard of choice for UI-oriented services. It has a good support on mobile devices. Also, it provides smaller data payload size compared to XML and it’s very sufficient for high-load systems as it saves a traffic. But what is for data validation? For XML web services there is a XML Schema. It comes ti mind, that similar standard for JSON should be called “JSON Schema”. And it really exists!

Links: Continuous Deployment, Versioning and Git

The post shares resources on using Git for versioning and branching, including an article on versioning Maven projects with Git, an overview of the popular GitFlow branching model, and a free Git client called SourceTree that supports GitFlow. Additional links cover Git workflows and the GitFlow project on GitHub.

Establishing Customizable Tomcat Configuration

Deploying to Apache Tomcat often requires making changes to default configuration. These changes are often environment specific. Also, when upgrading a Tomcat to new version you need to be sure that all your custom changes have not been lost and were applied to new configuration. To deal with all that stuff Tomcat via separation of the configuration. This post contains step-by-step instruction will help you to establish custom tomcat configuration.

Netty: How to Initiate SSL Handshake From Client

I have had spent some time recently making netty 3.6 sending some message when connection has been established.

What documentation suggests to do is to extend SimpleChannelUpstreamHandler and override method channelConnected(...). It works fine unless SslHandler is used in the pipeline. If handler is present, channelConnected() was never called on my handler.