Hi @rjeghanathan,
Are you going to apply this in production? This will definitely affects the overall platform performances, and defeats also the purpose of immutable configuration practices. If this is for a development or test environment, in that case that would make sense.
So with regard to using a servlet that initialises the library on startup, that should be do-able. Then the singleton should be available to any script or custom plugins, provided the class is whitelisted. I can’t tell you wether this works for sure, as I have never seen customers deploying in such a way, nor have I tried this; most are using the more traditional CI/CD way of pushing features from development to production in a consistent way. Also, it might be worth checking with ForgeRock support about the supportability of such a customisation,
Regards
Patrick