nicethingsbeanejb.java

来自「一个web service的开发工具」· Java 代码 · 共 38 行

JAVA
38
字号
package samples.ejb;import javax.ejb.*;public class NiceThingsBeanEJB implements SessionBean {        public void ejbCreate() {}    public void ejbActivate() {}    public void ejbPassivate()  {}    public void ejbRemove() {}    public void setSessionContext(SessionContext sc) {}    // "Business" Methods:    public String sayHello(String name) {        return ( "Hiya " + name + ", how are you?");    }    public NiceThings findNiceThingsFor(String name) {        // In reality our bean would probably be looking up these nice        // things from an entity bean. In our case we'll just cheat :)                NiceThings niceThings = new NiceThings("cake",                                               23,                                               "black as night");        return niceThings;    }            public boolean updateNiceThingsFor(String name, NiceThings niceThings) {        // In reality this bean would probably try and update nice things         // in the relevant entity bean(s) and return a boolean to indicate         // whether the update was successful or not. Again, we'll cheat.        return true;    }        }

⌨️ 快捷键说明

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