**** HOME Interfaces ****
interface CommonHome{
CommonObject create() throws Exception;
} interface RemoteHome extends EJBHome, CommonHome{
CommonObject create() throws RemoteException;
} interface LocalHome extends EJBLocalHome, CommonHome{
CommonObject create() throws Exception;
} **** Object Interfaces ****
interface CommonObject{
int service() throws Exception;
} interface RemoteObject extends EJBObject,CommonObject{
int service() throws RemoteException;
{ interface LocalObject extends EJBLocalObject,CommonObject{
int service() throws Exception;
} **** Client ****
Object homeObject = context.lookup("CommonBean");
home = (CommonHome)PortableRemoteObject.narrow(homeObject, CommonHome.class);
CommonObject object = home.create();
object.service();
以前这么做过定义两个通用的接口就可以了
interface CommonHome{
CommonObject create() throws Exception;
} interface RemoteHome extends EJBHome, CommonHome{
CommonObject create() throws RemoteException;
} interface LocalHome extends EJBLocalHome, CommonHome{
CommonObject create() throws Exception;
} **** Object Interfaces ****
interface CommonObject{
int service() throws Exception;
} interface RemoteObject extends EJBObject,CommonObject{
int service() throws RemoteException;
{ interface LocalObject extends EJBLocalObject,CommonObject{
int service() throws Exception;
} **** Client ****
Object homeObject = context.lookup("CommonBean");
home = (CommonHome)PortableRemoteObject.narrow(homeObject, CommonHome.class);
CommonObject object = home.create();
object.service();
以前这么做过定义两个通用的接口就可以了
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货