1 5 package org.exoplatform.portlet.exomvc.config; 6 7 import org.exoplatform.portlet.exomvc.Page; 8 13 public class POJOPageConfig extends PageConfig { 14 private String className_ ; 15 private Page cache_ ; 16 17 public String getClassName() { return className_ ; } 18 public POJOPageConfig setClassName(String className) { 19 className_ = className ; 20 return this ; 21 } 22 23 public Page getPageObject(Configuration configuration) throws Exception { 24 if(cache_ != null) return cache_ ; 25 synchronized(configuration) { 26 ClassLoader cl = Thread.currentThread().getContextClassLoader() ; 27 Class clazz = cl.loadClass(className_) ; 28 cache_ = (Page) clazz.newInstance() ; 29 cache_.setConfiguration(configuration) ; 30 cache_.setPageName(getPageName()) ; 31 } 32 return cache_ ; 33 } 34 } | Popular Tags |