Search code examples
javajakarta-eewildflyundertow

How can I replace Wildfly 9's default SessionManager with a custom implementation for all web apps?


Based on my understanding of the Undertow docs and this stack overflow post, I think I should be able to provide my own implementation of SessionManager.

I have created a jar file containing:

  • a SessionManager implementation
  • a SessionManagerFactory implementation
  • a ServletExtension implementation
  • a META-INF/services/io.undertow.servlet.ServletExtension file containing the fully qualified name of my class

Have I done this right? How do I get Undertow to pick this up?

Thanks


Solution

  • If you did all that, all you need is to have that jar in your war/WEB-INF/lib and that is it.

    When war is deploying WildFly will look for this ServletExtension and tell undertow to load it.

    see also http://undertow.io/undertow-docs/undertow-docs-1.2.0/index.html#servlet-extensions