Search in sources :

Example 1 with RegistryRuntime

use of org.apache.felix.http.base.internal.runtime.dto.RegistryRuntime in project felix by apache.

the class WhiteboardManager method getRuntimeInfo.

public RegistryRuntime getRuntimeInfo() {
    final FailedDTOHolder failedDTOHolder = new FailedDTOHolder();
    final Collection<ServletContextDTO> contextDTOs = new ArrayList<>();
    // get sort list of context handlers
    final List<WhiteboardContextHandler> contextHandlerList = new ArrayList<>();
    synchronized (this.contextMap) {
        for (final List<WhiteboardContextHandler> list : this.contextMap.values()) {
            if (!list.isEmpty()) {
                contextHandlerList.add(list.get(0));
            }
        }
        this.failureStateHandler.getRuntimeInfo(failedDTOHolder);
    }
    Collections.sort(contextHandlerList);
    for (final WhiteboardContextHandler handler : contextHandlerList) {
        final ServletContextDTO scDTO = ServletContextDTOBuilder.build(handler.getContextInfo(), handler.getSharedContext(), -1);
        if (registry.getRuntimeInfo(scDTO, failedDTOHolder)) {
            contextDTOs.add(scDTO);
        }
    }
    final List<PreprocessorDTO> preprocessorDTOs = new ArrayList<>();
    final List<PreprocessorHandler> localHandlers = this.preprocessorHandlers;
    for (final PreprocessorHandler handler : localHandlers) {
        preprocessorDTOs.add(PreprocessorDTOBuilder.build(handler.getPreprocessorInfo(), -1));
    }
    return new RegistryRuntime(failedDTOHolder, contextDTOs, preprocessorDTOs);
}
Also used : FailedDTOHolder(org.apache.felix.http.base.internal.runtime.dto.FailedDTOHolder) ServletContextDTO(org.osgi.service.http.runtime.dto.ServletContextDTO) PreprocessorDTO(org.osgi.service.http.runtime.dto.PreprocessorDTO) PreprocessorHandler(org.apache.felix.http.base.internal.handler.PreprocessorHandler) ArrayList(java.util.ArrayList) RegistryRuntime(org.apache.felix.http.base.internal.runtime.dto.RegistryRuntime)

Aggregations

ArrayList (java.util.ArrayList)1 PreprocessorHandler (org.apache.felix.http.base.internal.handler.PreprocessorHandler)1 FailedDTOHolder (org.apache.felix.http.base.internal.runtime.dto.FailedDTOHolder)1 RegistryRuntime (org.apache.felix.http.base.internal.runtime.dto.RegistryRuntime)1 PreprocessorDTO (org.osgi.service.http.runtime.dto.PreprocessorDTO)1 ServletContextDTO (org.osgi.service.http.runtime.dto.ServletContextDTO)1