Because read-only access is all we need with the Music Collection database, it makes sense to perform this task with a session bean. And because we do not need to keep track of client-specific data, a stateless session bean will suffice. Let's examine the code for the Music EJB now.
Listing 4.1 is the home interface (MusicHome) for the Music EJB. Since this is a stateless session bean, we need only a single create() method with no arguments. Note that this method returns the remote interface object, Music.
// MusicHome.java import java.io.Serializable; import java.rmi.RemoteException; import javax.ejb.CreateException; import javax.ejb.EJBHome; public interface MusicHome ...