// Sample4/App.java //########################################################## // App Implementation (distributed with callbacks) //########################################################## // public class App { public App() { // Using local : uncomment the next block // ####################################### // A = new Aclass(); // ####################################### // // Using remote : uncomment the next block // ####################################### A = new AclassCI(); try { A.setVerboseFlag(true);// remove to stop messages .. A.createServerInstance("127.0.0.1",6789); }catch(Exception e) {System.out.println(e.getMessage());} // ####################################### // try{ A.setClient((Object)this); // Using the method defined by // cam.netapp.SetClient } catch(Exception e){System.out.println(e);}; } public void testCallBack(String S) { A.useCallBack(S); } public void printString(String S) { System.out.println(S); } //#### DATA MEMBERS #### // Using local : uncomment the next block // ####################################### // Aclass A; // ####################################### // // Using remote : uncomment the next block // ####################################### AclassCI A; // ####################################### // public static void main(String argv[]) { App S = new App(); System.out.println("The String \"Callback Ok\" Indicates Success"); S.testCallBack("Callback OK"); System.exit(0); } }