Jakub Niedermertl wrote:
I'm developing WildFly extension to inspect CDI components.I'd like to provide collected data for further processing in JSON form. What are suitable ways to do so?
I was thinking ...
Not sure what exactly do you mean, but our core mgmt data model is done with jboss-dmr which is interoperable with JSON.
Can submodule run its own servlet container with own servlet? Or is it possible for a submodule to 'inject' a servlet into servlet container of running application? And how to do that?
Yes you can inject servlet (bit more work), or even directly undertow's HttpHandler(easier) to any deployed application during deployment phase.
You can just add your handler to outerhandler chain by adding it to list of handlers you can get from deployment unit attachment.
List<HandlerWrapper> handlers = deploymentUnit.getAttachmentList(UndertowAttachments.UNDERTOW_OUTER_HANDLER_CHAIN_WRAPPERS)
this must be done in DeploymentUnitProcessor
For servlet you need to modify web metadata to include also your servlet.