Browse Today's favorites or All time favorites.
Please Sign In or Register to share and submit your questions.
Java Queries
Complete java interview questions library
How does an EJB interact with its container and what are the call-back methods in entity beans?
EJB interacts with its container through the following mechanisms
Call-back Methods: Every EJB implements an interface (extends EnterpriseBean) which defines several
methods which alert the bean to various events in its lifecycle. A container is responsible for invoking these
methods. These methods notify the bean when it is about to be activated, to be persisted to the database, to
end a transaction, to remove the bean from the memory, etc.
EJBContext: provides methods for interacting with the container so that the bean can request information
about its environment like the identity of the caller, security, status of a transaction, obtains remote reference
to itself etc. e.g. isUserInRole(), getUserPrincipal(), isRollbackOnly(), etc.
JNDI (Java Naming and Directory Interface): allows EJB to access resources like JDBC connections, JMS
topics and queues, other EJBs etc.
Learn all you can
Learn all you can about the company or organization; learn as much as you can so that your questions are sophisticated and knowledgeable during the interview. Employers expect you to arrive knowing background information about the organization
Write a comment