import java.rmi.AlreadyBoundException;
import java.rmi.NotBoundException;
import java.rmi.server.UnicastRemoteObject;
+import java.util.Arrays;
import java.util.Properties;
import java.util.HashMap;
import java.util.Map;
* @return void
*/
private void createCapabBasedRMIJava(MessageCreateObject sMessage) throws
- ClassNotFoundException, NoSuchMethodException {
+ ClassNotFoundException, NoSuchMethodException, UnknownHostException {
// Instantiate the skeleton and put in the object
String strObjSkelName = STR_OBJ_CLS_PFX + "." + sMessage.getObjectClass() +
Class<?> clsStub = Class.forName(strObjStubName); // Port number is integer
Class[] clsStubParams = { int.class, String.class, String.class, int.class, int[].class };
Constructor<?> objStubCons = clsStub.getDeclaredConstructor(clsStubParams);
- int[] ports = { sMessage.getRMIRegPort() }; // TODO: Change this temporary use of reg port for callbacks
+ Integer[] portsInteger = sMessage.getRMICallbackPorts();
+ int[] ports = Arrays.stream(portsInteger).mapToInt(Integer::intValue).toArray();
int rev = 0;
String callbackAddress = InetAddress.getLocalHost().getHostAddress(); // Callback address is this machine's address
Object objStubParams[] = { sMessage.getRMIStubPort(), sMessage.getHostAddress(), callbackAddress,