QUESTION 1
(a) Give explanation & the significance of Enterprise Java Beans (EJB) in software development.
(b) Explain the most important goals of EJB technology.
(c) Put in plain words the EJB architecture using a suitable diagram.
(d) Examine the steps to be act upon to build an EJB application.
QUESTION 2
(a)(i) What is a session bean?
(ii) Elucidate how Stateless Session Beans (SLSB) differs from Stateful Session Beans (SFSB).
(b) What is a Message Driven Bean (MDB)?
(c)(i) What is an Entity Bean?
(ii) Make clear distinction how an Entity Bean differs from MDB.
QUESTION 3
(a) Chat about the major components required to implement an enterprise bean.
(b) Elucidate the life-cycle of the following bean kinds using appropriate figures:-
(i) Stateful Session Bean (SFSB)
(ii) Stateless Session Bean (SLSB)
(iii) Message Driven Bean (MDB)
QUESTION 4
Portray the purpose of the java bean given below. Describe fully each statement of the program.
package converter.ejb;
import java.math.BigDecimal;
import javax.ejb.*;
@Stateless
public class ConverterBean {
private BigDecimal yenRate = new BigDecimal("83.0602");
private BigDecimal euroRate = new BigDecimal("0.0093016");
public BigDecimal dollarToYen(BigDecimal dollars) {
BigDecimal result = dollars.multiply(yenRate);
return result.setScale(2, BigDecimal.ROUND_UP);
}
public BigDecimal yenToEuro(BigDecimal yen) {
BigDecimal result = yen.multiply(euroRate);
return result.setScale(2, BigDecimal.ROUND_UP);
}
} Describe fully the purpose of the web client program given below.
@WebServlet
public class ConverterServlet extends HttpServlet {
@EJB
ConverterBean converterBean;
try {
String amount = request.getParameter("amount");
if (amount != null && amount.length() > 0) {
BigDecimal d = new BigDecimal(amount);
BigDecimal yenAmount = converter.dollarToYen(d);
BigDecimal euroAmount = converter.yenToEuro(yenAmount);
}
}