// ItemEC2R.java
package org.objectweb.jonas.stests.appli;

import org.objectweb.jonas.common.Log;
import org.objectweb.util.monolog.api.Logger;
import org.objectweb.util.monolog.api.BasicLevel;

/**
 *
 */
public  abstract class ItemEC2R implements javax.ejb.EntityBean {

    static private Logger logger = null;
    javax.ejb.EntityContext ejbContext;

     /**
     * Creates an item bean
     *
     * @throws RemoteException if an RMI exception occurs
     *
     * @throws CreateException if the item cannot be created
     *
     * @param id an int which represents the item id
     *
     * @param name a String which represents the item name
     *
     * @param price a float which represents the item's price
     *
     * @param data a String which contains additional information about the item
     */
    public String ejbCreate(Integer id, String name, float price, String data) throws javax.ejb.CreateException{
        logger.log(BasicLevel.DEBUG, "");

        // Init here the bean fields
        setItemID(id);
        setItemName(name);
        setItemPrice(price);
        setItemInfo(data);
        return null;
    }

    public void ejbPostCreate(Integer id, String name, float price, String data) {
        logger.log(BasicLevel.DEBUG, "");
    }

    // ------------------------------------------------------------------
    // Persistent fields
    // 
    // ------------------------------------------------------------------
    public abstract Integer getItemID();
    public abstract void setItemID(Integer f1);

    public abstract String getItemName();
    public abstract void setItemName(String f2);

    public abstract float getItemPrice();
    public abstract void setItemPrice(float f2);

    public abstract String getItemInfo();
    public abstract void setItemInfo(String f3);

    // ------------------------------------------------------------------
    // Standard call back methods
    // ------------------------------------------------------------------

 
    public void setEntityContext(javax.ejb.EntityContext ctx) {
        if (logger == null) {
            logger = Log.getLogger("org.objectweb.jonas_tests");
        }
        logger.log(BasicLevel.DEBUG, "");
        ejbContext = ctx;
    }


    public void unsetEntityContext() {
        logger.log(BasicLevel.DEBUG, "");
        ejbContext = null;
    }

    public void ejbRemove() throws javax.ejb.RemoveException {
        logger.log(BasicLevel.DEBUG, "");
    }

 
    public void ejbLoad() {
        logger.log(BasicLevel.DEBUG, "");
    }


    public void ejbStore() {
        logger.log(BasicLevel.DEBUG, "");
    }
        

    public void ejbPassivate() {
        logger.log(BasicLevel.DEBUG, "");
    }


    public void ejbActivate() {
        logger.log(BasicLevel.DEBUG, "");
    }    

}



