package com.eactive.eai.rms.onl.adapter.http.service;

import java.util.ArrayList;
import java.util.List;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

@Service
@Scope("prototype")
@SuppressWarnings(value = { "deprecation", "unchecked" })
public class EaiEngineHttpStatusService {


    public EaiEngineHttpStatusService() {
        super();
    }

    public List getHttpAdapterStatusList() throws Exception {
        ArrayList statusArray = new ArrayList();
//TODO WLS => JBOSS        
//
//        MBeanHomeUtil mbeanHomeUtil = (MBeanHomeUtil) applicationContext.getBean("mbeanHomeUtil");
//
//        Set runtimeSet = mbeanHomeUtil.getMBeanHome().getMBeansByType(
//            "ServletRuntime");
//
//        ServletStatusVO servletVo = null;
//
//        for (Iterator it = runtimeSet.iterator(); it.hasNext();) {
//            ServletRuntimeMBean servletRuntime = (ServletRuntimeMBean) it.next();
//            String servletName = servletRuntime.getServletName();
//            if (HTTP_ADAPTER_NAME.indexOf(servletName) > -1) {
//                servletVo = new ServletStatusVO();
//                servletVo.setServerName(servletRuntime.getObjectName()
//                        .getLocation());
//                servletVo.setExecutionTimeAverage(servletRuntime.getExecutionTimeAverage());
//                servletVo.setExecutionTimeHigh(servletRuntime.getExecutionTimeHigh());
//                servletVo.setExecutionTimeLow(servletRuntime.getExecutionTimeLow());
//                servletVo.setExecutionTimeTotal(servletRuntime.getExecutionTimeTotal());
//                servletVo.setInvocationTotalCount(servletRuntime.getInvocationTotalCount());
//                servletVo.setPoolMaxCapacity(servletRuntime.getPoolMaxCapacity());
//                servletVo.setReloadTotalCount(servletRuntime.getReloadTotalCount());
//                servletVo.setServletName(servletName);
//                servletVo.setServletPath(servletRuntime.getServletPath());
//                statusArray.add(servletVo);
//            }
//        }
        return statusArray;
    }

}
