Home » Java (page 601)

Java

Using a ThreadPoolExecutor to Parallelize Independent Single-Threaded Tasks

The task execution framework, introduced in Java SE 5.0, is a giant leap forward to simplify the design and the development of multi threaded applications. The framework provides facilities to manage the concept of task, to manage thread life cycles and their execution policy. In this blog post we’ll describe the power, the flexibility and the simplicity of this framework ...

Read More »

LeWeb – 2011 – Round up

Just a couple of hours before I head up to the airport, I will write my last post related to LeWeb. This time I will focus on the conference itself. Having attended a few developer conferences (not much but enough to give you some sort of experience) I have developed my own custom framework of rating a conference. I use ...

Read More »

Oracle JRockit Mission Control 4.1 released

Oracle released a new version of their former JRockit-only tooling Mission Control Suite (JRMC). The 4.1 version is a minor version upgrade which directly follow the 4.0.1 which was released way back middle 2010. But even if the version number indicates, it’s a minor upgrade, you still find tons of new features in it. JRMC is a set of plug-ins ...

Read More »

Overload API methods with care

Overloading methods is a strong concept in API design, especially when your API is a fluent API or DSL (Domain Specific Language). This is the case for jOOQ, where you often want to use the exact same method name for various means of interaction with the library. Example: jOOQ Conditions package org.jooq; public interface Condition { // Various overloaded forms ...

Read More »

Reusing Generated JAXB Classes

In this post I will demonstrate how to leverage the –episode XJC extension to reuse classes previously generated from.an XML schema. This is useful when an XML schema is imported by other XML schemas and you do not want the same classes generated each time. Imported Schema (Product.xsd) The following XML schema represents basic information about a product. Product is ...

Read More »

Spring GWT Integration using the RequestFactory API

Beginning from GWT 2.4 the integration of the RequestFactory API with Spring services on the backend is easy all you need to do is create a custom ServiceLocator on your server which will be used by GWT to locate properly the called services :                 public class SpringServiceLocator implements ServiceLocator { public Object ...

Read More »

The persistence layer with Spring 3.1 and Hibernate

1. Overview This article will show how to implement the DAO with Spring and Hibernate. For the core Hibernate configuration, see the articles about Hibernate 3 and Hibernate 4 with Spring. 2. No More Spring Templates Starting Spring 3.0 and Hibernate 3.0.1, the Spring HibernateTemplate is no longer necessary to manage the Hibernate Session. It is now possible to make ...

Read More »

Configure LogBack Logging with Spring

LogBack is an API for logging created by the same author of Log4j (a newer implementation, it is like a new version), during this article I’m going to show how to integrate it and use it on a Spring project. On this tutorial I assume you are using a simple Spring ROO project which will prepare all the structure of ...

Read More »

Cloning of Serializable and Non-Serializable Java Objects

Frequently developers rely on 3d party libraries to avoid reinventing the wheel, particularly in the Java world, with projects like Apache and Spring so prevalent. When dealing with these frameworks, we often have little or no control of the behaviour of their classes. This can sometimes lead to problems. For instance, if you want to deep clone an object that ...

Read More »