teException;
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;
}
EJB 2.0嗤彜蓑SessionBean(3)
扮寂:2011-09-14 51cto鴬人 leizhimin
<?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>
屈、人薩極蝕窟
package lavasoft.client;
import lavasoft.testejb20yzt.HelloStateful;
import lavasoft.testejb20yzt.HelloStatefulHome;
import javax.ejb.CreateException;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.rmi.Portable
|