Share on Google+Share on Google+

Identify correct and incorrect statements or examples about the client view of an entity bean's local component interface (EJBLocalObject).

Advertisement
This page discusses - Identify correct and incorrect statements or examples about the client view of an entity bean's local component interface (EJBLocalObject).

Identify correct and incorrect statements or examples about the client view of an entity bean's local component interface (EJBLocalObject).

A local client can access an entity object through the entity bean’s local [component] interface. An entity bean’s local interface MUST extend the javax.ejb.EJBLocalObject interface. A local interface defines the business methods that are callable by local clients.

public interface Account extends javax.ejb.EJBLocalObject {
	void debit(double amount)
		throws InsufficientBalanceException;
	void credit(double amount);
	double getBalance();
}					
					
Methods of the entity bean’s local interface MUST NOT throw the java.rmi.RemoteException.

The javax.ejb.EJBLocalObject interface defines the methods that allow the local client to perform the following operations on an entity object’s local reference:

  • Obtain the local home interface for the entity object.

  • Remove the entity object.

  • Obtain the entity object’s primary key.

The CONTAINER provides the implementation of the methods defined in the javax.ejb.EJBLocalObject interface. Only the business methods are delegated to the instances of the enterprise bean class.

public interface EJBLocalObject {
	EJBLocalHome getEJBLocalHome() throws EJBException;
	Object getPrimaryKey() throws EJBException;
	boolean isIdentical(EJBLocalObject obj) throws EJBException;
	void remove() throws RemoveException, EJBException;
}
					

Advertisements

Advertisement

Posted on: April 18, 2011 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Comments:0