Cette règle détecte l'utilisation d'appels API RMI d'Oracle WebLogic. Elle
remplace les appels API RMI WebLogic par des appels API RMI JavaSoft. Un correctif automatisé sera fourni pour cette règle. <Strong>Remarque :</Strong> Les appels aux API RMI ne sont migrés que s'il existe une API équivalente dans JavaSoft. Le tableau suivant répertorie les packages RMI JavaSoft :
| Nom de package |
|
java.rmi
|
|
java.rmi.activation
|
|
java.rmi.dgc
|
|
java.rmi.registry
|
|
java.rmi.server
|
L'exemple suivant illustre le code à migrer,.
import java.net.MalformedURLException;
import weblogic.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.Remote;;
import java.rmi.RemoteException;
...
void main( String[] args ) {
Remote remote = Naming.lookup("NameLookup");
Remote remote2 = weblogic.rmi.Naming.lookup("NameLookup");
CallRouter callRouter = new weblogic.rmi.cluster.CallRouter();
weblogic.rmi.cluster.CallRouter callRouter2 = new weblogic.rmi.cluster.CallRouter();
}
import java.net.MalformedURLException;
import Java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.Remote;
import java.rmi.RemoteException;
...
void main( String[] args ) {
Remote remote = Naming.lookup("NameLookup");
Remote remote2 = Java. rmi.Naming.lookup( "NameLookup" );
CallRouter callRouter = new weblogic.rmi.cluster.CallRouter();
weblogic.rmi.cluster.CallRouter callRouter2 = new weblogic.rmi.cluster.CallRouter();
}