📄 nicethingsbeanejb.java
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -