Technical Support
Discussion Forum
Online Training
Technical Articles
Bug Parade
JDC Resources
DukeDollars
Early Access
Toolbar
Community Process
Technology Sites

JDC Home Page

Solaris Developer Connection

Java Technology
java.sun.com

Java Industry Connection

Log Out

Online Training
SearchFAQContact Us

Online Training Index

Step 3: Specifying the Home Interface

The home interface for a session bean provides the mechanism by which the container creates new session beans on behalf of the client. The home interface, just like the remote interface, is declared by the bean developer in RMI syntax, and again, is implemented by the container provider's tools. There is little-to-no coding to be done by the programmer--it is really just declarative work at this point.

  1. Read the description of the Home Interface below and note the comments in the code fragment.
  2. Save the example source code to the indicated file, and move to the next step.

Here is the source code for the DemoBean EJB:

  /**
   * DemoHome.java - This is the Home interface it must
   * extend javax.ejb.EJBHome and define one or more
   * create() methods for the bean.
   *
   * Note: The implementation of this interface is 
   * generated by the container tools. 
   */ 

   package ejb.demo;

   import javax.ejb.*;
   import java.rmi.Remote;
   import java.rmi.RemoteException;
   import java.util.*;

  /**
   * This interface is extremely simple it declares only
   * one create method.
   */
   public interface DemoHome extends EJBHome {

    public Demo create() throws CreateException, 
                                RemoteException;
   
   }

previous next





Questions?
22-Apr-99
Copyright © 1996-1999 Sun Microsystems Inc.
All Rights Reserved. Legal Terms. Privacy Policy.
Sun Microsystems