Read Jaguar server properties(this howto is deprecated)Tag(s): DEPRECATED


java.util.Properties props = new java.util.Properties();
props.put("org.omg.CORBA.ORBClass", "com.sybase.CORBA.ORB");
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init((String[])null, props);
com.sybase.jaguar.system.Repository repository =
  com.sybase.jaguar.system.RepositoryHelper.narrow
     (orb.string_to_object("Jaguar/Repository"));

// extract all server properties
com.sybase.jaguar.system.Property svrProps[] =
   repository.lookup
     ("Server", com.sybase.jaguar.server.Jaguar.getServerName());

// transfert into HashTable
java.util.Hashtable svrSettings = new java.util.Hashtable();
for(int i = 0 ; i < svrProps.length; i ++) {
    svrSettings.put(svrProps[i].name, svrProps[i].value);
}

// then you can access server properties with
//   svrSettings.get("property name")
// example :
//   svrSettings.get("com.sybase.jaguar.server.http.logdir")


blog comments powered by Disqus