00 - About

Introduction

A small set of Java utility libraries.  Originally developed in-house at Foreach and used throughout many projects.  See the library overview below for a short list of available functionality.

Release overview


ReleaseDocumentation
1.1 CURRENTJavadoc

JDK 7+Minimum requirements

  • Spring framework 3+ (depends on libraries used)

Artifact repository

Releases are available in Maven central.  Groupid is com.foreach.libs.

<dependency>
  <groupId>com.foreach.libs</groupId>
  <artifactId>common-*</artifactId>
  <version>1.1</version>
</dependency>

Snapshots are available on the Foreach public artifact repository.

<repositories>
    <repository>
        <id>foreach-nexus</id>
        <name>Foreach nexus</name>
        <url>http://repository.foreach.be/nexus/repository/public/</url>
    </repository>
</repositories>

Library overview

Different utilities are packaged in separate libraries:

common-concurrent

Contains a number of concurrency related constructs.  Most important are the ObjectLockRepositoryand the DistributedLockRepository.  The former provides an easy way to link a lock to a domain object, the latter is a simple JDBC based implementation for creating distributed locks.

common-spring

A diverse set of small utilities:

common-test

Contains the MockedLoader implementation, an extension for Spring and Mockito unit testing that automatically generates mocks for all undefined bean dependencies.

common-web

Most notable are the ExceptionToMailResolver that automatically send mails with exception information, and the RequestLogInterceptor that tags every web request with a unique id for logging purposes

Quick links

Foreach.be | Twitter | Source (Bitbucket) | Issues (JIRA) | Javadoc

News & blogs

The problem We all love unit testing and Spring's JavaConfig. And we certainly dig them beans, however for unit testing we need to mock or instantiate our beans with Test @Configuration classes (or reuse existing @Configuration classes). In the case of mocking, we might see that adding an extra @Autowired dependency in e.g. a Service class, might break some tests...well .. sometimes a lot of tests. After fixing those, we might see more broken tests ...…
One important bugfix and 2 useful additions. Release should be fully backwards compatible.
See the original news message we published http://www.foreach.be/blog/open-sourcing-our-common-java-libraries.  Both the public Confluence space and JIRA have been initialized.  The Confluence documentation has been cleaned up when migrating from our internal Confluence.

Recent updates

https://repository.foreach.be/javadoc/common-projects/1.0/