use of org.osgi.service.http.runtime.dto.ResourceDTO 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