Search in sources :

Example 1 with ConfigServer

use of lucee.runtime.config.ConfigServer in project Lucee by lucee.

the class Admin method doTerminateRunningThread.

private void doTerminateRunningThread() throws PageException {
    int id = getInt("admin", "RemoveRunningThread", "id");
    if (type == TYPE_WEB) {
        terminateRunningThread(pageContext.getConfig(), id);
    } else {
        ConfigServer cs = pageContext.getConfig().getConfigServer(password);
        ConfigWeb[] webs = cs.getConfigWebs();
        for (int i = 0; i < webs.length; i++) {
            if (terminateRunningThread(webs[i], id))
                break;
        }
    }
}
Also used : ConfigServer(lucee.runtime.config.ConfigServer) ConfigWeb(lucee.runtime.config.ConfigWeb)

Example 2 with ConfigServer

use of lucee.runtime.config.ConfigServer in project Lucee by lucee.

the class Admin method doGetSecurityManager.

private void doGetSecurityManager() throws PageException {
    ConfigServer cs = ConfigImpl.getConfigServer(config, password);
    SecurityManager sm = cs.getSecurityManager(getString("admin", action, "id"));
    _fillSecData(sm);
}
Also used : SecurityManager(lucee.runtime.security.SecurityManager) ConfigServer(lucee.runtime.config.ConfigServer)

Example 3 with ConfigServer

use of lucee.runtime.config.ConfigServer in project Lucee by lucee.

the class Admin method doGetDefaultSecurityManager.

/**
 * @throws PageException
 */
private void doGetDefaultSecurityManager() throws PageException {
    ConfigServer cs = ConfigImpl.getConfigServer(config, password);
    SecurityManager dsm = cs.getDefaultSecurityManager();
    _fillSecData(dsm);
}
Also used : SecurityManager(lucee.runtime.security.SecurityManager) ConfigServer(lucee.runtime.config.ConfigServer)

Example 4 with ConfigServer

use of lucee.runtime.config.ConfigServer in project Lucee by lucee.

the class Admin method doStopThread.

private void doStopThread() throws PageException {
    String contextId = getString("admin", "stopThread", "contextId");
    String threadId = getString("admin", "stopThread", "threadId");
    String stopType = getString("stopType", "exception");
    if (!(config instanceof ConfigServer))
        throw new ApplicationException("invalid context for this action");
    ConfigServer cs = (ConfigServer) config;
    ConfigWeb[] webs = cs.getConfigWebs();
    boolean has = false;
    for (int i = 0; i < webs.length; i++) {
        ConfigWebImpl cw = (ConfigWebImpl) webs[i];
        if (!cw.getIdentification().getId().equals(contextId))
            continue;
        ((CFMLFactoryImpl) cw.getFactory()).stopThread(threadId, stopType);
        has = true;
        break;
    }
    if (!has) {
        for (int i = 0; i < webs.length; i++) {
            ConfigWebImpl cw = (ConfigWebImpl) webs[i];
            if (!contextId.equals(cw.getLabel()))
                continue;
            ((CFMLFactoryImpl) cw.getFactory()).stopThread(threadId, stopType);
            has = true;
            break;
        }
    }
}
Also used : ConfigWebImpl(lucee.runtime.config.ConfigWebImpl) ApplicationException(lucee.runtime.exp.ApplicationException) CFMLFactoryImpl(lucee.runtime.CFMLFactoryImpl) ConfigServer(lucee.runtime.config.ConfigServer) ConfigWeb(lucee.runtime.config.ConfigWeb)

Example 5 with ConfigServer

use of lucee.runtime.config.ConfigServer in project Lucee by lucee.

the class Admin method doGetRunningThreads.

private void doGetRunningThreads() throws PageException {
    lucee.runtime.type.Query qry = new QueryImpl(new String[] { "Id", "Start", "Timeout", "ThreadType", "StackTrace", "TagContext", "Label", "RootPath", "ConfigFile", "URL" }, 0, "query");
    if (type == TYPE_WEB) {
        fillGetRunningThreads(qry, pageContext.getConfig());
    } else {
        ConfigServer cs = pageContext.getConfig().getConfigServer(password);
        ConfigWeb[] webs = cs.getConfigWebs();
        for (int i = 0; i < webs.length; i++) {
            fillGetRunningThreads(qry, webs[i]);
        }
    }
    pageContext.setVariable(getString("admin", action, "returnVariable"), qry);
}
Also used : QueryImpl(lucee.runtime.type.QueryImpl) ConfigServer(lucee.runtime.config.ConfigServer) ConfigWeb(lucee.runtime.config.ConfigWeb) Query(lucee.runtime.type.Query)

Aggregations

ConfigServer (lucee.runtime.config.ConfigServer)11 ConfigWeb (lucee.runtime.config.ConfigWeb)6 ConfigWebImpl (lucee.runtime.config.ConfigWebImpl)6 CFMLFactoryImpl (lucee.runtime.CFMLFactoryImpl)3 Struct (lucee.runtime.type.Struct)3 StructImpl (lucee.runtime.type.StructImpl)3 CFMLEngineImpl (lucee.runtime.engine.CFMLEngineImpl)2 ApplicationException (lucee.runtime.exp.ApplicationException)2 SecurityManager (lucee.runtime.security.SecurityManager)2 Query (lucee.runtime.type.Query)2 QueryImpl (lucee.runtime.type.QueryImpl)2 IOException (java.io.IOException)1 MalformedURLException (java.net.MalformedURLException)1 Enumeration (java.util.Enumeration)1 ServletConfig (javax.servlet.ServletConfig)1 Mapping (lucee.runtime.Mapping)1 PageContextImpl (lucee.runtime.PageContextImpl)1 ConfigImpl (lucee.runtime.config.ConfigImpl)1 Password (lucee.runtime.config.Password)1 ActiveLock (lucee.runtime.debug.ActiveLock)1