EJB2.0有状态SessionBean
2010-04-06 00:00:00 来源:WEB开发网查看原图(大图)
package lavasoft.testejb20yzt;
import javax.ejb.CreateException;
import javax.ejb.EJBHome;
import java.rmi.RemoteException;
/**
* Home接口
* Home接口必须扩展EJBHome或者EJBLocalHome接口
* 客户使用Home接口来请求组件接口的一个引用
* 可以将Home接口看做是一个工厂,它能制造Bean的引用个,而且能向客户分配bean引用
*
* @author leizhimin 2010-3-31 15:32:06
*/
public interface HelloStatefulHome extends EJBHome {
public HelloStateful create(String someOne) throws CreateException, RemoteException;
}
查看原图(大图)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN'
'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
<ejb-jar>
<display-name>Hello Stateful EJB</display-name>
<enterprise-beans>
<session>
<display-name>helloStatefulEJB</display-name>
<ejb-name>helloStatefulEJB</ejb-name>
<home>lavasoft.testejb20yzt.HelloStatefulHome</home>
<remote>lavasoft.testejb20yzt.HelloStateful</remote>
<ejb-class>lavasoft.testejb20yzt.HelloStatefulBean</ejb-class>
<session-type>Stateful</session-type>
<transaction-type>Bean</transaction-type>
<security-identity>
<description></description>
<use-caller-identity></use-caller-identity>
</security-identity>
</session>
</enterprise-beans>
</ejb-jar>
<?xml version="1.0" encoding="UTF-8"?>
<jboss>
<enterprise-beans>
<session>
<ejb-name>helloStatefulEJB</ejb-name>
<jndi-name>ejb/helloStatefulEJB</jndi-name>
</session>
</enterprise-beans>
</jboss>
Tags:EJB 状态 SessionBean
编辑录入:爽爽 [复制链接] [打 印]更多精彩
赞助商链接