0 Replies Latest reply on Dec 16, 2016 10:50 AM by Clemens August

    Programmatically initialising @Resource

    Clemens August Newbie



      in order to manage connections to a legacy system via @Resource - injection, I have implemented javax.naming.spi.ObjectFactory and configured the resource in the naming subsystem according to Naming Subsystem Configuration - WildFly 9 - Project Documentation Editor. This works fine.


      I would like to have more degrees of freedom for the management of these connections, so I am wondering, whether the following approach would be possible and advisable:


      1. Adding a custom subsystem, following the guide in Example subsystem - WildFly 9 - Project Documentation Editor
      2. In this subsystem, setting up connection objects and providing them as @Resource.


      My question is: is it possible to programmatically set up objects and bind them to JNDI such, that they will be available via a @Resource - injection? I could not find information about that.