Java
Cayenne in a Minute
Cayenne is a powerful Java Object Relational Mapping framework. It’s open source and completely free. One of the main Cayenne distinctions is that it comes with cross-platform modeling GUI tools. This places Cayenne in the league of its own, making it a very attractive choice over both closed source commerical products and traditional “edit your own XML” open source solutions.
JSF Basics
This is a brief tutorial that takes a quick look at some of the very basics of JSF, how we define pages and hook them up to server side objects. Rather than cover the fundamentals of starting a new JSF application, I’m going to start from one of the Knappsack archetypes which can provide you with a JEE 6 application ready to roll. In this case, we are going to start with a servlet based example so you can run it using the embedded servlet containers.
Further Delays in JDK7: Which Plan Would You Choose?
In his latest blog entry , Mark Reinhold, Chief Architect of the Java Platform Group, explains how the current schedule for JDK7 is unrealistic.
Following the Oracle acquisition, there were some delays in integration that slowed things down. Mark explains that there are two plans at the moment:
Open Source Android Apps for Developers: Android-bluetooth
Android-bluetooth(Experimental unofficial Bluetooth API for Android) is an open source Android project which aims to provide a simple API to access Android’s Bluetooth stack. This library does not to require a rooted device: it is intended to work with standard firmware provided by phone manufacturers.
Show ProgressBar in Notification Area
When you download from the Market you get informed about the progress in the download area.
That's a really nice feature, which you may want for your own download or processing progress. I will show you the basics of generating such a Notification. All you need to do is add it to your code.
Your Cross-Cutting Concerns are Someone Else's Core Domain
Consider a domain, for example an online bookshop project that we call BuyCheapBooks. The Ubiquitous Language for this domain would talk about Book, Category, Popularity, ShoppingCart etc.
Java EE 6 Update 1 with JDK 6 U21 - and Using the Update Tool
A description of the new JavaEE 6 SDK w/ JDK bundles, and, probably more useful, how the update process looks in the new world of GlassFish 3 IPS packages.
Thinking, Speaking & Dreaming about Technology: An Interview with Michael Hüttermann
First in a series of interviews dedicated to learning more about JetBrains Development Academy Experts. In this interview we have a conversation with Academy Board Member Michael Hüttermann. Michael is Cologne JUG leader, author, senior coach, consultant, and freelancer for Java/JEE, SCM/ALM and agile software development.
Java Concurrency – Part 6 : Atomic Variables
A Simple Transactional File JCA 1.5 Connector (4 Classes / 2 Reusable)
There is a common prejudice that JCA connectors have to be too complicated for day to day use. "Custom & lightweight" solutions are built instead, which are usually orders of magnitudes more complex, than a pragmatic JCA implementation. So, how to built one:
- JCA connectors are deployed as .rar archives with internal structure similar to ejb-jar archives. You can reuse your existing packaging and just change the ending from .jar to .rar
- Start with the ra.xml deployment descriptor. You "only" have to implement the elements listed in this deployment descriptor:
</connector>
- GenericManagedConnectionFactory and GenericManagedConnection are mostly reusable. These classes care about connection management. You will be able to manage a connector through e.g. the Glassfish admin console. The code is surprisingly simple - its mainly book keeping and logging. See http://kenai.com/projects/javaee-patterns/, project GenericJCA.
- The "core" business logic resides in the FileConnection:
The nice thing are transaction callbacks. You will be notified about the transaction progress by the container. At commit time, you just write the buffer to the file - in case of a rollback you have to clear the buffer. This sample is not fully transactional - because in general you will have to deal with corrupted files etc. - but it should be clear how it works.
After installation, you will be able to inject the interface (and so the FileConnection) to your business logic.
@Stateless
public class JCAClientBean implements JCAClientRemote {
@Resource(mappedName="jca/FileFactory")
private DataSource dataSource;
...and the transactions will be propagated transparently for you.
JCA connectors are not as lean as simple as EJB 3.1 or CDI, but orders of magnitude more robust and more maintainable, than solutions and workarounds which are usually built instead.
You will find a working example (tested with Glassfish v2) in http://kenai.com/projects/javaee-patterns/. See GenericJCA, GenericJCAAPI and JCAClient projects. I described this solution in dedicated chapter "Generic JCA", page 181 in Real World Java EE Patterns - Rethinking Best Practices".
The example presented here is based on the ancient Java EE 5 technology. JCA 1.6 connectors are lot simpler and more elegant - stay tuned.
Cloud Computing with Scala and GridGain
The presentation is devoted to live coding demonstration of writing basic MapReduce application in Scala using GridGain middleware.
My first steps with Gradle: creating a multi module java web project and running it with jetty.
I am a experienced maven user. Sometime I love it, sometimes I hate it. I like it a lot better than ant, but in some situation you would like maven to be easier and more descriptive. The past year there was a lot of fuzz about Gradle. This would give you the best of ant as well as the best of maven, and even more. My first encounter was not very positive, but I kept it in my mind to try it later with a more serious project. This blogpost is about that second more serious try. It will not teach the gradle experts anything, but it will be an easy introduction in to what gradle has to bring for people that are just interested in gradle.
Ext GWT or SmartGWT or Vaadin
My journey continues. Deciding on a RIA framework is harder than i thought because of the existance of many quite good approaches. First i checked ExtJS but as mentioned in my previous post, we wont want to write 80% of our app in javascript. So i came to Ext GWT which was the more viable option. Then someone pointed me to vaadin, which works by handling events on the server by widget network communication. But after seeing some limitations on the widget part of vaadin, i also checked SmartGWT, which is definitely the widget monster. You simply get everything you can imagine.
Workaround to Multi Threaded Testing
Since it has been introduced in JDK 1.5, I have loved the Executor abstraction over multi threaded execution. Basically you define tasks, implementing Runnable or Callable interfaces, and you submit those tasks to an Executor implementation. It's the Executor who knows how the tasks must be processed: scheduled at a certain time, enqueued in a separate single thread or using a thread pool. Different instances of Executor can be obtained through the Executors class.
Oracle "Leaning Heavily" Towards JDK 7/JDK 8 Feature Split
We've all known for some time that the JDK 7 development schedule was a bit too ambitious given the sudden addition of closures and the re-structuring after the Oracle acquisition. Having been written 'pre-acquisition', the initial JDK 7 roadmap looked unrealistic even in late 2009. So what does this mean? More delays? Not necessarily, says Mark Rienhold.
JPA Compound Primary Keys Explained
Beans Should Be Deprecated - The Future of Object Architecture With Properties
In my previous post I discussed the case for Properties and the basics of how they work. In this post I will dive into the specific workings of Properties in Sgine and how to use the various features it provides. This post is all about Properties in Sgine for use primarily with Scala but the concepts and ideas are applicable to Java as well. Properties provide the future of object architecture and beans should have been deprecated long ago.
Re-thinking JDK 7
"It’s been clear for some time that the most recent JDK 7 development schedule is, to put it mildly, unrealistic."
So:
"Plan A: JDK 7 (as currently defined) Mid 2012
Plan B: JDK 7 (minus Lambda, Jigsaw, and part of Coin) Mid 2011
JDK 8 (Lambda, Jigsaw, the rest of Coin, ++) Late 2012"
