RequestDataManager.java
资源名称:某公司的java培训教材 [点击查看]
上传用户:dinglihq
上传日期:2013-02-04
资源大小:99958k
文件大小:2k
源码类别:
Java编程
开发平台:
Java
- package bible.ejb.session.example1;
- import javax.ejb.*;
- import java.util.*;
- /**
- * Class RequestDataManager
- *
- *
- * @author
- * @version %I%, %G%
- */
- public class RequestDataManager implements SessionBean {
- private SessionContext sessionContext;
- /**
- * Method ejbCreate
- *
- *
- */
- public void ejbCreate() {}
- /**
- * Method ejbRemove
- *
- *
- */
- public void ejbRemove() {}
- /**
- * Method ejbActivate
- *
- *
- */
- public void ejbActivate() {}
- /**
- * Method ejbPassivate
- *
- *
- */
- public void ejbPassivate() {}
- /**
- * Method setSessionContext
- *
- *
- * @param sessionContext
- *
- */
- public void setSessionContext(SessionContext sessionContext) {
- this.sessionContext = sessionContext;
- }
- /**
- * Returns research data about a particular security.
- */
- public String getResearchData(String symbol) {
- return checkResearchDatasource(symbol);
- }
- /**
- * Appends research data about a particular security to this buffer.
- */
- public void appendResearchData(StringBuffer buffer, String symbol) {
- buffer.append(checkResearchDatasource(symbol));
- }
- /**
- * Checks a hard-coded list of securities for a match and returns recommendations.
- * This has been kept simple for the sake of the example, but potentially
- * could be doing a database lookup here.
- */
- private String checkResearchDatasource(String symbol) {
- if (symbol.equals("BEAS")) {
- return "(Zeeware Internal System Lookup) BEAS is rated at a Strong Buy";
- } else if (symbol.equals("YHOO")) {
- return "(Zeeware Internal System Lookup) YHOO is rated at a Buy";
- }
- return "(Zeeware Internal System Lookup Failed) No research available for security: "
- + symbol;
- }
- }
- /*--- Formatted in Bible Style on Thu, Sep 6, '01 ---*/
- /*------ Formatted by Jindent 3.24 Gold 1.02 --- http://www.jindent.de ------*/