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

📄 greeterejb.java

📁 一个java写的加密算法
💻 JAVA
字号:
/* * Copyright 2004-2005 Sun Microsystems, Inc.  All rights reserved. * Use is subject to license terms. */package samples.ejb.stateless.simple.ejb;import java.util.*; import java.io.*; /** * A simple stateless bean for the HelloWorld application. This bean implements one * business method as declared by the remote interface. */public class GreeterEJB implements javax.ejb.SessionBean {     private  javax.ejb.SessionContext m_ctx = null;        /**     * Sets the session context. Required by EJB spec.     * @param ctx A SessionContext object.     */    public void setSessionContext(javax.ejb.SessionContext ctx) {         m_ctx = ctx;     }     /**     * Creates a bean. Required by EJB spec.     * @exception throws CreateException.     */    public void ejbCreate() throws javax.ejb.EJBException, javax.ejb.CreateException {         System.out.println("ejbCreate() on obj " + this);     }     /**     * Removes the bean. Required by EJB spec.     */    public void ejbRemove() {         System.out.println("ejbRemove() on obj " + this);     }     /**     * Loads the state of the bean from secondary storage. Required by EJB spec.     */    public void ejbActivate() {         System.out.println("ejbActivate() on obj " + this);     }     /**     * Serializes the state of the bean to secondary storage. Required by EJB spec.     */    public void ejbPassivate() {         System.out.println("ejbPassivate() on obj " + this);     }     /**     * Required by EJB spec.     */    public void Greeter() {     }     /**     * Returns a greeting, based on the time of the day.     * @return returns a greeting as a string.     */    public String getGreeting() {         String message = null;         Calendar calendar = new GregorianCalendar();         int currentHour = calendar.get(Calendar.HOUR_OF_DAY);         if(currentHour < 12) message = "morning";         else {           if( (currentHour >= 12) &&             (calendar.get(Calendar.HOUR_OF_DAY) < 18)) message = "afternoon";           else message = "evening";         }         return message;     } } 

⌨️ 快捷键说明

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