1 2 Previous Next 23 Replies Latest reply on Feb 9, 2012 7:28 AM by paul.robinson Go to original post
      • 15. Re: Can I modify the HandlerChain at deploy time?
        paul.robinson

        Thanks Alessio,

         

        I'll look over the message you refer to and see if I can understand better what to do.

         

        An IRC chat would be great if you have the time. My IRC id is pfrobinson. Also, I'm usualy logged into #jbossts, #ncloffice and #blacktie. Just send me a message whenever you are free.

         

        Paul.

        • 16. Re: Can I modify the HandlerChain at deploy time?
          paul.robinson

          Alessio,

           

          I've re-read your messages and I now understand what you meant about the WebservicesMetaData. I think I got distracted by the WS_ENDPOINT_HANDLERS_MAPPING_KEY and went off in the wrong direction.

           

          Anyway, this is what I have now:

           

          1. A DeploymentActivator with a Phase priority that comes imediatly after PARSE_JAXWS_HANDLER_CHAIN_ANNOTATION.
          2. A DeploymentUnitProcessor that...
            1. Obtains the desired annotation from the Web service impl
            2. Creates a new instance of WebservicesMetaData
            3. Adds the handler to the portComponent of the WebservicesMetaData
            4. Attaches the WebservicesMetaData to the DeploymentUnit with key WEBSERVICES_METADATA_KEY

           

          I have these issues now:

           

          1. How much other information do I need to provide in the WebservicesMetaData? There seems to be a lot of information in there that may or may not be relevant to the service being deployed. It also feels like I would be re-inventing the wheel if I was to try to obtain all the relevant data about the service.
          2. Will constructing the WebservicesMetaData be very brittle? Is it likely to break every time the format of this changes? Does this data-structure change on a regular basis?

           

          We can still chat on IRC, if you think that would be easiest, or we could continue with this forum discussion. Either is fine by me.

           

          Thanks again with all your help on this, It's much appreciated.

           

          Paul.

          • 17. Re: Can I modify the HandlerChain at deploy time?
            paul.robinson

            Alessio,

             

            I've been looking at MetadataBuilder#processWSDDContribution and I realize that I only need to provide the SEI and the Handler to the PortComponent of the WebservicesMetaData. Assuming I am right, this seems like a good solution (nether brittle nor re-inventing the wheel as I feared in my previous post).

             

            Paul.

            • 18. Re: Can I modify the HandlerChain at deploy time?
              paul.robinson

              Alessio,

               

              I've now got the handler registered and I can see it invoking. I think I now have everything I need to go and impliment my feature. Many thanks for all your help!! Now that I understand how to do it, I can see that your initial instructions gave me everything I needed. I hope I didn't waste too much of your time as I was ditracted by my incorrect aproaches.

               

              Thanks again,

               

              Paul.

              • 19. Re: Can I modify the HandlerChain at deploy time?
                paul.robinson

                Alessio,

                 

                One last thing (I hope)...

                 

                Do I also need to populate the WS_ENDPOINT_HANDLERS_MAPPING_KEY attachment as I originally thought?

                 

                Paul.

                • 20. Re: Can I modify the HandlerChain at deploy time?
                  asoldano

                  Hi Paul,

                  sorry for the late reply, I've been busy with the 4.0.1 release.

                  I'm glad you've a pretty much working prototype now :-)

                   

                  Anyway, this is what I have now:

                   

                  1. A DeploymentActivator with a Phase priority that comes imediatly after PARSE_JAXWS_HANDLER_CHAIN_ANNOTATION.
                  2. A DeploymentUnitProcessor that...
                    1. Obtains the desired annotation from the Web service impl
                    2. Creates a new instance of WebservicesMetaData
                    3. Adds the handler to the portComponent of the WebservicesMetaData
                    4. Attaches the WebservicesMetaData to the DeploymentUnit with key WEBSERVICES_METADATA_KEY

                   

                  Just few comments:

                  • in 4) you should check if there's a WebServicesMetaData attachment; if that's the case, you need to update the existing one, otherwsise the data in it would be lost
                  • regarding your logic for updating the WS_ENDPOINT_HANDLERS_MAPPING_KEY instead, I believe you should have that run after Phase.PARSE_JAXWS_HANDLER_CHAIN_ANNOTATION but before Phase.PARSE_JAXWS_HANDLER_CREATE_COMPONENT_DESCRIPTIONS, as there's a DUP registered at that phase which should be reading the data. You might need to shift Phase.PARSE_JAXWS_ENDPOINT_CREATE_COMPONENT_DESCRIPTIONS and Phase.PARSE_JAXWS_HANDLER_CREATE_COMPONENT_DESCRIPTIONS values down a bit, just be sure to keep the rest of the ordering.
                  • to answer your question on the actual need for populating WS_ENDPOINT_HANDLERS_MAPPING_KEY attachment, yeah, that's required for having the AS7 components properly created for your handlers too.
                  • on the contents of WebServicesMetaData and the possible changes on that, consider that it basically maps the JSR109 stuff, so the minimal data you're providing should be fine and the classes are not likely to change frequently, I believe they're pretty much still the same since they were written years ago.

                   

                  Cheers

                  • 21. Re: Can I modify the HandlerChain at deploy time?
                    paul.robinson

                    Alessio,

                     

                    No problem on the late reply. I'm making progress on my feature, the only remaining stuff is making sure it doesn't break anything existing ;-)

                     

                    in 4) you should check if there's a WebServicesMetaData attachment; if that's the case, you need to update the existing one, otherwsise the data in it would be lost

                    Yes, that makes sense. I couldn't find a reference to webservices.xml in the JAX-WS spes. Is this just a JAX-RPC feature?

                     

                    regarding your logic for updating the WS_ENDPOINT_HANDLERS_MAPPING_KEY instead, I believe you should have that run after Phase.PARSE_JAXWS_HANDLER_CHAIN_ANNOTATION but before Phase.PARSE_JAXWS_HANDLER_CREATE_COMPONENT_DESCRIPTIONS, as there's a DUP registered at that phase which should be reading the data. You might need to shift Phase.PARSE_JAXWS_ENDPOINT_CREATE_COMPONENT_DESCRIPTIONS and Phase.PARSE_JAXWS_HANDLER_CREATE_COMPONENT_DESCRIPTIONS values down a bit, just be sure to keep the rest of the ordering.

                    I think this is what I have with the following?

                     

                     

                    public static final int PARSE_JAXWS_HANDLER_CHAIN_ANNOTATION    = 0x2055;
                    public static final int PARSE_TXFRAMEWORK_HANDLERS              = 0x2056;
                    public static final int PARSE_WS_JMS_INTEGRATION                = 0x2057;
                    public static final int PARSE_JAXWS_ENDPOINT_CREATE_COMPONENT_DESCRIPTIONS = 0x2058;
                    public static final int PARSE_JAXWS_HANDLER_CREATE_COMPONENT_DESCRIPTIONS = 0x2059;

                     

                    Excuse the table, I couldn't get this editor to allow me to paste this as java code.

                     

                    to answer your question on the actual need for populating WS_ENDPOINT_HANDLERS_MAPPING_KEY attachment, yeah, that's required for having the AS7 components properly created for your handlers too.

                    What AS7 components do you mean here?

                    • 22. Re: Can I modify the HandlerChain at deploy time?
                      asoldano

                       

                      in 4) you should check if there's a WebServicesMetaData attachment; if that's the case, you need to update the existing one, otherwsise the data in it would be lost

                      Yes, that makes sense. I couldn't find a reference to webservices.xml in the JAX-WS spes. Is this just a JAX-RPC feature?

                      It's actually a JSR 109 concept; the webservices.xml is mandatory for JAX-RPC and optional for JAX-WS.

                       

                       

                      regarding your logic for updating the WS_ENDPOINT_HANDLERS_MAPPING_KEY instead, I believe you should have that run after Phase.PARSE_JAXWS_HANDLER_CHAIN_ANNOTATION but before Phase.PARSE_JAXWS_HANDLER_CREATE_COMPONENT_DESCRIPTIONS, as there's a DUP registered at that phase which should be reading the data. You might need to shift Phase.PARSE_JAXWS_ENDPOINT_CREATE_COMPONENT_DESCRIPTIONS and Phase.PARSE_JAXWS_HANDLER_CREATE_COMPONENT_DESCRIPTIONS values down a bit, just be sure to keep the rest of the ordering.

                      I think this is what I have with the following?

                       

                       


                      public static final int PARSE_JAXWS_HANDLER_CHAIN_ANNOTATION    = 0x2055;

                      public static final int PARSE_TXFRAMEWORK_HANDLERS              = 0x2056;

                      public static final int PARSE_WS_JMS_INTEGRATION                = 0x2057;

                      public static final int PARSE_JAXWS_ENDPOINT_CREATE_COMPONENT_DESCRIPTIONS = 0x2058;

                      public static final int PARSE_JAXWS_HANDLER_CREATE_COMPONENT_DESCRIPTIONS = 0x2059;

                       

                      Perfect, this is what I meant.

                       

                       

                       

                      to answer your question on the actual need for populating WS_ENDPOINT_HANDLERS_MAPPING_KEY attachment, yeah, that's required for having the AS7 components properly created for your handlers too.

                      What AS7 components do you mean here?

                       

                      I'm referring to the AS7 org.jboss.as.ee.component.ComponentDescription . The org.jboss.as.webservices.deployers.WSIntegrationProcessorJAXWS_HANDLER that's registered at Phase.PARSE_JAXWS_HANDLER_CREATE_COMPONENT_DESCRIPTIONS uses the WSEndpointHandlersMapping data for propagating the naming context in the component descriptors.

                      • 23. Re: Can I modify the HandlerChain at deploy time?
                        paul.robinson

                        Alessio,

                         

                        Alessio Soldano wrote:

                         

                         

                        in 4) you should check if there's a WebServicesMetaData attachment; if that's the case, you need to update the existing one, otherwsise the data in it would be lost

                        Yes, that makes sense. I couldn't find a reference to webservices.xml in the JAX-WS spes. Is this just a JAX-RPC feature?

                        It's actually a JSR 109 concept; the webservices.xml is mandatory for JAX-RPC and optional for JAX-WS.

                        I can see what I need to do here. It doesn't look like it will be a problem, but I've not tried it yet.

                         

                         

                         

                         

                        to answer your question on the actual need for populating WS_ENDPOINT_HANDLERS_MAPPING_KEY attachment, yeah, that's required for having the AS7 components properly created for your handlers too.

                        What AS7 components do you mean here?

                         

                        I'm referring to the AS7 org.jboss.as.ee.component.ComponentDescription . The org.jboss.as.webservices.deployers.WSIntegrationProcessorJAXWS_HANDLER that's registered at Phase.PARSE_JAXWS_HANDLER_CREATE_COMPONENT_DESCRIPTIONS uses the WSEndpointHandlersMapping data for propagating the naming context in the component descriptors.

                         

                        Great, I have that working now.

                         

                        So, it looks like I have this feature under control now. Thanks again for your help, I would have really struggled without it.

                         

                        Paul.

                        1 2 Previous Next