Search in sources :

Example 6 with ServletDTO

use of org.osgi.service.http.runtime.dto.ServletDTO in project felix by apache.

the class HttpServiceRuntimeTest method assertServlet.

private void assertServlet(final ServletDTO[] servletDTOs, final String name, final long contextServiceId) {
    assertNotNull(servletDTOs);
    for (final ServletDTO dto : servletDTOs) {
        if (name.equals(dto.name) && contextServiceId == dto.servletContextId) {
            return;
        }
    }
    fail("Servlet with name " + name + " and context id " + contextServiceId + " not found in " + Arrays.toString(servletDTOs));
}
Also used : FailedServletDTO(org.osgi.service.http.runtime.dto.FailedServletDTO) ServletDTO(org.osgi.service.http.runtime.dto.ServletDTO)

Example 7 with ServletDTO

use of org.osgi.service.http.runtime.dto.ServletDTO in project felix by apache.

the class ServletDTOBuilder 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 ServletDTO build(final ServletHandler handler, final int reason) {
    final ServletDTO dto = build(handler.getServletInfo(), reason);
    BaseServletDTOBuilder.fill(dto, handler);
    return dto;
}
Also used : FailedServletDTO(org.osgi.service.http.runtime.dto.FailedServletDTO) ServletDTO(org.osgi.service.http.runtime.dto.ServletDTO)

Aggregations

FailedServletDTO (org.osgi.service.http.runtime.dto.FailedServletDTO)7 ServletDTO (org.osgi.service.http.runtime.dto.ServletDTO)7 Map (java.util.Map)2 FailedResourceDTO (org.osgi.service.http.runtime.dto.FailedResourceDTO)2 ResourceDTO (org.osgi.service.http.runtime.dto.ResourceDTO)2 RuntimeDTO (org.osgi.service.http.runtime.dto.RuntimeDTO)2 ServletContextDTO (org.osgi.service.http.runtime.dto.ServletContextDTO)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 TreeMap (java.util.TreeMap)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 CountDownLatch (java.util.concurrent.CountDownLatch)1 MultipartConfig (org.apache.felix.http.base.internal.dispatch.MultipartConfig)1 ServletInfo (org.apache.felix.http.base.internal.runtime.ServletInfo)1 Test (org.junit.Test)1 HttpServiceRuntime (org.osgi.service.http.runtime.HttpServiceRuntime)1 ErrorPageDTO (org.osgi.service.http.runtime.dto.ErrorPageDTO)1 FailedErrorPageDTO (org.osgi.service.http.runtime.dto.FailedErrorPageDTO)1 FailedFilterDTO (org.osgi.service.http.runtime.dto.FailedFilterDTO)1 FailedListenerDTO (org.osgi.service.http.runtime.dto.FailedListenerDTO)1