1 5 package org.exoplatform.portlet.exomvc.config; 6 7 import java.net.URL ; 8 import javax.portlet.PortletContext; 9 import org.exoplatform.container.RootContainer; 10 import org.exoplatform.container.groovy.GroovyManager; 11 import org.exoplatform.container.groovy.GroovyManagerContainer; 12 13 18 public class GroovyResourceManager { 19 private GroovyManager gmanager_ ; 20 21 public GroovyResourceManager(PortletContext context, String repo ) throws Exception { 22 RootContainer root = RootContainer.getInstance() ; 23 GroovyManagerContainer container = 24 (GroovyManagerContainer)root.getComponentInstanceOfType(GroovyManagerContainer.class) ; 25 String realpath = context.getRealPath(repo + "/groovy") + "/" ; 26 URL classpath = root.getOSEnvironment().createURL(realpath) ; 27 container.removeGroovyManager(classpath) ; 28 gmanager_ = container.getGroovyManager(classpath) ; 29 } 30 31 public GroovyManager getGroovyManager() { return gmanager_ ; } 32 33 public void destroy() { 34 gmanager_.setDispose(true) ; 35 } 36 } 37 | Popular Tags |