Search in sources :

Example 1 with ConfigServerImpl

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();
}
Also used : ConfigServerImpl(lucee.runtime.config.ConfigServerImpl)

Example 2 with ConfigServerImpl

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;
}
Also used : MalformedURLException(java.net.MalformedURLException) CFMLFactoryImpl(lucee.runtime.CFMLFactoryImpl) ServletContext(javax.servlet.ServletContext) CFMLFactory(lucee.runtime.CFMLFactory) ConfigServerImpl(lucee.runtime.config.ConfigServerImpl) URL(java.net.URL)

Example 3 with ConfigServerImpl

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()));
    }
}
Also used : ConfigServerImpl(lucee.runtime.config.ConfigServerImpl)

Example 4 with ConfigServerImpl

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);
    }
}
Also used : Resource(lucee.commons.io.res.Resource) ConfigServerImpl(lucee.runtime.config.ConfigServerImpl) ConfigWeb(lucee.runtime.config.ConfigWeb)

Example 5 with ConfigServerImpl

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;
}
Also used : Resource(lucee.commons.io.res.Resource) ConfigServerImpl(lucee.runtime.config.ConfigServerImpl)

Aggregations

ConfigServerImpl (lucee.runtime.config.ConfigServerImpl)9 Resource (lucee.commons.io.res.Resource)2 BundleCollection (lucee.loader.osgi.BundleCollection)2 CFMLFactory (lucee.runtime.CFMLFactory)2 CFMLFactoryImpl (lucee.runtime.CFMLFactoryImpl)2 ApplicationException (lucee.runtime.exp.ApplicationException)2 IntervallMonitor (lucee.runtime.monitor.IntervallMonitor)2 RequestMonitor (lucee.runtime.monitor.RequestMonitor)2 Collection (lucee.runtime.type.Collection)2 Query (lucee.runtime.type.Query)2 QueryImpl (lucee.runtime.type.QueryImpl)2 MalformedURLException (java.net.MalformedURLException)1 URL (java.net.URL)1 ServletContext (javax.servlet.ServletContext)1 ConfigWeb (lucee.runtime.config.ConfigWeb)1 ConfigWebImpl (lucee.runtime.config.ConfigWebImpl)1 Monitor (lucee.runtime.monitor.Monitor)1 Struct (lucee.runtime.type.Struct)1 StructImpl (lucee.runtime.type.StructImpl)1