package com.eactive.eai.rms.client.context;

import com.eactive.eai.common.server.Keys;

public class MonitoringContextFactory {

    public MonitoringContextFactory() {
    }

    public void create() {
        String logPathType = System.getProperty(Keys.SERVER_KEY).substring(0,5)+"G";
        System.setProperty("logPathType", logPathType);  
        RmsContext.getInstance();
    }
    
    public void create(String[] config) {
        String logPathType = System.getProperty(Keys.SERVER_KEY).substring(0,5)+"G";
        System.setProperty("logPathType", logPathType);
        RmsContext.getInstance(config);
    }
    
    public void stop() {
        RmsContext.getInstance().close();;
    }
    
//    public static void main(String[] args) {
//        try {
//            Class<?> clazz = Class.forName("com.eactive.eai.rms.client.context.MonitoringContextFactory");
//
//            Object factory = clazz.newInstance();
//            Method method = clazz.getMethod("create");
//            method.invoke(factory);
//
//            System.out.println("RMS CLIENT 가 실행 되었습니다. !!!!!");
//        } catch (Throwable e) {
//            System.out.println("모니터링 에이전트가 실행 되지 않았습니다.!!!! ");
//            //e.printStackTrace();
//        }
//    }
}
