1.What is EJB?EJB stands for Enterprise Java Beans. EJB is an essential part of a J2EE platform. J2EE platform have
component based architecture to provide multi-tiered, distributed and highly transactional
features to enterprise level applications. 2.What are the benefits of EJB?Following are the key benefits of EJB.
3.What is a Session Bean in EJB?Session bean stores data of a particular user for a single session. It can be stateful or stateless. It is less resource intensive as compared to entity beans. Session bean gets destroyed as soon as user session terminates. 4.What is Stateful Session Bean in EJB?A stateful session bean is a type of enterprise bean which preserve the conversational state with client. A stateful session bean as per its name keeps associated client state in its instance variables. EJB Container creates a separate stateful session bean to process client's each request. As soon as request scope is over, statelful session bean is destroyed. 5.What is Stateless Session Bean in EJB?A stateless session bean is a type of enterprise bean which is normally used to do independent operations. A stateless session bean as per its name does not have any associated client state, but it may preserve its instance state. EJB Container normally creates a pool of few stateless bean's objects and use these objects to process client's request. Because of pool, instance variable values are not guaranteed to be same across lookups/method calls. 6.What is Entity Bean in EJB?Entity beans represents persistent data storage. User data can be saved to database via entity beans and later on can be retrived from the database in the entity bean. 7.What is Message Driven Bean in EJB?A message driven bean is a type of enterprise bean which is invoked by EJB container when it receives a message from queue or topic. Message driven bean is a stateless bean and is used to do task asynchronously. 8.When a local session bean is used in EJB?If ejb client is in same environment where ejb session bean is to be deployed then we use local session bean. 9.What a remote session bean is used in EJB?if ejb client is in different environment where ejb session bean is to be deployed then we use remote session bean. 10.What are the differences between stateful session bean and stateless session bean?Following are the differences between stateful session bean and stateless session bean:
11.What are the key components of persistence API in EJB?Following are the key components of persistence API in EJB:
12.Is Message Driven bean a stateless bean?Message driven bean is a stateless bean and is used to do task asynchronously. 13.Explain @javax.ejb.Stateless annotation.?@javax.ejb.Stateless annotation specifies that a given ejb class is a stateless session
bean.Following are its attributes:
14.Explain @javax.ejb.Stateful annotation.?@javax.ejb.Stateful annotation specifies that a given ejb class is a stateful session bean.Following
are its attributes:
15.Explain @javax.ejb.MessageDrivenBean annotation.?@javax.ejb.MessageDrivenBean annotation specifies that a given ejb class is a message driven bean. Following are its attributes: name - Used to specify name of the message driven bean. messageListenerInterface - Used to specify message listener interface for the message driven bean. activationConfig - Used to specify the configuration details of the message-driven bean in operational environment of the message driven bean. mappedName - Used to specify the JNDI name of the message driven bean. description - Used to provide description of the message driven bean. 16.Explain @javax.ejb.EJB annotation.?@javax.ejb.EJB annotation is used to specify or inject a dependency as ejb instance into another
ejb. Following are its attributes:
17.Explain @javax.ejb.Local annotation.?@javax.ejb.Local annotation is used to specify Local interfaces of a session bean. This local
interface states the business methods of the session bean whichcanbestatelessorstateful. 18.Following are its attributes:?
19.Explain @javax.ejb.Remote annotation.?@javax.ejb.Remote annotation is used to specify Remote interfaces of a session bean. This remote
interface states the business methods of the session bean whichcanbestatelessorstateful. 20.Following are its attributes:?
|