KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > portlet > exomvc > config > JSPPageConfig


1 /***************************************************************************
2  * Copyright 2001-2003 The eXo Platform SARL All rights reserved. *
3  * Please look at license.txt in info directory for more license detail. *
4  **************************************************************************/

5 package org.exoplatform.portlet.exomvc.config;
6
7 import org.exoplatform.portlet.exomvc.Page;
8 import org.exoplatform.portlet.exomvc.JSPPage;
9 /**
10  * @author Tuan Nguyen (tuan08@users.sourceforge.net)
11  * @since Nov 11, 2004
12  * @version $Id$
13  */

14 public class JSPPageConfig extends PageConfig {
15   private String JavaDoc jspPage_ ;
16   private String JavaDoc pageClassName_ = "org.exoplatform.portlet.mvc.JSPPage";
17   private JSPPage cache_ ;
18   
19   public String JavaDoc getJSPPage() { return jspPage_ ; }
20   public JSPPageConfig setJSPPage(String JavaDoc className) {
21     jspPage_ = className ;
22     return this ;
23   }
24   
25   public String JavaDoc getPageClassName() { return pageClassName_ ; }
26   public JSPPageConfig setPageClassName(String JavaDoc s) {
27     pageClassName_ = s ;
28     return this ;
29   }
30   
31   public Page getPageObject(Configuration configuration) throws Exception JavaDoc {
32     if(cache_ != null) return cache_ ;
33     synchronized(configuration) {
34       ClassLoader JavaDoc cl = Thread.currentThread().getContextClassLoader() ;
35       Class JavaDoc clazz = cl.loadClass(pageClassName_) ;
36       cache_ = (JSPPage) clazz.newInstance() ;
37       cache_.setConfiguration(configuration) ;
38       cache_.setPageName(getPageName()) ;
39       cache_.setJSPPage(jspPage_) ;
40     }
41     return cache_ ;
42   }
43 }
Popular Tags