<!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: Snowdrop and JBoss AS 7.2.0
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/jtomasov">Juraj Tomasov</a> in <i>Snowdrop</i> - <a href="https://community.jboss.org/message/790006#790006">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>The reason of incompatibility Snowdrop subsystem with JBoss AS 7.2.0.Alpha1-SNAPSHOT is the fact ExtensionContext registerSubsystem methods have changed.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Changes needed to make Snowdrop subsystem can be registered in JBoss AS 7.1.3 onwards are as follows:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>1. In snowdrop-parent.pom change</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&lt;version.org.jboss.as7&gt;7.1.3.Final&lt;/version.org.jboss.as7&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>2. amend org.jboss.spring.deployers.as7.SpringExtension class</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>/*</p><p> * JBoss, Home of Professional Open Source.</p><p> * Copyright 2010, Red Hat, Inc., and individual contributors</p><p> * as indicated by the @author tags. See the copyright.txt file in the</p><p> * distribution for a full listing of individual contributors.</p><p> *</p><p> * This is free software; you can redistribute it and/or modify it</p><p> * under the terms of the GNU Lesser General Public License as</p><p> * published by the Free Software Foundation; either version 2.1 of</p><p> * the License, or (at your option) any later version.</p><p> *</p><p> * This software is distributed in the hope that it will be useful,</p><p> * but WITHOUT ANY WARRANTY; without even the implied warranty of</p><p> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</p><p> * Lesser General Public License for more details.</p><p> *</p><p> * You should have received a copy of the GNU Lesser General Public</p><p> * License along with this software; if not, write to the Free</p><p> * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA</p><p><span> * 02110-1301 USA, or see the FSF site: </span><a class="jive-link-external-small" href="http://www.fsf.org" target="_blank">http://www.fsf.org</a><span>.</span></p><p> */</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>package org.jboss.spring.deployers.as7;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADD;</p><p>import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.DESCRIBE;</p><p>import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP;</p><p>import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP_ADDR;</p><p>import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SUBSYSTEM;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>import java.util.List;</p><p>import java.util.Locale;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>import javax.xml.stream.XMLStreamException;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>import org.jboss.as.controller.Extension;</p><p>import org.jboss.as.controller.ExtensionContext;</p><p>import org.jboss.as.controller.OperationContext;</p><p>import org.jboss.as.controller.OperationFailedException;</p><p>import org.jboss.as.controller.OperationStepHandler;</p><p>import org.jboss.as.controller.SubsystemRegistration;</p><p>import org.jboss.as.controller.descriptions.DescriptionProvider;</p><p>import org.jboss.as.controller.descriptions.ModelDescriptionConstants;</p><p>import org.jboss.as.controller.descriptions.common.CommonDescriptions;</p><p>import org.jboss.as.controller.parsing.ExtensionParsingContext;</p><p>import org.jboss.as.controller.parsing.ParseUtils;</p><p>import org.jboss.as.controller.persistence.SubsystemMarshallingContext;</p><p>import org.jboss.as.controller.registry.ManagementResourceRegistration;</p><p>import org.jboss.as.controller.registry.OperationEntry;</p><p>import org.jboss.dmr.ModelNode;</p><p>import org.jboss.logging.Logger;</p><p>import org.jboss.staxmapper.XMLElementReader;</p><p>import org.jboss.staxmapper.XMLElementWriter;</p><p>import org.jboss.staxmapper.XMLExtendedStreamReader;</p><p>import org.jboss.staxmapper.XMLExtendedStreamWriter;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>/**</p><p> * @author Marius Bogoevici</p><p> */</p><p>public class SpringExtension implements Extension {</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160; private static final Logger log = Logger.getLogger("org.jboss.snowdrop");</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160; public static final String SUBSYSTEM_NAME = "spring";</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160; public static final String NAMESPACE = "urn:jboss:domain:snowdrop:1.0";</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;<strong>private static final int MANAGEMENT_API_MAJOR_VERSION = 1;</strong></p><p><strong>&#160;&#160;&#160; private static final int MANAGEMENT_API_MINOR_VERSION = 2;</strong></p><p><strong>&#160;&#160;&#160; private static final int MANAGEMENT_API_MICRO_VERSION = 0;</strong></p><p>&#160; </p><p>&#160;&#160;&#160; private static SpringSubsystemElementParser parser = new SpringSubsystemElementParser();</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160; private static final DescriptionProvider SUBSYSTEM_ADD_DESCRIPTION = new DescriptionProvider() {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; @Override</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; public ModelNode getModelDescription(Locale locale) {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return SpringDescriptionProviders.getSubsystemAddDescription(locale);</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p><p>&#160;&#160;&#160; };</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160; static final DescriptionProvider SUBSYSTEM_DESCRIPTION = new DescriptionProvider() {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; @Override</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; public ModelNode getModelDescription(Locale locale) {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return SpringDescriptionProviders.getSubsystemDescription(locale);</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p><p>&#160;&#160;&#160; };</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160; private static ModelNode createAddSubSystemOperation() {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; final ModelNode subsystem = new ModelNode();</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; subsystem.get(OP).set(ADD);</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; subsystem.get(OP_ADDR).add(ModelDescriptionConstants.SUBSYSTEM, SUBSYSTEM_NAME);</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; return subsystem;</p><p>&#160;&#160;&#160; }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160; public void initialize(ExtensionContext context) {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; log.debug("Activating Spring Extension");</p><p>&#160;&#160;&#160;&#160;&#160;&#160; <strong> final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME,MANAGEMENT_API_MAJOR_VERSION,MANAGEMENT_API_MINOR_VERSION,MANAGEMENT_API_MICRO_VERSION);</strong></p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; final ManagementResourceRegistration registration = subsystem.registerSubsystemModel(SUBSYSTEM_DESCRIPTION);</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; registration.registerOperationHandler(ADD, SpringSubsystemAdd.INSTANCE, SUBSYSTEM_ADD_DESCRIPTION, false);</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; registration.registerOperationHandler(DESCRIBE, SpringSubsystemDescribeHandler.INSTANCE, SpringSubsystemDescribeHandler.INSTANCE, false, OperationEntry.EntryType.PRIVATE);</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; subsystem.registerXMLElementWriter(parser);</p><p>&#160;&#160;&#160; }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160; public void initializeParsers(ExtensionParsingContext context) {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; log.debug("Setting up parsers");</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; context.setSubsystemXmlMapping(NAMESPACE, parser);</p><p>&#160;&#160;&#160; }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160; static class SpringSubsystemElementParser implements XMLElementReader&lt;List&lt;ModelNode&gt;&gt;,</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; XMLElementWriter&lt;SubsystemMarshallingContext&gt; {</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; /**</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; * {@inheritDoc}</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; */</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; @Override</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; public void readElement(XMLExtendedStreamReader reader, List&lt;ModelNode&gt; list) throws XMLStreamException {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ParseUtils.requireNoAttributes(reader);</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ParseUtils.requireNoContent(reader);</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; final ModelNode update = new ModelNode();</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; update.get(OP).set(ADD);</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; update.get(OP_ADDR).add(SUBSYSTEM, SUBSYSTEM_NAME);</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; list.add(createAddSubSystemOperation());</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; private static ModelNode createAddSubSystemOperation() {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; final ModelNode subsystem = new ModelNode();</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; subsystem.get(OP).set(ADD);</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; subsystem.get(OP_ADDR).add(ModelDescriptionConstants.SUBSYSTEM, SUBSYSTEM_NAME);</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return subsystem;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; /**</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; * {@inheritDoc}</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; */</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; @Override</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; public void writeContent(final XMLExtendedStreamWriter writer, final SubsystemMarshallingContext context) throws</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; XMLStreamException {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //TODO seems to be a problem with empty elements cleaning up the queue in FormattingXMLStreamWriter.runAttrQueue</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; context.startSubsystemElement(NAMESPACE, false);</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; writer.writeEndElement();</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p><p>&#160;&#160;&#160; }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160; private static class SpringSubsystemDescribeHandler implements OperationStepHandler, DescriptionProvider {</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; static final SpringSubsystemDescribeHandler INSTANCE = new SpringSubsystemDescribeHandler();</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; @Override</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; context.getResult().add(createAddSubSystemOperation());</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; context.completeStep();</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; @Override</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; public ModelNode getModelDescription(Locale locale) {</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return CommonDescriptions.getSubsystemDescribeOperation(locale);</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p><p>&#160;&#160;&#160; }</p><p>}</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/790006#790006">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in Snowdrop at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2082">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>