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

Ask Questions?

View Latest Questions

Advertisement


 
 

Identify correct and incorrect statements or examples about the client view of an entity bean's local component interface (EJBLocalObject).
Posted on: April 18, 2011 at 12:00 AM
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;
}
					
Advertisement


DMCA.com