use of org.osgi.service.http.runtime.dto.PreprocessorDTO 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);
}
use of org.osgi.service.http.runtime.dto.PreprocessorDTO in project felix by apache.
the class PreprocessorDTOBuilder method build.
/**
* Build a preprocessor DTO from a filter info
* @param info The preprocessor info
* @return A preprocessor DTO
*/
@Nonnull
public static PreprocessorDTO build(@Nonnull final PreprocessorInfo info, final int reason) {
final PreprocessorDTO dto = (reason != -1 ? new FailedPreprocessorDTO() : new PreprocessorDTO());
dto.initParams = info.getInitParameters();
dto.serviceId = info.getServiceId();
if (reason != -1) {
((FailedPreprocessorDTO) dto).failureReason = reason;
}
return dto;
}
Aggregations