Search in sources :

Example 6 with FailedResourceDTO

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;
}
Also used : FailedFilterDTO(org.osgi.service.http.runtime.dto.FailedFilterDTO) FailedErrorPageDTO(org.osgi.service.http.runtime.dto.FailedErrorPageDTO) FailedServletDTO(org.osgi.service.http.runtime.dto.FailedServletDTO) FailedListenerDTO(org.osgi.service.http.runtime.dto.FailedListenerDTO) FailedResourceDTO(org.osgi.service.http.runtime.dto.FailedResourceDTO) FailedPreprocessorDTO(org.osgi.service.http.runtime.dto.FailedPreprocessorDTO) RuntimeDTO(org.osgi.service.http.runtime.dto.RuntimeDTO) FailedServletContextDTO(org.osgi.service.http.runtime.dto.FailedServletContextDTO)

Example 7 with FailedResourceDTO

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;
}
Also used : FailedResourceDTO(org.osgi.service.http.runtime.dto.FailedResourceDTO) FailedResourceDTO(org.osgi.service.http.runtime.dto.FailedResourceDTO) ResourceDTO(org.osgi.service.http.runtime.dto.ResourceDTO)

Example 8 with FailedResourceDTO

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;
}
Also used : FailedResourceDTO(org.osgi.service.http.runtime.dto.FailedResourceDTO) ResourceDTO(org.osgi.service.http.runtime.dto.ResourceDTO)

Aggregations

FailedResourceDTO (org.osgi.service.http.runtime.dto.FailedResourceDTO)8 ResourceDTO (org.osgi.service.http.runtime.dto.ResourceDTO)5 FailedServletDTO (org.osgi.service.http.runtime.dto.FailedServletDTO)4 FailedErrorPageDTO (org.osgi.service.http.runtime.dto.FailedErrorPageDTO)3 FailedFilterDTO (org.osgi.service.http.runtime.dto.FailedFilterDTO)3 FailedListenerDTO (org.osgi.service.http.runtime.dto.FailedListenerDTO)3 FailedServletContextDTO (org.osgi.service.http.runtime.dto.FailedServletContextDTO)3 Map (java.util.Map)2 ServletInfo (org.apache.felix.http.base.internal.runtime.ServletInfo)2 FailedPreprocessorDTO (org.osgi.service.http.runtime.dto.FailedPreprocessorDTO)2 RuntimeDTO (org.osgi.service.http.runtime.dto.RuntimeDTO)2 ServletDTO (org.osgi.service.http.runtime.dto.ServletDTO)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 TreeMap (java.util.TreeMap)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 FilterInfo (org.apache.felix.http.base.internal.runtime.FilterInfo)1 ListenerInfo (org.apache.felix.http.base.internal.runtime.ListenerInfo)1 PreprocessorInfo (org.apache.felix.http.base.internal.runtime.PreprocessorInfo)1 ResourceInfo (org.apache.felix.http.base.internal.runtime.ResourceInfo)1