For some time now I’ve been thinking about all the different approaches that I have seen and heard with the goal of zero-downtime deployment for a horizontally-scaled application that relies on a database or some form of persistent storage. On most of the projects that I have worked on this was not a requirement, although a speedy and automated deployment was preferred. However, other projects were for websites and applications that formed the backbone of a 24/7 company and as such the idea of even a couple of minutes downtime was unacceptable....
For Ivy:
<dependency org="com.tomczarniecki" name="spring-stringtemplate" rev="1.5.1" /> For Maven (yeech):
<dependency> <groupId>com.tomczarniecki</groupId> <artifactId>spring-stringtemplate</artifactId> <version>1.5.1</version> </dependency> Thank you Sonatype....
I've released a new version of my S3DropBox on GitHub. I've moved the project to GitHub so that I can have all my current active projects in one place. Check it out in its new home at https://github.com/tomcz/s3dropbox.
This release uses the AWS java libraries. They are finally good enough for me to stop creating my own wheels and vulcanising my own rubber. As a bonus the S3DropBox creates URLs in virtual hosted format (eg....
For the longest time I’ve been writing Java build files in XML and I’ve always felt a little dirty. Not too long ago I was re-introduced to rake by a colleague (thanks Fabio) and how nicely it integrates with ant.
This means that you can now turn this:
<project name="spring-conversations" default="build" basedir="."> <property name="src.dir" location="src/main" /> <property name="test.dir" location="src/test" /> <property name="build.dir" location="build" /> <property name="dist.dir" location="${build.dir}/dist" /> <property name="report.dir" location="${build....
Not that long ago I gave a ThoughtWorks geek night presentation on Post-Redirect-Get and how to mess with the Spring Framework to make it happen. I've put up the presentation and the code that I used for it on GitHub. Feedback is always welcome....
Caffeine is my shepherd; I shall not doze.
It maketh me to wake in green pastures;
It leadeth me beyond the sleeping masses.
It restoreth my buzz;
It leadeth me in the paths of consciousness for its name's sake.
Yea, though I walk through the valley of the shadow of addiction,
I will fear no Equal™;
For thou art with me; thy cream and thy sugar they comfort me.
Thou preparest a carafe before me in the presence of The Starbucks;...
Another update to my S3DropBox. Due to popular demand (ahem) I've added a progress bar to track uploads and downloads. You now have something pretty to watch rather than a screenful of dots. Any other requests?...
Here is how I set up the Apache Ivy dependency manager so that it can fetch springframework JARs from the SpringSource Enterprise Bundle Repository.
Listing: ivysettings-custom.xml
<ivysettings> <resolvers> <url name="com.springsource.repository.bundles.release"> <ivy pattern="http://repository.springsource.com/ivy/bundles/release/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" /> <artifact pattern="http://repository.springsource.com/ivy/bundles/release/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" /> </url> <url name="com.springsource.repository.bundles.external"> <ivy pattern="http://repository.springsource.com/ivy/bundles/external/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" /> <artifact pattern="http://repository.springsource.com/ivy/bundles/external/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" /> </url> <chain name="spring"> <resolver ref="com.springsource.repository.bundles.release"/> <resolver ref="com.springsource.repository.bundles.external"/> </chain> <ibiblio name="jboss" root="http://repository.jboss.org/maven2/" m2compatible="true"/> <chain name="main" dual="true"> <resolver ref="shared" /> <resolver ref="public" /> <resolver ref="spring" /> <resolver ref="jboss" /> </chain> <chain name="default" returnFirst="true"> <resolver ref="local" /> <resolver ref="main" /> </chain> </resolvers> </ivysettings> Listing: ivysettings....
HTML is notoriously difficult to parse and it has usually been a pain to do this in Java. Yes I know that there are parsers (like jtidy and nekohtml) that try to create a proper DOM but I’ve been waiting for something more lightweight.
Enter Jsoup. It feels like a mix of JQuery and Beautiful Soup (for Python).
String html = response.getContentAsString(); Document document = Jsoup.parse(html); Elements elements = document.select("#errorRef"); assertThat(elements....
StringTemplate is a great templating engine. It's powerful, simple and quite opinionated. I've come really appreciate its simple purpose: render data. No assignment, no arbitrary method invocation. It is not Turing-complete and it would make a lousy rules engine.
SiteMesh is a web-page layout and decoration framework that is my current "golden hammer" when I need to provide a consistent layout across a java web-application. It seems to fit with the way that I think about web pages a whole lot more than something like Tiles - I really prefer decoration over composition as a means of layout control....