File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed
graphql-java-servlet/src/main/java/graphql/kickstart/servlet Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ protected GraphQLConfiguration getConfiguration() {
8383 public void init () {
8484 if (configuration == null ) {
8585 this .configuration = getConfiguration ();
86- this .requestHandler = new HttpRequestHandlerImpl (configuration );
86+ this .requestHandler = HttpRequestHandlerFactory . create (configuration );
8787 }
8888 }
8989
Original file line number Diff line number Diff line change 33import javax .servlet .http .HttpServletRequest ;
44import javax .servlet .http .HttpServletResponse ;
55
6- interface HttpRequestHandler {
6+ public interface HttpRequestHandler {
77
88 String APPLICATION_JSON_UTF8 = "application/json;charset=UTF-8" ;
99 String APPLICATION_EVENT_STREAM_UTF8 = "text/event-stream;charset=UTF-8" ;
Original file line number Diff line number Diff line change 1+ package graphql .kickstart .servlet ;
2+
3+ public interface HttpRequestHandlerFactory {
4+
5+ /**
6+ * Create a Request Handler instance for current servlet constructs
7+ * and frameworks not needing explicit servlet construct (Jersey).
8+ * @param configuration GraphQLConfiguration object
9+ * @return HttpRequestHandler interface instance
10+ */
11+ static HttpRequestHandler create (GraphQLConfiguration configuration ) {
12+ return new HttpRequestHandlerImpl (configuration );
13+ }
14+ }
You can’t perform that action at this time.
0 commit comments