EJB3
From Mugshot Developer Wiki
EJB3 expands to Enterprise Java Beans 3, a technology implemented by JBoss and used in the implementation of the Mugshot server.
What Java programmers mean by "bean".
EJB3 is a much-simplified replacement for previous versions of Enterprise Java Beans. It uses Java 5 annotations throughout, rather than annoying configuration files. The EJB3 Persistence layer provides a simple interface for data access implemented in JBoss by Hibernate, while EJB3 "proper" provides a framework for encapsulating procedural code ("business logic").
Documentation we would recommend on EJB3 includes:
- The specification at jcp.org, in particular the files "persistence" and "simplified" ("ejbcore" is more for people implementing the spec than people using it)
- The EJB3 Trail on the JBoss site
A very quick overview relevant to Mugshot.
There are two kinds of EJB3 bean that we use.
- "Persistence beans" are objects annotated in such a way that Hibernate can map them to database tables.
- "Stateless session beans" are objects annotated in such a way that the application server can inject them with dependencies, create transactions around their methods, proxy them remotely, and other tasks. They are comparable to COM/XPCOM/CORBA objects, if you're familiar with those.
Note, these two kinds of bean have no inherent connection with the "web tier" - that is, the "session" in "stateless session beans" is not an HTTP session.
The interfaces to our session beans can be found in the Java package com.dumbhippo.server, and the implementations in com.dumbhippo.server.impl. The persistence beans are in com.dumbhippo.persistence.
We have some guidelines specific to persistence beans.

