diff --git a/src/main/java/io/sinistral/proteus/ProteusApplication.java b/src/main/java/io/sinistral/proteus/ProteusApplication.java index 52f9bce..d6d5cfa 100644 --- a/src/main/java/io/sinistral/proteus/ProteusApplication.java +++ b/src/main/java/io/sinistral/proteus/ProteusApplication.java @@ -87,9 +87,7 @@ public class ProteusApplication @Inject public Config config; - - @Inject(optional=true) - public SessionAttachmentHandler sessionAttachmentHandler; + public List> registeredModules = new ArrayList<>(); @@ -280,6 +278,16 @@ public void buildServer() handler = rootHandler; } + SessionAttachmentHandler sessionAttachmentHandler = null; + + try + { + sessionAttachmentHandler = injector.getInstance(SessionAttachmentHandler.class); + } catch (Exception e) + { + log.info("No session attachment handler found."); + } + if(sessionAttachmentHandler != null) { log.info("Using session attachment handler."); @@ -586,6 +594,6 @@ public List getPorts() return ports; } - + } diff --git a/src/main/java/io/sinistral/proteus/server/ServerRequest.java b/src/main/java/io/sinistral/proteus/server/ServerRequest.java index bad7763..bd7bbd0 100644 --- a/src/main/java/io/sinistral/proteus/server/ServerRequest.java +++ b/src/main/java/io/sinistral/proteus/server/ServerRequest.java @@ -245,6 +245,46 @@ public SecurityContext getSecurityContext() { return exchange.getSecurityContext(); } + + /** + * @return the exchange + */ + public HttpServerExchange getExchange() + { + return exchange; + } + + /** + * @return the path + */ + public String getPath() + { + return path; + } + + /** + * @return the contentType + */ + public String getContentType() + { + return contentType; + } + + /** + * @return the method + */ + public String getMethod() + { + return method; + } + + /** + * @return the accept + */ + public String getAccept() + { + return accept; + } }