package rd1obj1.ejb;

/**
 * @ejb.bean
 *     name="InterestStateful"
 *     type="Stateful"
 *     description="Interest Stateful Session Bean"
 *     jndi-name="InterestHome"
 *
 */
public abstract class InterestStatefulBean implements javax.ejb.SessionBean {
    private String x;
	private double principal;
	private double time;
	private double rate;

    /**
     * @ejb.interface-method
     */
    public String foobar() {
        return "Foobar";
    }

    /**
     * @ejb.create-method
     */
    public void ejbCreateWithParam(String x) {
        this.x = x;
    }

    /**
     * @ejb.create-method
     */
    public void ejbCreate(String x) {
        this.x = x;
    }

	/**
     * @ejb.create-method
     */
	public void ejbCreate(double principal, double rate, double time) {
        this.principal = principal;
		this.rate = rate;
		this.time = time;
    }

	/**
     * @ejb.interface-method
     */
	 public double getInterest()
	{
		double interest = (principal*time*rate)/100.0;
		return interest;
	}

}
