Search in sources :

Example 1 with IConfigurationManager

use of com.creditease.agent.spi.IConfigurationManager in project uavstack by uavorg.

the class MSCPGeneralAction method changeNodeConfig.

/**
 * changeNodeConfig
 *
 * @param data
 */
private void changeNodeConfig(UAVHttpMessage data) {
    final Map<String, String> params = data.getRequest();
    final IConfigurationManager icm = this.getConfigManager();
    Thread thd = new Thread(new Runnable() {

        @Override
        public void run() {
            /**
             * fire configuration update event
             */
            icm.fireProfileConfigurationUpdateEvent(params);
        }
    });
    thd.start();
    data.putResponse("rs", "OK");
}
Also used : IConfigurationManager(com.creditease.agent.spi.IConfigurationManager)

Example 2 with IConfigurationManager

use of com.creditease.agent.spi.IConfigurationManager in project uavstack by uavorg.

the class SystemStarter method createConfigurationManager.

private IConfigurationManager createConfigurationManager(Map<String, String> cmdArgs) {
    IConfigurationManager icm = ConfigurationManager.build(cmdArgs);
    icm.init();
    // register systemstarter
    icm.registerComponent("Global", "SystemStarter", this);
    return icm;
}
Also used : IConfigurationManager(com.creditease.agent.spi.IConfigurationManager)

Example 3 with IConfigurationManager

use of com.creditease.agent.spi.IConfigurationManager in project uavstack by uavorg.

the class ConfigurationManager method build.

public static IConfigurationManager build(Map<String, String> cmdArgs) {
    // read profile config from profile properties file
    String profileName = CommonHelper.getValueFromSeqKeys(cmdArgs, new String[] { "-profile", "-p" });
    configMgr = new ConfigurationManager(profileName);
    return configMgr;
}
Also used : IConfigurationManager(com.creditease.agent.spi.IConfigurationManager)

Example 4 with IConfigurationManager

use of com.creditease.agent.spi.IConfigurationManager in project uavstack by uavorg.

the class MSCPPlusIT method onAppStarting.

/**
 * onAppStarting
 *
 * @param args
 */
public void onAppStarting() {
    IConfigurationManager cm = ConfigurationManager.getInstance();
    InterceptSupport iSupport = InterceptSupport.instance();
    InterceptContext context = iSupport.createInterceptContext(Event.WEBCONTAINER_INIT);
    context.put(InterceptConstants.WEBAPPLOADER, this.getClass().getClassLoader());
    context.put(InterceptConstants.WEBWORKDIR, cm.getContext(IConfigurationManager.ROOT));
    context.put(InterceptConstants.CONTEXTPATH, "");
    context.put(InterceptConstants.APPNAME, cm.getContext(IConfigurationManager.NODEAPPID));
    context.put(InterceptConstants.BASEPATH, "/" + cm.getContext(IConfigurationManager.NODEAPPID));
    iSupport.doIntercept(context);
}
Also used : InterceptContext(com.creditease.monitor.interceptframework.spi.InterceptContext) InterceptSupport(com.creditease.monitor.interceptframework.InterceptSupport) IConfigurationManager(com.creditease.agent.spi.IConfigurationManager)

Example 5 with IConfigurationManager

use of com.creditease.agent.spi.IConfigurationManager in project uavstack by uavorg.

the class MSCPPlusIT method onAppStart.

/**
 * onAppStart
 *
 * @param args
 */
public void onAppStart() {
    // String featureName = (String) args[0];
    IConfigurationManager cm = ConfigurationManager.getInstance();
    InterceptSupport iSupport = InterceptSupport.instance();
    InterceptContext context = iSupport.createInterceptContext(Event.WEBCONTAINER_STARTED);
    context.put(InterceptConstants.WEBAPPLOADER, this.getClass().getClassLoader());
    context.put(InterceptConstants.WEBWORKDIR, cm.getContext(IConfigurationManager.ROOT));
    context.put(InterceptConstants.CONTEXTPATH, "");
    context.put(InterceptConstants.APPNAME, cm.getContext(IConfigurationManager.NODEAPPID));
    context.put(InterceptConstants.BASEPATH, "/" + cm.getContext(IConfigurationManager.NODEAPPID));
    iSupport.doIntercept(context);
}
Also used : InterceptContext(com.creditease.monitor.interceptframework.spi.InterceptContext) InterceptSupport(com.creditease.monitor.interceptframework.InterceptSupport) IConfigurationManager(com.creditease.agent.spi.IConfigurationManager)

Aggregations

IConfigurationManager (com.creditease.agent.spi.IConfigurationManager)5 InterceptSupport (com.creditease.monitor.interceptframework.InterceptSupport)2 InterceptContext (com.creditease.monitor.interceptframework.spi.InterceptContext)2