Coding the home interface

The home interface for a bean extends the javax.ejb.EJBHome interface. It defines one or more create methods that the client program may call to create a bean instance. For stateless session beans there must be exactly one create method taking no parameters. Stateful session beans may overload the create method with different variants taking different combinations of parameters. The RouletteWheel bean is a stateful session bean. We overload create so that we can specify the amount of credit we have on a roulette wheel instance when it is created:
package casino;

     public interface RouletteWheelHome extends javax.ejb.EJBHome { 

       public RouletteWheel create() 
         throws javax.ejb.CreateException, javax.ejb.EJBException;

       public RouletteWheel create(int dollars) 
         throws javax.ejb.CreateException, javax.ejb.EJBException;
     }