Home » Author Archives: Roger Hughes (page 4)

Author Archives: Roger Hughes

Spring Framework: Three Spring Bean Lifecycle Techniques

spring-interview-questions-answers

When using the term ‘lifecycle’ the Guys at Spring are referring to the construction and destruction of your beans and usually this is in relation to the construction and destruction the Spring Context. There are those occassions when the management of your bean’s lifecycle is not a trivial task as there’s the need for it to perform its own internal ...

Read More »

Synchronising Multithreaded Integration Tests

java-interview-questions-answers

Testing threads is hard, very hard and this makes writing good integration tests for multithreaded systems under test… hard. This is because in JUnit there’s no built in synchronisation between the test code, the object under test and any threads. This means that problems usually arise when you have to write a test for a method that creates and runs ...

Read More »

Super Quick Tomcat App Deployment Using a PULL Script

apache-tomcat-logo

If you managed to read my last blog you’ll remember that I demonstrated a simple script for creating a new tomcat installation on a server by splitting the tomcat binaries from the conf files, storing the binaries on a FTP server and the conf files in version control, with a script recombining the two parts.           ...

Read More »

Super Fast Tomcat Installation using FTP and Version Control

apache-tomcat-logo

When talking about Continuous Delivery one of the tests that both Martin Fowler and Jez Humble often mention is their ‘flame thrower’ test. It goes something like this: Jez will say ‘How long would it take you to get up and running if Martin and I went into your machine rooms armed with flame throwers and axes and started attacking ...

Read More »

Securing your Tomcat app with SSL and Spring Security

apache-tomcat-logo

If you’ve seen my last blog, you’ll know that I listed ten things that you can do with Spring Security. However, before you start using Spring Security in earnest one of the first things you really must do is to ensure that your web app uses the right transport protocol, which in this case is HTTPS – after all there’s ...

Read More »

Ten Things You Can Do With Spring Security

spring-security-logo

One You can specify the authorisation provider of your choice in your Spring XML config file. You do this by configuring an authentication-manager as defined in Spring’s http://www.springframework.org/schema/security/spring-security-3.1.xsd schema. The simplified authentication-manager element definition looks something like this:           <xs:element name='authentication-manager'> <xs:complexType> <xs:choice minOccurs='0' maxOccurs='unbounded'> <xs:element name='authentication-provider'> <xs:complexType> <xs:choice minOccurs='0' maxOccurs='unbounded'> <xs:element ref='security:any-user-service'/> <xs:element name='password-encoder'>...</xs:element> </xs:choice> <xs:attributeGroup ref='security:ap.attlist'/> ...

Read More »

Investigating Deadlocks – Part 5: Using Explicit Locking

java-logo

In my last blog I looked at fixing my broken, deadlocking balance transfer sample code using both Java’s traditional synchronized keyword and lock ordering. There is, however, an alternative method known as explicit locking. The idea here of calling a locking mechanism explicit rather than implicit is that the explicit means that it is not part of the Java language and that classes have ...

Read More »

Investigating Deadlocks – Part 4: Fixing the Code

java-logo

In the last in this short series of blogs in which I’ve been talking about analysing deadlocks, I’m going to fix my BadTransferOperation code. If you’ve seen the other blogs in this series, you’ll know that in order to get to this point I’ve created the demo code that deadlocks, shown how to get hold of a thread dump and then analysed ...

Read More »

Investigating Deadlocks – Part 3

java-logo

In my previous two blogs in this series, part 1 and part 2, I’ve demonstrated how to create a piece of bad code that deadlocks and then used this code to show three ways of taking a thread dump. In this blog I’m going to analyze the thread dump to figure out what when wrong. The discussion below refers to ...

Read More »
Do you want to know how to develop your skillset and become a ...

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!
Get ready to Rock!
To download the books, please verify your email address by following the instructions found on the email we just sent you.

THANK YOU!

Close