1 package com.jcorporate.expresso.services.controller.configuration; 2 3 66 67 import com.jcorporate.expresso.core.controller.ControllerException; 68 import com.jcorporate.expresso.core.controller.ControllerRequest; 69 import com.jcorporate.expresso.core.controller.State; 70 import com.jcorporate.expresso.kernel.ExpressoComponent; 71 import com.jcorporate.expresso.kernel.RootContainerInterface; 72 import com.jcorporate.expresso.kernel.management.ExpressoRuntimeMap; 73 import com.jcorporate.expresso.kernel.util.LocatorUtils; 74 import com.jcorporate.expresso.services.controller.Configuration; 75 import org.apache.log4j.Logger; 76 77 84 85 public class ConfigurationBase extends State { 86 private Logger log = Logger.getLogger(ConfigurationBase.class); 87 88 protected LocatorUtils lc = null; 89 90 public ConfigurationBase(String name, String description) { 91 super(name, description); 92 } 93 94 101 protected RootContainerInterface getRuntime(ControllerRequest request) 102 throws ControllerException { 103 String key = Configuration.CURRENT_RUNTIME_KEY; 104 String curRuntime = (String ) request.getSession().getPersistentAttribute(key); 105 106 RootContainerInterface returnValue = ExpressoRuntimeMap.getRuntime(curRuntime); 107 if (returnValue == null) { 108 log.error("Unable to find root container interface [aka runtime] for " + key); 109 return null; 110 } 111 112 lc = new LocatorUtils((ExpressoComponent) returnValue); 113 return returnValue; 114 } 115 } | Popular Tags |