Achilles’s Cabin

April 28, 2005

第一个ejb3.0 SLSB

Filed under: java相关

ejb3.0的使用和2.0比起来清爽了许多,现在就让我们开始3.0的浪漫旅程。
bean实现类:
import javax.ejb.Stateless;

@Stateless
public class HelloBean implements IHello
{
public String sayHello(){
return “System.out.println(\”hello boss\”)”;
}

}
远程接口:
import javax.ejb.Remote;

@Remote
public interface IHello
{
public void sayHello();

}
研究一下这个实现容易发现 现在的bean完全省略了home接口,这个远程接口不用实现ejbObject而且远程方法不用throws RemoteException只要在前面注释为Remote其余工作都由容器来搞定,是不是清爽多了
现在的ejb看起来更接近于普通java对象(pojo),远程接口看起来更像一个普通的java接口
而且测试过程中第一次使用了ant ,这个东西非常像linix下的make,感觉真是个好东西,网上说3.0可以脱离容器测试 但是好像规范没有给出具体的说明。

Comments »

The URI to TrackBack this entry is: http://achilles.blogsome.com/2005/04/28/%e7%ac%ac%e4%b8%80%e4%b8%aaejb30-slsb/trackback/

No comments yet.

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>


Get free blog up and running in minutes with Blogsome | Theme designs available here