<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
Re: Can I modify the HandlerChain at deploy time?
</h3>
<span style="margin-bottom: 10px;">
created by <a href="https://community.jboss.org/people/asoldano">Alessio Soldano</a> in <i>JBoss Web Services Development</i> - <a href="https://community.jboss.org/message/714478#714478">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Hi Paul,</p><p>sorry for the late reply, I've been busy with the 4.0.1 release.</p><p>I'm glad you've a pretty much working prototype now :-)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><blockquote class="jive-quote"><p>Anyway, this is what I have now:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><ol><li style="text-align: start;">A DeploymentActivator with a Phase priority that comes imediatly after PARSE_JAXWS_HANDLER_CHAIN_ANNOTATION.</li><li style="text-align: start;">A DeploymentUnitProcessor that...<ol><li style="text-align: start;">Obtains the desired annotation from the Web service impl</li><li style="text-align: start;">Creates a new instance of WebservicesMetaData</li><li style="text-align: start;">Adds the handler to the portComponent of the WebservicesMetaData</li><li style="text-align: start;">Attaches the WebservicesMetaData to the DeploymentUnit with key WEBSERVICES_METADATA_KEY</li></ol></li></ol></blockquote><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Just few comments:</p><ul><li>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</li><li>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.</li><li>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.</li><li>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.</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Cheers</p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/714478#714478">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Web Services Development at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2047">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>