//################################################################# //# CodeWizard: Java //# This code was generated with the NimBUS CodeWizard version 1.42 //# Date: 29. kesäkuuta 2007 // package example; import com.nimsoft.nimbus.*; public class example_probe { public static void main(String[] args) { try { example_probe exampleprobe = new example_probe(); exampleprobe.doit(args); }catch(Exception e) { e.printStackTrace(); } } public void doit(String[] args) throws Exception { NimProbe probe = null; // Loop to handle restart. Stop terminates the loop. do { // Construct the probe probe = new NimProbe("example_probe","1.00","My company",args); // Subscribe to message from the hub, register the "hubpost" callback method probe.setSubscribeSubject("alarm"); probe.registerHubpostCallback(this,"hubpostCallback"); // Run until a stop signal is received from the manager. // Restart initiates re-creation of the probe. } while (probe.doForever()); } /** * The "hubpost" callback that receives a PDS with some userdata * @param session The callback session * @param pdsuserdata The PDS user data */ public static void hubpostCallback(NimSession session, PDS pdsuserdata) throws NimException { session.sendReply(NimException.OK,null); // OK return } }