2 Replies Latest reply on Apr 10, 2006 1:32 AM by anil.saldhana

    Jacc PolicyContext related

    anil.saldhana

      I was wondering why JSR-115(JACC) did not provide the api to obtain the PolicyContextHandler that was registered under a key, via the PolicyContext. You can obtain all the handler keys and can register handlers. But once you have registered an handler in the PolicyContext, it is not easy to obtain the handler instance back.

      Do you think, the following method in PolicyContext would have been dangerous or useless?

       PolicyContextHandler getHandler(String key)
      


        • 1. Re: Jacc PolicyContext related
          starksm64

          What whould be the usage? I don't know what you would gain over the current getContext shortcut to the data.

          • 2. Re: Jacc PolicyContext related
            anil.saldhana

            I was writing a standalone testcase that would need to set a dummy subject on the thread and I could retrieve later the PolicyContext way.

            I had to do:
            a) Register the subjectcontexthandler in the PolicyContext.
            b) Set the subject on the SecurityAssociation.
            c) Sometime later, the authenticated subject is done via PolicyContext.

            So instead of doing the step of associating the subject on the SecurityAssociation, I wondered if it was a good idea to get the handler for the subject_context key and see if there is a method to set the subject there. Just a thought. I know that the SA is a jboss way and also obtaining the Subject from the PolicyContext is again a JBoss way (even though it is kind of supported via the spec).

            That is when, I thought retrieving the handler, that the serverside has registered with the PolicyContext, would be nice. But I was unsure of the advantages and any potential dangers of doing this. But this is a trivial doubt I had.