reload(ThreadLocalPageContext.get());
}
public void reload(PageContext pc) {
ReadOnlyStruct coldfusion=new ReadOnlyStruct();
coldfusion.setEL(PRODUCT_LEVEL,Info.getLevel());
//coldfusion.setEL(PRODUCT_CONTEXT_COUNT,"inf");
coldfusion.setEL(PRODUCT_VERSION,"10,0,0,0");
//coldfusion.setEL(PRODUCT_VERSION,"8,0,0,1");
coldfusion.setEL(SERIAL_NUMBER,"0");
coldfusion.setEL(PRODUCT_NAME,"Railo");
// TODO scope server missing values
coldfusion.setEL(APP_SERVER,"");// Jrun
coldfusion.setEL(EXPIRATION,expired);//
coldfusion.setEL(INSTALL_KIT,"");//
String rootdir="";
try{
rootdir=ThreadLocalPageContext.getConfig(pc).getRootDirectory().getAbsolutePath();
}
catch(Throwable t){}
coldfusion.setEL(ROOT_DIR,rootdir);//
coldfusion.setEL(SUPPORTED_LOCALES,LocaleFactory.getLocaleList());//
coldfusion.setReadOnly(true);
super.setEL (COLDFUSION,coldfusion);
ReadOnlyStruct os=new ReadOnlyStruct();
os.setEL(KeyConstants._name,System.getProperty("os.name") );
os.setEL(ARCH,System.getProperty("os.arch") );
os.setEL(MAC_ADDRESS,SystemUtil.getMacAddress());
int arch=SystemUtil.getOSArch();
if(arch!=SystemUtil.ARCH_UNKNOW)os.setEL(ARCH_MODEL,new Double(arch) );
os.setEL(VERSION,System.getProperty("os.version") );
os.setEL(ADDITIONAL_INFORMATION,"");
os.setEL(BUILD_NUMBER,"");
os.setReadOnly(true);
super.setEL (OS,os);
ReadOnlyStruct railo=new ReadOnlyStruct();
railo.setEL(VERSION,Info.getVersionAsString());
railo.setEL(VERSION_NAME,Info.getVersionName());
railo.setEL(VERSION_NAME_EXPLANATION,Info.getVersionNameExplanation());
railo.setEL(STATE,Info.getStateAsString());
railo.setEL(RELEASE_DATE,Info.getRealeaseDate());
railo.setEL(LOADER_VERSION,Caster.toDouble(SystemUtil.getLoaderVersion()));
railo.setEL(LOADER_PATH, ClassUtil.getSourcePathForClass("railo.loader.servlet.CFMLServlet", ""));
railo.setReadOnly(true);
super.setEL (RAILO,railo);
ReadOnlyStruct separator=new ReadOnlyStruct();
separator.setEL(KeyConstants._path,System.getProperty("path.separator"));
separator.setEL(FILE,System.getProperty("file.separator"));
separator.setEL(KeyConstants._line,System.getProperty("line.separator"));
separator.setReadOnly(true);
super.setEL (SEPARATOR,separator);
ReadOnlyStruct java=new ReadOnlyStruct();
java.setEL(VERSION,System.getProperty("java.version"));
java.setEL(VENDOR,System.getProperty("java.vendor"));
arch=SystemUtil.getJREArch();
if(arch!=SystemUtil.ARCH_UNKNOW)java.setEL(ARCH_MODEL,new Double(arch) );
Runtime rt = Runtime.getRuntime();
java.setEL(FREE_MEMORY,new Double(rt.freeMemory()));
java.setEL(TOTAL_MEMORY,new Double(rt.totalMemory()));
java.setEL(MAX_MEMORY,new Double(rt.maxMemory()));
java.setEL(JAVA_AGENT_SUPPORTED,Caster.toBoolean(InstrumentationUtil.isSupported()));
//if(jap==null) jap=JavaUtil.getSourcePathForClass("railo.runtime.instrumentation.Agent");
//java.setEL(JAVA_AGENT_PATH, jap);
if(jep==null) {
String temp = System.getProperty( "user.dir", "" );
if ( !StringUtil.isEmpty(temp) && !temp.endsWith( File.separator ) )
temp = temp + File.separator;
jep=temp;
}
java.setEL( JAVA_EXECUTION_PATH, jep );
java.setReadOnly(true);
super.setEL (JAVA,java);
ReadOnlyStruct servlet=new ReadOnlyStruct();
String name="";
try{
name=pc.getServletContext().getServerInfo();
}
catch(Throwable t){}
servlet.setEL(KeyConstants._name,name);
servlet.setReadOnly(true);
super.setEL (SERVLET,servlet);
}