1 package test.memoryusage; 2 3 import org.omg.CosNaming.*; 4 5 public class Client 6 { 7 public static void main(String args[]) 8 { 9 int objects = 0; 10 11 try 12 { 13 System.out.println(">testing client..."); 15 16 org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args,null); 17 18 NamingContextExt nc = 19 NamingContextExtHelper.narrow(orb.resolve_initial_references("NameService")); 20 SessionFactory df = 21 SessionFactoryHelper.narrow(nc.resolve(nc.to_name("SessionFactory"))); 22 for (objects = 0; objects < 1000000; objects++) 23 { 24 Session session = df.get_Session("AS", "", "", ""); 25 String sessionID = session.getID(); 26 df.releaseSession(session); 27 }; 30 System.out.println(">done."); 31 } 32 catch(Exception e) 33 { 34 System.err.println("loops so far: " + objects); 35 System.err.println("ERROR: " + e); 36 e.printStackTrace(System.out); 37 } 38 } 39 } 40 41 42 43 | Popular Tags |