try { ORB orb = ORB.init(args, null); POA rootpoa = POAHelper.narrow(orb .resolve_initial_references("RootPOA")); rootpoa.the_POAManager().activate(); ProfilerServant profilerServant = new ProfilerServant(args[4], args[5].equals("true")); org.omg.CORBA.Object ref = rootpoa .servant_to_reference(profilerServant); Profiler pref = ProfilerHelper.narrow(ref); org.omg.CORBA.Object objRef = orb .resolve_initial_references("NameService"); NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef); String name = "Profiler"; NameComponent path[] = ncRef.to_name(name); ncRef.rebind(path, pref); orb.run(); } catch (Exception e) { System.err.println("ERROR: " + e.getMessage()); e.printStackTrace(System.out); } }
<pre lang="c#">public class ProfilerServant extends ProfilerPOA { boolean cacheEnabled; ServerParser parser; HashMap<String, Integer> songCache; HashMap<String, User> userCache; ProfilerServant(String fileName, boolean cacheEnabled) { this.cacheEnabled = cacheEnabled; parser = new ServerParser(fileName); songCache = new HashMap<String, Integer>(); userCache = new HashMap<String, User>(); init(); }
ProfilerServant profilerServant = new ProfilerServant(args[4], args[5].equals("true"));
args
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)