Share on Google+Share on Google+

Identify correct and incorrect statements or examples about the client view of a entity bean's remote component interface (EJBObject).

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

Identify correct and incorrect statements or examples about the client view of a entity bean's remote component interface (EJBObject).

A client can access an entity object through the entity bean’s remote interface. An entity bean’s remote interface MUST extend the javax.ejb.EJBObject interface. A remote interface defines the business methods that are callable by remote clients.

public interface Account extends javax.ejb.EJBObject {
	void debit(double amount)
		throws java.rmi.RemoteException,
			InsufficientBalanceException;
	void credit(double amount)
		throws java.rmi.RemoteException;
	double getBalance()
		throws java.rmi.RemoteException;
}					
					

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

  • Obtain the remote home interface for the entity object.

  • Remove the entity object.

  • Obtain the entity object’s handle (ONLY REMOTE objects have handles, LOCAL objects DO NOT have handles).

  • Obtain the entity object’s primary key.

The container provides the implementation of the methods defined in the javax.ejb.EJBObject interface. ONLY the BUSINESS methods are DELEGATED to the instances of the enterprise bean class.

public interface EJBObject extends Remote {
	EJBHome getEJBHome() throws RemoteException;
	Handle getHandle() throws RemoteException;
	Object getPrimaryKey() throws RemoteException;
	boolean isIdentical(EJBObject obj) throws RemoteException;
	void remove() throws RemoteException, RemoveException;
}
					

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