com.ibm.websphere.samples.technologysamples.ejb.stateless.basiccalculatorejb
Class BasicCalculatorBean

java.lang.Object
  extended by com.ibm.websphere.samples.technologysamples.ejb.stateless.basiccalculatorejb.BasicCalculatorBean
All Implemented Interfaces:
java.io.Serializable, javax.ejb.EnterpriseBean, javax.ejb.SessionBean

public class BasicCalculatorBean
extends java.lang.Object
implements javax.ejb.SessionBean

BasicCalculatorBean is the implementation class for the BasicCalculator stateless session EJB. BasicCalculatorBean implements each of the business methods defined in the BasicCalculator EJB remote interface and each of the EJB lifecycle methods in the javax.ejb.SessionBean interface.

See Also:
BasicCalculator, BasicCalculatorHome, Serialized Form

Constructor Summary
BasicCalculatorBean()
           
 
Method Summary
 void ejbActivate()
          ejbActivate Session EJB lifecycle callback method.
 void ejbCreate()
          ejbCreate Session EJB lifecycle callback method.
 void ejbPassivate()
          ejbPassivate Session EJB lifecycle callback method.
 void ejbRemove()
          ejbRemove Session EJB lifecycle callback method.
 double makeDifference(double operand1, double operand2)
          Perform the subtraction operation on the operands and return the result
 double makeProduct(double operand1, double operand2)
          Perform the multiplication operation on the operands and return the result
 double makeQuotient(double operand1, double operand2)
          Perform the division operation on the operands and return the result
 double makeSum(double operand1, double operand2)
          Perform the addition operation on the operands and return the result
 void setSessionContext(javax.ejb.SessionContext sCtx)
          ejbCreate Session EJB lifecycle callback method to set the EJB sessionContext for this EJB.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicCalculatorBean

public BasicCalculatorBean()
Method Detail

ejbCreate

public void ejbCreate()
ejbCreate Session EJB lifecycle callback method. This method is empty for Stateless Session EJB. This method corresponds to the create method in the home interface.


ejbActivate

public void ejbActivate()
ejbActivate Session EJB lifecycle callback method. This method is empty for Stateless Session EJB.

Specified by:
ejbActivate in interface javax.ejb.SessionBean

ejbPassivate

public void ejbPassivate()
ejbPassivate Session EJB lifecycle callback method. This method is empty for Stateless Session EJB. This method is called when the instance is passivated from its "active" state, and releases.

Specified by:
ejbPassivate in interface javax.ejb.SessionBean

ejbRemove

public void ejbRemove()
ejbRemove Session EJB lifecycle callback method. This method is empty for Stateless Session EJB. This method is called just before the end of life for this object.

Specified by:
ejbRemove in interface javax.ejb.SessionBean

setSessionContext

public void setSessionContext(javax.ejb.SessionContext sCtx)
ejbCreate Session EJB lifecycle callback method to set the EJB sessionContext for this EJB.

Specified by:
setSessionContext in interface javax.ejb.SessionBean
Parameters:
sCtx - javax.ejb.SessionContext The context for this session EJB

makeSum

public double makeSum(double operand1,
                      double operand2)
Perform the addition operation on the operands and return the result

Parameters:
operand1 - A number to perform this mathematical operation on
operand2 - Another number to perform this mathematical operation on
Returns:
sum The result of adding operand1 and operand2

makeDifference

public double makeDifference(double operand1,
                             double operand2)
Perform the subtraction operation on the operands and return the result

Parameters:
operand1 - A number to perform this mathematical operation on
operand2 - Another number to perform this mathematical operation on
Returns:
difference The result of subtracting operand1 and operand2

makeProduct

public double makeProduct(double operand1,
                          double operand2)
Perform the multiplication operation on the operands and return the result

Parameters:
operand1 - A number to perform this mathematical operation on
operand2 - Another number to perform this mathematical operation on
Returns:
product The result of multiplying operand1 and operand2

makeQuotient

public double makeQuotient(double operand1,
                           double operand2)
Perform the division operation on the operands and return the result

Parameters:
operand1 - A number to perform this mathematical operation on
operand2 - Another number to perform this mathematical operation on
Returns:
quotient The result of dividing operand1 and operand2