what is an ejb object?
Answer Posted / amardeep singh
The remote interface and the object implementation are similar to the corresponding RMI interfaces. A client issues method requests through a stub derived from the remote interface and eventually these requests make their way to the corresponding bean instance on the server. The home interface is a new twist: it acts as a bean factory, providing a way for a client to create, locate, and destroy EJB objects that it uses. With the home interface in the picture, the remote interface acts as the interface the client uses to interact with EJB objects, and the implementation is where the object itself does its thing.
The EJB object implementation needs to implement all the business methods in the remote interface, plus some methods used by the container to tell it about various events in its lifetime. The EJB object does not need to implement the remote interface, which is another new twist compared to RMI, where the server object always implements the remote interface. In EJB, the container arranges for method calls on the remote interface to be transferred to the EJB object. You just need to ensure that the EJB object has methods that match the signatures of the methods in the remote interface. We'll see an example of EJB object implementation a bit later.
Various pieces of these Java classes (home, remote, and implementation) are provided for the sake of the client, to allow a client to create EJB objects and call remote methods on them. Other pieces are provided for the EJB container, to allow it to notify the EJB object about transaction− and persistence related events, for example.
Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
What changes have been made in ejb 2.0 specifications?
What does statelessness mean?
Why do we use ejb?
What is message-driven bean?
What is the new basic requirement for a cmp entity bean class in 2.0 from that of ejb 1.1?
How can I access ejb from asp?
TX operation funtion executed by?
Are entity beans allowed to create() methods?
Define EAR, WAR and JAR ?
How do you decide whether you should use session, entity or message driven bean?
Why do we need ejb in java?
What are the advantages of ejb?
How does ejb work in java?
Can tomcat run ejb?
What is ejb and its architecture?