Hi,

What about executing

ResteasyProviderFactory.pushContext(KeycloakApplication.class, this);

before the KeycloakSessionFactory is created? It would be sweet to be able to install, e.g, custom container filters.

I realise that it might not be the best idea to solve it, since the Application class might only be partially constructed when #getSingletons or #getClasses is called, but I think it's useful for plugging in extra monitoring or whatever.

Maybe an SPI with access to the singletons and classes sets?