private void createCapabBasedRMIJava(MessageCreateObject sMessage) throws
ClassNotFoundException, NoSuchMethodException, UnknownHostException {
+ // TODO: DEBUG
+ System.out.println("\n\nDEBUG: Create capab based RMI here!");
+ System.out.println("DEBUG: sMessage host address: " + sMessage.getHostAddress());
+ System.out.println("DEBUG: sMessage object class: " + sMessage.getObjectClass());
+ System.out.println("DEBUG: sMessage object name: " + sMessage.getObjectName());
+ System.out.println("DEBUG: sMessage interface name: " + sMessage.getObjectInterfaceName());
+ System.out.println("DEBUG: sMessage reg port: " + sMessage.getRMIRegPort());
+ System.out.println("DEBUG: sMessage stub port: " + sMessage.getRMIStubPort());
+ System.out.println("DEBUG: sMessage object fields: " + Arrays.toString(sMessage.getObjectFields()));
+ System.out.println("DEBUG: sMessage object fields: " + Arrays.toString(sMessage.getObjectFldCls()));
+ System.out.println("\n\n");
+
// Instantiate the skeleton and put in the object
String strObjSkelName = STR_OBJ_CLS_PFX + "." + sMessage.getObjectClass() +
"." + sMessage.getObjectInterfaceName() + SKEL_CLASS_SUFFIX;
RemoteException, AlreadyBoundException, IllegalAccessException,
InvocationTargetException {
+ // TODO: DEBUG
+ System.out.println("\n\nDEBUG: CREATE DRIVER OBJECT!!!\n\n");
+
// Translating into the actual Message class
MessageCreateObject sMessage = (MessageCreateObject) sIoTMasterMsg;
// Instantiate object using reflection
// Translating into the actual Message class
MessageCreateMainObject sMessage = (MessageCreateMainObject) sIoTMasterMsg;
+ // TODO: DEBUG
+ System.out.println("\n\nDEBUG: CREATE MAIN OBJECT!!!");
+ System.out.println("DEBUG: sMessage object name: " + sMessage.getObjectName());
+
// Getting controller class
File file = new File(STR_JAR_FILE_PATH + sMessage.getObjectName() + STR_JAR_FILE_EXT);
RuntimeOutput.print("IoTSlave: DEBUG print path: " + STR_JAR_FILE_PATH +
// Translating into the actual Message class
MessageCreateSetRelation sMessage = (MessageCreateSetRelation) sIoTMasterMsg;
+ // TODO: DEBUG
+ System.out.println("\n\nDEBUG: CREATE NEW IOT SET!!!");
+ System.out.println("DEBUG: sMessage object field name: " + sMessage.getObjectFieldName());
+
// Initialize field name
strFieldName = sMessage.getObjectFieldName();
RuntimeOutput.print("IoTSlave: Setting up field " + strFieldName, BOOL_VERBOSE);
// Translating into the actual Message class
MessageCreateSetRelation sMessage = (MessageCreateSetRelation) sIoTMasterMsg;
+ // TODO: DEBUG
+ System.out.println("\n\nDEBUG: CREATE NEW IOT RELATION!!!");
+ System.out.println("DEBUG: sMessage object field name: " + sMessage.getObjectFieldName());
+
// Initialize field name
strFieldName = sMessage.getObjectFieldName();
RuntimeOutput.print("IoTSlave: Setting up field " + strFieldName, BOOL_VERBOSE);
// Translating into the actual Message class
MessageGetObject sMessage = (MessageGetObject) sIoTMasterMsg;
+
+ System.out.println("DEBUG: sMessage host address: " + sMessage.getHostAddress());
+ System.out.println("DEBUG: sMessage object class: " + sMessage.getObjectClass());
+ System.out.println("DEBUG: sMessage object name: " + sMessage.getObjectName());
+ System.out.println("DEBUG: sMessage interface name: " + sMessage.getObjectInterfaceName());
+ System.out.println("DEBUG: sMessage reg port: " + sMessage.getRMIRegPort());
+ System.out.println("DEBUG: sMessage stub port: " + sMessage.getRMIStubPort());
+ System.out.println("DEBUG: sMessage callback ports: " + Arrays.toString(sMessage.getRMICallbackPorts()));
+ System.out.println("\n\n");
+
Object stubObjConv = null;
String strObjectName = sMessage.getObjectName();
String strObjClassInterfaceName = STR_OBJ_CLS_PFX + "." + STR_INTERFACE_PFX + "." +
ClassNotFoundException, RemoteException, NotBoundException, NoSuchMethodException,
InstantiationException, IllegalAccessException, InvocationTargetException {
+ // TODO: DEBUG
+ System.out.println("\n\nDEBUG: GET IOT SET OBJECT!!!");
+
Object objRegistry = null;
if (CAPAB_BASED_RMI)
objRegistry = getObjectFromStub();
ClassNotFoundException, RemoteException, NotBoundException, NoSuchMethodException,
InstantiationException, IllegalAccessException, InvocationTargetException {
+ // TODO: DEBUG
+ System.out.println("\n\nDEBUG: GET IOT RELATION FIRST OBJECT!!!");
+
Object objRegistry = null;
if (CAPAB_BASED_RMI)
objRegistry = getObjectFromStub();
ClassNotFoundException, RemoteException, NotBoundException, NoSuchMethodException,
InstantiationException, IllegalAccessException, InvocationTargetException {
+ // TODO: DEBUG
+ System.out.println("\n\nDEBUG: GET IOT RELATION SECOND OBJECT!!!");
+
Object objRegistry = null;
if (CAPAB_BASED_RMI)
objRegistry = getObjectFromStub();
// Reinitialize IoTSet field after getting all the objects
iotsetObject = new IoTSet<Object>(isetObject.values());
+ // TODO: DEBUG
+ System.out.println("\n\nDEBUG: REINITIALIZE IOT SET FIELD!!!");
+ System.out.println("DEBUG: Field name: " + strFieldName + "\n\n");
+
// Private fields need getDeclaredField(), while public fields use getField()
Field fld = clsMain.getDeclaredField(strFieldName);
boolean bAccess = fld.isAccessible();
// Reinitialize IoTSet field after getting all the objects
iotrelObject = new IoTRelation<Object,Object>(irelObject.relationMap(), irelObject.size());
+ // TODO: DEBUG
+ System.out.println("\n\nDEBUG: REINITIALIZE IOT RELATION FIELD!!!");
+ System.out.println("DEBUG: Field name: " + strFieldName + "\n\n");
+
// Private fields need getDeclaredField(), while public fields use getField()
Field fld = clsMain.getDeclaredField(strFieldName);
boolean bAccess = fld.isAccessible();
// Translating into the actual Message class
MessageGetDeviceObject sMessage = (MessageGetDeviceObject) sIoTMasterMsg;
+ // TODO: DEBUG
+ System.out.println("\n\nDEBUG: GET DEVICE IOT SET OBJECT!!!");
+ System.out.println("DEBUG: sMessage host address: " + sMessage.getHostAddress());
+ System.out.println("DEBUG: sMessage source port: " + sMessage.getSourceDeviceDriverPort());
+ System.out.println("DEBUG: sMessage destination port: " + sMessage.getDestinationDeviceDriverPort());
+ System.out.println("DEBUG: sMessage source wild card: " + sMessage.isSourcePortWildCard());
+ System.out.println("DEBUG: sMessage desination wild card: " + sMessage.isDestinationPortWildCard() + "\n\n");
+
// Get IoTSet objects for IP address set on device driver/controller
IoTDeviceAddress objDeviceAddress = new IoTDeviceAddress(sMessage.getHostAddress(),
sMessage.getSourceDeviceDriverPort(),
// Translating into the actual Message class
MessageGetSimpleDeviceObject sMessage = (MessageGetSimpleDeviceObject) sIoTMasterMsg;
+ // TODO: DEBUG
+ System.out.println("\n\nDEBUG: GET ZIGBEE DEVICE IOT SET OBJECT!!!");
+ System.out.println("DEBUG: sMessage host address: " + sMessage.getHostAddress());
+ System.out.println("DEBUG: sMessage source port: " + sMessage.getSourceDeviceDriverPort());
+ System.out.println("DEBUG: sMessage destination port: " + sMessage.getDestinationDeviceDriverPort());
+ System.out.println("DEBUG: sMessage source wild card: " + sMessage.isSourcePortWildCard());
+ System.out.println("DEBUG: sMessage desination wild card: " + sMessage.isDestinationPortWildCard() + "\n\n");
+
// Get IoTSet objects for IP address set on device driver/controller
IoTZigbeeAddress objZBDevAddress = new IoTZigbeeAddress(sMessage.getHostAddress());
RuntimeOutput.print("IoTSlave: Device address transferred: " + sMessage.getHostAddress(), BOOL_VERBOSE);
// Translating into the actual Message class
MessageGetSimpleDeviceObject sMessage = (MessageGetSimpleDeviceObject) sIoTMasterMsg;
+ // TODO: DEBUG
+ System.out.println("\n\nDEBUG: GET ADD IOT SET OBJECT!!!");
+ System.out.println("DEBUG: sMessage host address: " + sMessage.getHostAddress() +);
+
// Get IoTSet objects for IP address set on device driver/controller
IoTAddress objAddress = new IoTAddress(sMessage.getHostAddress());
RuntimeOutput.print("IoTSlave: Address transferred: " + sMessage.getHostAddress(), BOOL_VERBOSE);
*/
private void invokeInitMethod() throws IOException {
+ // TODO: DEBUG
+ System.out.println("\n\nDEBUG: INVOKE INIT METHOD!!!");
+
new Thread() {
public void run() {
try {