Search in sources :

Example 1 with NavajoConfigInterface

use of com.dexels.navajo.server.NavajoConfigInterface in project navajo by Dexels.

the class JMXHelper method getObjectName.

private static final ObjectName getObjectName(String domain, String type) {
    if (applicationPrefix == null) {
        synchronized (semaphore) {
            DispatcherInterface instance = DispatcherFactory.getInstance();
            if (instance == null) {
                // logger.debug("Navajo instance not started. Is navajo context listener valid? Check web.xml");
                return null;
            }
            NavajoConfigInterface navajoConfig = instance.getNavajoConfig();
            if (navajoConfig == null) {
                throw new RuntimeException("Navajo instance not started. Is navajo context listener valid? Check web.xml");
            }
            applicationPrefix = navajoConfig.getInstanceName();
            if (applicationPrefix == null) {
                applicationPrefix = "unnamedapplication";
            }
        }
    }
    try {
        return new ObjectName(constructObjectName(domain) + type + ",instance=" + applicationPrefix);
    } catch (MalformedObjectNameException e) {
        logger.error("Error: ", e);
        return null;
    } catch (NullPointerException e) {
        logger.error("Error: ", e);
        return null;
    }
}
Also used : MalformedObjectNameException(javax.management.MalformedObjectNameException) DispatcherInterface(com.dexels.navajo.server.DispatcherInterface) NavajoConfigInterface(com.dexels.navajo.server.NavajoConfigInterface) ObjectName(javax.management.ObjectName)

Example 2 with NavajoConfigInterface

use of com.dexels.navajo.server.NavajoConfigInterface in project navajo by Dexels.

the class AdminMap method load.

@Override
public void load(Access access) throws MappableException, UserException {
    NavajoConfigInterface nc = DispatcherFactory.getInstance().getNavajoConfig();
    scriptPath = ensurePathEndsWithSeparator(nc.getScriptPath());
    configPath = ensurePathEndsWithSeparator(nc.getConfigPath());
    adapterPath = ensurePathEndsWithSeparator(nc.getAdapterPath());
    compiledScriptPath = ensurePathEndsWithSeparator(nc.getCompiledScriptPath());
    rootPath = ensurePathEndsWithSeparator(nc.getRootPath());
    supportsAsync = true;
    supportsStore = (nc.getAsyncStore() != null);
    supportsIntegrity = false;
    supportsStatistics = nc.isEnableStatisticsRunner();
    supportsLocks = nc.isLockManagerEnabled();
    serverId = DispatcherFactory.getInstance().getApplicationId();
    myAccess = access;
    instanceName = nc.getInstanceName();
    instanceGroup = nc.getInstanceGroup();
    clientId = access.getClientToken();
}
Also used : NavajoConfigInterface(com.dexels.navajo.server.NavajoConfigInterface)

Aggregations

NavajoConfigInterface (com.dexels.navajo.server.NavajoConfigInterface)2 DispatcherInterface (com.dexels.navajo.server.DispatcherInterface)1 MalformedObjectNameException (javax.management.MalformedObjectNameException)1 ObjectName (javax.management.ObjectName)1