requestdatamanager.java

来自「100多M的J2EE培训内容」· Java 代码 · 共 97 行

JAVA
97
字号
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 ------*/

⌨️ 快捷键说明

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