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

import com.eactive.eai.common.util.ContainerUtil;
import com.eactive.eai.env.ElinkConfig;
import com.eactive.eai.rms.client.service.activemq.SingleQueueMonitoringForActiveMq;
import com.eactive.eai.rms.client.service.weblogic.SingleQueueMonitoringForWebLogic;
import com.eactive.eai.rms.client.service.weblogic.SingleServerMonitoringForWebLogic;
import com.eactive.eai.rms.client.service.websphere.SingleQueueMonitoringForWebSphere;
import com.eactive.eai.rms.client.service.websphere.SingleServerMonitoringForWebSphere;

public class JMXMonitoringFactory 
{ 
    private JMXMonitoringFactory() {
    }
    
    public static JMXMonitoring createServerMonitoring(int type) throws Exception {
    	if (ContainerUtil.WEBLOGIC == type ){
    		return SingleServerMonitoringForWebLogic.getInstance();
    	}else if (ContainerUtil.WEBSPHERE == type ){
    		return SingleServerMonitoringForWebSphere.getInstance();
    	}
        return null;
    }
    public static JMXMonitoring createQueueMonitoring(int type) throws Exception {
    	if(ElinkConfig.isUseInternalQueue()) {
    		return SingleQueueMonitoringForActiveMq.getInstance();
    	}
    	if (ContainerUtil.WEBLOGIC == type ){
    		return SingleQueueMonitoringForWebLogic.getInstance();
    	}else if (ContainerUtil.WEBSPHERE == type ){
    		return SingleQueueMonitoringForWebSphere.getInstance();
    	}
    	return null;
    }
} 
