class ConcurrentRuntime implements PostConstruct, PreDestroy {

    private ContextSetupProviderImpl.CONTEXT_TYPE[] parseContextInfo(String contextInfo, boolean isContextInfoEnabled) {
        ArrayList<ContextSetupProviderImpl.CONTEXT_TYPE> contextTypeArray = new ArrayList<>();
        ContextSetupProviderImpl.CONTEXT_TYPE[] contextTypes = new ContextSetupProviderImpl.CONTEXT_TYPE[] {};
        if (contextInfo == null) {
            // by default, if no context info is passed, we propagate all context types
            contextTypeArray.add(ContextSetupProviderImpl.CONTEXT_TYPE.CLASSLOADING);
            contextTypeArray.add(ContextSetupProviderImpl.CONTEXT_TYPE.NAMING);
            contextTypeArray.add(ContextSetupProviderImpl.CONTEXT_TYPE.SECURITY);
            contextTypeArray.add(ContextSetupProviderImpl.CONTEXT_TYPE.WORKAREA);
            return contextTypeArray.toArray(contextTypes);
        }
        if (isContextInfoEnabled) {
        StringTokenizer st = new StringTokenizer(contextInfo, ",", false);
            while(st.hasMoreTokens()) {
                String token = st.nextToken().trim();
                if (CONTEXT_INFO_CLASSLOADER.equalsIgnoreCase(token)) {
                    contextTypeArray.add(ContextSetupProviderImpl.CONTEXT_TYPE.CLASSLOADING);
                } else if (CONTEXT_INFO_JNDI.equalsIgnoreCase(token)) {
                    contextTypeArray.add(ContextSetupProviderImpl.CONTEXT_TYPE.NAMING);
                } else if (CONTEXT_INFO_SECURITY.equalsIgnoreCase(token)) {
                    contextTypeArray.add(ContextSetupProviderImpl.CONTEXT_TYPE.SECURITY);
                } else if (CONTEXT_INFO_WORKAREA.equalsIgnoreCase(token)) {
                    contextTypeArray.add(ContextSetupProviderImpl.CONTEXT_TYPE.WORKAREA);
                }
            }
        }
        return contextTypeArray.toArray(contextTypes);
    }

      ConcurrentRuntime();

}