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.

[1997 byte] By [balteoa] at [2007-10-3 11:21:05]
# 1
Allowed - yesGood design - no, in my opinion.
xHackera at 2007-7-15 13:46:09 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...