⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 digitalstorebean.java

📁 < J2EE应用开发详解>>一书全部的源代码. 本书基于J2EE 1.4平台
💻 JAVA
字号:
/*
 * Created on 2004-6-19
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
package com.j2ee14.ch16;
import javax.ejb.SessionBean;
import javax.ejb.*;

/**
 * @ejb.bean name="DigitalStore"
 *	jndi-name="ejb/DigitalStoreBean"
 *	type="Stateful" 
 * 
 *--
 * This is needed for JOnAS.
 * If you are not using JOnAS you can safely remove the tags below.
 * @jonas.bean ejb-name="DigitalStore"
 *	jndi-name="DigitalStoreBean"
 * 
 *--
 **/
public abstract class DigitalStoreBean implements SessionBean {
	   String userId;
	   double eGold;
	   
/** * @ejb.create-method *	view-type="both" **/public void ejbCreate(String uid,double eg)throws CreateException{ 
	if(eg<=0)
    {
    	throw new CreateException("初始参数eg无效");
    }
    userId=uid;
    eGold=eg;    }/** * @ejb.interface-method *	view-type="both" **/public void addEGold(double eg){ 
	if(eg<=0){
  		 return;
  	    }
  		 eGold+=eg;}
/**
 * @ejb.interface-method
 *	view-type="both" 
**/
public void withdrawEGold(double eg)throws NotMuchMoreEGoldException
{
		if(eGold<eg)
		{
			throw new NotMuchMoreEGoldException();
		}
		eGold-=eg;
}
/**
 * @ejb.interface-method
 *	view-type="both" 
**/
public double getRemain ()
{
	  return eGold;
}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -