Adjusting and cleaning up ZigbeeTest to install Vigilia ZigBee gateway and devices.
[iot2.git] / iotjava / iotrmi / Java / sample / TestClass.java
index 07a167987a43bbd48b5c56946621647040ae34f6..6d547ba518dea23b29193f274826312810057410 100644 (file)
@@ -107,18 +107,79 @@ public class TestClass implements TestClassInterface {
                for (CallBackInterface cb : cblist) {
                        sum = sum + cb.printInt();
                }
-               //sum = cblist.get(1).printInt();
-
+               
+               /*final CallBackInterface cb1 = cblist.get(1);
+               final CallBackInterface cb2 = cblist.get(2);
+
+               Thread thread1 = new Thread() {
+                       public void run() {
+                   try{
+                                       for(int i = 0; i < 10; i++) {
+                                               cb1.printInt();
+                                               Thread.sleep(1000);
+                                       }
+                               } catch (Exception ex){
+                                       ex.printStackTrace();
+                                       throw new Error("Error running thread!");
+                   }
+               }
+           };
+               thread1.start();
+
+               Thread thread2 = new Thread() {
+                       public void run() {
+                   try{
+                                       for(int i = 0; i < 10; i++) {
+                                               cb2.printInt();
+                                               Thread.sleep(1000);
+                                       }
+                               } catch (Exception ex){
+                                       ex.printStackTrace();
+                                       throw new Error("Error running thread!");
+                   }
+               }
+           };
+               thread2.start();
+
+               return 1;*/
                return sum;
        }
 
+       public StructJ[] handleStruct(StructJ[] data) {
+
+               for (StructJ str : data) {
+                       System.out.println("Name: " + str.name);
+                       System.out.println("Value: " + str.value);
+                       System.out.println("Year: " + str.year);
+               }
+
+               StructJ test = new StructJ();
+               test.name = "Anonymous";
+               test.value = 1.33f;
+               test.year = 2016;
+
+               data[0] = test;
+
+               return data;
+       }
+
+
+       public EnumJ[] handleEnum(EnumJ[] en) {
+
+               for (EnumJ e : en) {
+                       System.out.println("Enum: " + e);
+               }
+               
+               return en;
+       }
+
 
        public static void main(String[] args) {
 
-               TestClass tc = new TestClass();
-               CallBack cb = new CallBack(3);
+               //TestClass tc = new TestClass();
+               //CallBack cb = new CallBack(3);
 
-               tc.registerCallback(cb);
-               System.out.println("Return value: " + tc.callBack());
+               //tc.registerCallback(cb);
+               //System.out.println("Return value: " + tc.callBack());
        }
 }