Securing an Apache Ignite cluster

Steve Neal Development, Java Programming 4 Comments

I’ve been building a data grid at an investment bank using Apache Ignite and have had a tough time securing it. The documentation for Ignite is really very good but doesn’t touch on how to secure a cluster at all. In this blog I’ll give an overview of how to secure a cluster in the hope that it will prove …

A genuinely type safe Map for Java

Steve Neal Java Programming Leave a Comment

The problem: As much as I love generics in Java, it is still necessary to employ evil casts when retrieving different data types from a Map; see lines 13, 14 and 15: Did you spot the bug in this example? The compiler would have missed it. Ideally, I’d much rather work with code like this: In addition to the casts …

Putty and the disappearing cursor

Steve Neal Tool support, Uncategorized Leave a Comment

I’ve had this problem with Putty on and off for years. It’s default black background commonly hides the windows text cursor when the mouse rolls over the terminal window. When this happens I need to rummage around on the internet to find a solution, so I thought I’d make a note of it here on my blog this time instead. …

Providing a default exception handling strategy in Java applications

Steve Neal Development, Java Programming 2 Comments

When writing a Java application you may need to consider how that application should react when an uncaught exception is encountered. Generally, when an exception is not handled, the threads stack trace is printed to the error stream and the throwing thread dies; potentially causing the application to shut down if there are no other active (or daemon) threads running. …

Adding the application name to links in a Web application

Steve Neal Development Leave a Comment

Application servers can run a number of applications. A single Tomcat instance, for example, will create a separate web application for each WAR file it finds in its webapps directory. The applications will be named the same as their WAR files and can be accessed using URLs that start with that name. For example, to access index.jsp in the root …

Searching for files in an Ant script

Steve Neal Development, Tool support Leave a Comment

This is a simple technique for determining whether or not files matching a given pattern exist within your project. Unlike the available task, this does not require that you need to know the exact name of the file when creating the build file. It is therefore very useful for checking existence of generated/downloaded artefacts. I’ll demonstrate the technique with an …

Adding a thread timeout to methods in Java

Steve Neal Development, Java Programming 1 Comment

When calling a method that could potentially take longer that you’d like to complete, it is possible to write code that will back out after a given time period. This can happen in numerous circumstances where you’d like an application to maintain a degree of liveness. I’ve used it recently in an application that needed to run a number of …

What info can you get from an HttpServletRequest?

Steve Neal Development, Java Programming Leave a Comment

There are many methods on an HttpServletRequest, and if you’re anything like me, you’ll forget exactly what each of them returns. Rather than a long winded investigation into them all, here’s a sample URL: https://localhost:8443/test/welcome?a=1&b=2 The ‘/test’ in the URL will map to a servlet called test. The servlet will dispatch the request to a JSP for rendering that has …