Skip to content
Permalink
Browse files

FirstFilter -> SokletFilter

LastFilter -> RequestContextSyncFilter
  • Loading branch information...
revetkn committed Jul 18, 2019
1 parent 5c19bc4 commit a908c134b0fa921196c2d05b4714480c2d0a587b
@@ -23,7 +23,7 @@
import com.soklet.web.ResourcePath;
import com.soklet.web.annotation.*;
import com.soklet.web.exception.*;
import com.soklet.web.request.FirstFilter.SokletHttpServletRequest;
import com.soklet.web.request.SokletFilter.SokletHttpServletRequest;
import com.soklet.web.routing.Route;

import javax.servlet.http.Cookie;
@@ -39,7 +39,7 @@
* @since 1.1.9
*/
@Singleton
public class LastFilter implements Filter {
public class RequestContextSyncFilter implements Filter {
@Override
public void init(FilterConfig filterConfig) throws ServletException {}

@@ -26,7 +26,6 @@
import com.soklet.util.RequestUtils.QueryStringParseStrategy;
import com.soklet.util.ResponseUtils;
import com.soklet.web.HttpMethod;
import com.soklet.web.exception.ResourceMethodExecutionException;
import com.soklet.web.response.ResponseHandler;
import com.soklet.web.routing.Route;
import com.soklet.web.routing.RouteMatcher;
@@ -45,7 +44,6 @@

import static com.soklet.util.FormatUtils.httpServletRequestDescription;
import static com.soklet.util.FormatUtils.stackTraceForThrowable;
import static com.soklet.util.IoUtils.copyStreamCloseAfterwards;
import static com.soklet.util.IoUtils.copyStreamToBytesCloseAfterwards;
import static java.lang.String.format;
import static java.lang.System.nanoTime;
@@ -59,16 +57,16 @@
* @since 1.1.2
*/
@Singleton
public class FirstFilter implements Filter {
public class SokletFilter implements Filter {
public static String STATIC_FILES_URL_PATTERN_PARAM = "STATIC_FILES_URL_PATTERN";

private final RouteMatcher routeMatcher;
private final ResponseHandler responseHandler;
private Optional<String> staticFilesUrlPattern = Optional.empty();
private final Logger logger = Logger.getLogger(FirstFilter.class.getName());
private final Logger logger = Logger.getLogger(SokletFilter.class.getName());

@Inject
public FirstFilter(RouteMatcher routeMatcher, ResponseHandler responseHandler) {
public SokletFilter(RouteMatcher routeMatcher, ResponseHandler responseHandler) {
this.routeMatcher = Objects.requireNonNull(routeMatcher);
this.responseHandler = Objects.requireNonNull(responseHandler);
}
@@ -87,7 +87,7 @@ protected void service(HttpServletRequest httpServletRequest, HttpServletRespons
if (executeResponseHandler)
responseHandler.handleResponse(httpServletRequest, httpServletResponse, route, response, Optional.empty());
} catch (RuntimeException | ServletException | IOException e) {
// Exceptions are handled further up by FirstFilter
// Exceptions are handled further up by SokletFilter
throw e;
} catch (Exception e) {
throw new ServletException(e);

0 comments on commit a908c13

Please sign in to comment.
You can’t perform that action at this time.