Share on Google+Share on Google+

Identify correct and incorrect statements or examples about the client view of a session bean's local and remote component interfaces.

Ads
This page discusses - Identify correct and incorrect statements or examples about the client view of a session bean's local and remote component interfaces.

Identify correct and incorrect statements or examples about the client view of a session bean's local and remote component interfaces.

A client NEVER DIRECTLY accesses instances of the session bean’s class. A client always uses the session bean’s COMPONENT interface to access a session bean’s instance. The class that implements the session bean’s component interface is provided by the container.

A session EJBObject supports:

  • The business logic methods of the object. The session EJBObject delegates invocation of a business method to the session bean instance.

  • Get the session object’s remote home interface.

  • Get the session object’s handle.

  • Test if the session object is identical with another session object.

  • Remove the session object.

				
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;
}
					

A session EJBLocalObject supports:

  • The business logic methods of the object. The session EJBLocalObject delegates invocation of a business method to the session bean instance.

  • Get the session object’s local home interface.

  • Test if the session object is identical with another session object.

  • Remove the session object.

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

Method getPrimaryKey() on session bean will throw EJBException (local SB) or RemoteException (remote SB) because session bean does not have primary key.

EJBObject interface extends Remote (marker) interface.

Visit http://java.boot.by  for the updates.

Advertisements

Ads

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

Ads

Advertisement