Easy to Learn Java: Programming Articles, Examples and Tips

Start with Java in a few days with Java Lessons or Lectures

Home

Code Examples

Java Tools

More Java Tools!

Java Forum

All Java Tips

Books

Submit News
Search the site here...
Search...
 
Search the JavaFAQ.nu
1000 Java Tips ebook

1000 Java Tips - Click here for the high resolution copy!1000 Java Tips - Click here for the high resolution copy!

Java Screensaver, take it here

Free "1000 Java Tips" eBook is here! It is huge collection of big and small Java programming articles and tips. Please take your copy here.

Take your copy of free "Java Technology Screensaver"!.

Read Java Certification SCBCD Study Guide - 9. Client View of an Entity.

JavaFAQ Home » Java Certification Books and Tests Go to all tips in Java Certification Books and Tests


Bookmark and Share

Chapter 5. Client View of an Entity.

Identify correct and incorrect statements or examples about the client of an entity bean's local and remote home interface, including viewing the code used to locate an entity bean's home interface and the home interface methods provided to the client.

The client of an entity bean may be a REMOTE client or the client may be a LOCAL client.

A REMOTE client accesses an entity bean through the entity bean’s remote and remote home interfaces. The remote and remote home interfaces of the entity bean provide the remote client view.

The remote client view of an entity bean is location independent. A client running in the same JVM as an entity bean instance uses the same API to access the entity bean as a client running in a different JVM on the same or different machine.

A LOCAL client accesses an entity bean through the entity bean’s local and local home interfaces. The container provides classes that implement the entity bean’s local and local home interfaces. The objects that implement the local home and local interfaces are local Java objects.

The arguments of the methods of the LOCAL interface and LOCAL HOME interface are passed by REFERENCE.

The arguments and results of the methods of the REMOTE interface and REMOTE HOME interface are passed by VALUE.

The remote client view can also be mapped to non-Java client environments, such as CORBA clients not written in the Java programming language.

Locating an entity bean’s REMOTE home interface

    Context initialContext = new InitialContext();
    AccountRemoteHome accountHome = (AccountRemoteHome)
    javax.rmi.PortableRemoteObject.narrow(
    initialContext.lookup(“java:comp/env/ejb/accounts”),
    AccountRemoteHome.class
    );

Locating an entity bean’s LOCAL home interface

    Context initialContext = new InitialContext();
    AccountLocalHome accountHome = (AccountLocalHome)
    initialContext.lookup(“java:comp/env/ejb/accounts”);

The CONTAINER provides the implementation of the remote home interface for each entity bean deployed in the container that defines a remote home interface. The container makes the remote home interface accessible to the clients through JNDI. The entity bean’s remote home interface allows a client to do the following:

  • Create new entity objects within the home.

  • Find existing entity objects within the home.

  • Remove an entity object from the home.

  • Execute a home business method.

  • Get the javax.ejb.EJBMetaData interface for the entity bean. The javax.ejb.EJBMetaData interface is intended to allow application assembly tools to discover the meta-data information about the entity bean. The meta-data information allows loose client/server binding and scripting.

  • Obtain a HANDLE for the home interface. The home handle can be serialized and written to stable storage; later, possibly in a different JVM, the handle can be deserialized from stable storage and used to obtain a reference to the home interface.

An entity bean’s remote home interface must extend the javax.ejb.EJBHome interface and follow the standard rules for Java programming language remote interfaces.

The CONTAINER provides the implementation of the local home interface for each entity bean deployed in the container that defines a local home interface. The container makes the local home interface accessible to local clients through JNDI.

The entity bean’s LOCAL home interface allows a local client to do the following:
  • Create new entity objects within the home.

  • Find existing entity objects within the home.

  • Remove an entity object from the home.

  • Execute a home business method.

An entity bean’s LOCAL HOME interface MUST extend the javax.ejb.EJBLocalHome interface.
IBA JV

 Printer Friendly Page  Printer Friendly Page
 Send to a Friend  Send to a Friend

.. Bookmark and Share

Search here again if you need more info!
Custom Search



Home Code Examples Java Forum All Java Tips Books Submit News, Code... Search... Offshore Software Tech Doodling

RSS feed Java FAQ RSS feed Java FAQ News     

    RSS feed Java Forums RSS feed Java Forums

All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest 1999-2006 by Java FAQs Daily Tips.

Interactive software released under GNU GPL, Code Credits, Privacy Policy