6 Replies Latest reply on Jan 7, 2015 6:11 AM by Gordon McKeown

    Java ARAPI: Context persistence across class instances

    Gordon McKeown
      Share This:

      I've just put together a user transform plugin for Atrium SSO that performs user ID lookups against a Remedy server using Remedy API.


      For the most part this seems to work OK, but I'm starting to think about performance. The user transform plugin is simply a Java class that is instantiated for each authentication request, the transform() method is called for the user ID, and then the class instance is (I assume) unassigned and left for GC to mercilessly destroy.


      The issue is that currently I am creating an ARServerUser context each time the class is instantiated -- i.e. for every user logon -- and I suspect this is a rather wasteful way to do things. A more efficient approach would seem to be to create the ARServerUser context when the class is first instantiated and store it statically so that future instances can share the context. Or does the ARAPI do anything clever in the background to pool requests to the same server from a given user?


      But then I start to think about what happens if the AR Server goes offline or perhaps the context will become invalidated due to time-outs or similar.


      Anyone able to share some experience and "good practice" on this topic?