use of org.osgi.service.http.runtime.dto.FailedResourceDTO in project felix by apache.
the class RuntimeDTOBuilder method build.
public RuntimeDTO build() {
final RuntimeDTO runtimeDTO = new RuntimeDTO();
runtimeDTO.serviceDTO = createServiceDTO();
runtimeDTO.servletContextDTOs = createContextDTOs();
runtimeDTO.preprocessorDTOs = createPreprocessorDTOs();
runtimeDTO.failedErrorPageDTOs = registry.getFailedDTOHolder().failedErrorPageDTOs.toArray(new FailedErrorPageDTO[registry.getFailedDTOHolder().failedErrorPageDTOs.size()]);
runtimeDTO.failedFilterDTOs = registry.getFailedDTOHolder().failedFilterDTOs.toArray(new FailedFilterDTO[registry.getFailedDTOHolder().failedFilterDTOs.size()]);
runtimeDTO.failedListenerDTOs = registry.getFailedDTOHolder().failedListenerDTOs.toArray(new FailedListenerDTO[registry.getFailedDTOHolder().failedListenerDTOs.size()]);
runtimeDTO.failedResourceDTOs = registry.getFailedDTOHolder().failedResourceDTOs.toArray(new FailedResourceDTO[registry.getFailedDTOHolder().failedResourceDTOs.size()]);
runtimeDTO.failedServletContextDTOs = registry.getFailedDTOHolder().failedServletContextDTOs.toArray(new FailedServletContextDTO[registry.getFailedDTOHolder().failedServletContextDTOs.size()]);
runtimeDTO.failedServletDTOs = registry.getFailedDTOHolder().failedServletDTOs.toArray(new FailedServletDTO[registry.getFailedDTOHolder().failedServletDTOs.size()]);
runtimeDTO.failedPreprocessorDTOs = registry.getFailedDTOHolder().failedPreprocessorDTOs.toArray(new FailedPreprocessorDTO[registry.getFailedDTOHolder().failedPreprocessorDTOs.size()]);
return runtimeDTO;
}
use of org.osgi.service.http.runtime.dto.FailedResourceDTO in project felix by apache.
the class ResourceDTOBuilder method build.
/**
* Build a servlet DTO from a servlet info
* @param info The servlet info
* @return A servlet DTO
*/
public static ResourceDTO build(final ResourceInfo info, final boolean failed) {
final ResourceDTO dto = (failed ? new FailedResourceDTO() : new ResourceDTO());
dto.patterns = BuilderConstants.copyWithDefault(info.getPatterns(), BuilderConstants.EMPTY_STRING_ARRAY);
dto.prefix = info.getPrefix();
dto.serviceId = info.getServiceId();
return dto;
}
use of org.osgi.service.http.runtime.dto.FailedResourceDTO in project felix by apache.
the class ResourceDTOBuilder method build.
/**
* Build a servlet DTO from a servlet handler
* @param handler The servlet handler
* @param reason If reason is -1, a servlet DTO is created, otherwise a failed servlet DTO is returned
* @return A servlet DTO
*/
public static ResourceDTO build(final ServletHandler handler, final int reason) {
final ResourceDTO dto = build(handler.getServletInfo(), reason != -1);
dto.servletContextId = handler.getContextServiceId();
if (reason != -1) {
((FailedResourceDTO) dto).failureReason = reason;
}
return dto;
}
Aggregations