use of lucee.runtime.config.ConfigServerImpl in project Lucee by lucee.
the class Admin method doRemoveContext.
private void doRemoveContext() throws PageException {
String strRealpath = getString("admin", action, "destination");
ConfigServerImpl server = (ConfigServerImpl) config;
try {
admin.removeContext(server, true, strRealpath);
} catch (Throwable t) {
ExceptionUtil.rethrowIfNecessary(t);
throw Caster.toPageException(t);
}
store();
}
use of lucee.runtime.config.ConfigServerImpl in project Lucee by lucee.
the class CFMLEngineImpl method getCFMLFactory.
@Override
public CFMLFactory getCFMLFactory(ServletConfig srvConfig, HttpServletRequest req) throws ServletException {
ServletContext srvContext = srvConfig.getServletContext();
String real = ReqRspUtil.getRootPath(srvContext);
ConfigServerImpl cs = getConfigServerImpl();
// Load JspFactory
CFMLFactory factory = contextes.get(real);
if (factory == null) {
factory = initContextes.get(real);
if (factory == null) {
factory = loadJSPFactory(cs, srvConfig, initContextes.size());
initContextes.put(real, factory);
}
contextes.put(real, factory);
try {
String cp = req.getContextPath();
if (cp == null)
cp = "";
((CFMLFactoryImpl) factory).setURL(new URL(req.getScheme(), req.getServerName(), req.getServerPort(), cp));
} catch (MalformedURLException e) {
SystemOut.printDate(e);
}
}
return factory;
}
use of lucee.runtime.config.ConfigServerImpl in project Lucee by lucee.
the class Admin method doIsMonitorEnabled.
private void doIsMonitorEnabled() throws PageException {
if (config instanceof ConfigServerImpl) {
ConfigServerImpl cs = (ConfigServerImpl) config;
pageContext.setVariable(getString("admin", action, "returnVariable"), Caster.toBoolean(cs.isMonitoringEnabled()));
}
}
use of lucee.runtime.config.ConfigServerImpl in project Lucee by lucee.
the class Admin method doUpdateContext.
private void doUpdateContext() throws PageException, IOException {
String strSrc = getString("admin", action, "source");
String strRealpath = getString("admin", action, "destination");
Resource src = ResourceUtil.toResourceExisting(pageContext, strSrc);
ConfigServerImpl server = (ConfigServerImpl) ConfigImpl.getConfigServer(config, password);
Resource trg, p;
Resource deploy = server.getConfigDir().getRealResource("web-context-deployment");
deploy.mkdirs();
// deploy it
trg = deploy.getRealResource(strRealpath);
if (trg.exists())
trg.remove(true);
p = trg.getParentResource();
if (!p.isDirectory())
p.createDirectory(true);
src.copyTo(trg, false);
store();
ConfigWeb[] webs = server.getConfigWebs();
for (int i = 0; i < webs.length; i++) {
ConfigWebUtil.deployWebContext(server, webs[i], true);
}
}
use of lucee.runtime.config.ConfigServerImpl in project Lucee by lucee.
the class Admin method getContextDirectory.
private Resource getContextDirectory() throws PageException {
ConfigServerImpl cs = (ConfigServerImpl) ConfigImpl.getConfigServer(config, password);
Resource dist = cs.getConfigDir().getRealResource("distribution");
dist.mkdirs();
return dist;
}
Aggregations