Is it allowed to make a rmi call from within an ejb?
Hello,
Am I allowed to make a rmi call from within an ejb such as:
String host ="localhost";
RemoteObject ro = (RemoteObject) Naming.lookup("rmi://"+host+"/MonServeur");
ro.myMethod();
package pack;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
publicclass MyRemoteObjectextends UnicastRemoteObjectimplements RemoteObject{
public MyRemoteObject()throws RemoteException{
}
publicvoid myMethod()throws RemoteException{
System.out.println("toto");
}
publicstaticvoid main(String[] args){
try{
RemoteObject ro =new MyRemoteObject();
Naming.rebind("MonServeur", ro);
}catch (Exception ex){
ex.printStackTrace();
}
}
}
Is it allowed by the spec?
Is it good design?
Thanks in advance,
Julien Martin.

