[undertow-dev] Access JBoss MSC service from ServletExtension

Tomaž Cerar tomaz.cerar at gmail.com
Fri Jan 23 13:25:15 EST 2015


if you do have proper extension, than it is simple :)

You could create your servletExtension as part of your deployment
processor, where you can lookup service registry by calling
deploymentUnit.getServiceRegistry() and lookup service from there.
once you have created your servletextension with the data from your service
just pass that servlet extension instance to attachment list.

deploymentUnit.addToAttachmentList(UndertowAttachments.UNDERTOW_SERVLET_EXTENSIONS,
your servlet extension);


this way your exact instance will be used, no need for registering it as
service in meta-inf...

hope this helps,
tomaz



On Fri, Jan 23, 2015 at 6:54 PM, Harris, Carl <ceharris at vt.edu> wrote:

>  On Jan 23, 2015, at 12:17 PM, Tomaž Cerar <tomaz.cerar at gmail.com> wrote:
>
>   Other option would be to write proper WildFly extension which is bit
> more work.
>  take a look at
> https://docs.jboss.org/author/display/WFLY8/Extending+WildFly+8
> for how to do that.
>
>
> Perhaps I wasn’t clear in my original message.  I have written a proper
> Wildfly extension.  It uses a DeploymentProcessor to observe deployments
> and participates and in the management model to create/configure the
> services needed for the authentication and authorization mechanisms I wish
> to support.
>
>  I am using an Undertow ServletExtension so that I can augment the
> authentication mechanisms supported by Undertow with my own mechanism.
>
>  What I’m unclear on how to accomplish is how to get a reference to the
> services I have created in my Wildfly extension from within the
> implementation of my Undertow authentication mechanism and associated
> identity manager.
>
>  Thanks for any tips/advice.
>
>
>> Carl Harris
> Chief Technology Architect
> Virginia Tech
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20150123/236c9ad1/attachment.html 


More information about the undertow-dev mailing list