Java Technology Home Page
A-Z Index

Java Developer Connection(SM)
Online Training

Downloads, APIs, Documentation
Java Developer Connection
Tutorials, Tech Articles, Training
Online Support
Community Discussion
News & Events from Everywhere
Products from Everywhere
How Java Technology is Used Worldwide
 
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;
   
}

<< BACK NEXT >>


[ This page was updated: 5-Nov-99 ]

Products & APIs | Developer Connection | Docs & Training | Online Support
Community Discussion | Industry News | Solutions Marketplace | Case Studies
Glossary - Applets - Tutorial - Employment - Business & Licensing - Java Store - Java in the Real World
FAQ | Feedback | Map | A-Z Index
For more information on Java technology
and other software from Sun Microsystems, call:
(800) 786-7638
Outside the U.S. and Canada, dial your country's AT&T Direct Access Number first.
Sun Microsystems, Inc.
Copyright © 1995-99 Sun Microsystems, Inc.
All Rights Reserved. Legal Terms. Privacy Policy.