<!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;"> </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;"> </p><p>1. In snowdrop-parent.pom change</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><version.org.jboss.as7>7.1.3.Final</version.org.jboss.as7></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>2. amend org.jboss.spring.deployers.as7.SpringExtension class</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </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;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>package org.jboss.spring.deployers.as7;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </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;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>import java.util.List;</p><p>import java.util.Locale;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>import javax.xml.stream.XMLStreamException;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </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;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </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;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>    private static final Logger log = Logger.getLogger("org.jboss.snowdrop");</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>    public static final String SUBSYSTEM_NAME = "spring";</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>    public static final String NAMESPACE = "urn:jboss:domain:snowdrop:1.0";</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>          <strong>private static final int MANAGEMENT_API_MAJOR_VERSION = 1;</strong></p><p><strong>    private static final int MANAGEMENT_API_MINOR_VERSION = 2;</strong></p><p><strong>    private static final int MANAGEMENT_API_MICRO_VERSION = 0;</strong></p><p>  </p><p>    private static SpringSubsystemElementParser parser = new SpringSubsystemElementParser();</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>    private static final DescriptionProvider SUBSYSTEM_ADD_DESCRIPTION = new DescriptionProvider() {</p><p>        @Override</p><p>        public ModelNode getModelDescription(Locale locale) {</p><p>            return SpringDescriptionProviders.getSubsystemAddDescription(locale);</p><p>        }</p><p>    };</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>    static final DescriptionProvider SUBSYSTEM_DESCRIPTION = new DescriptionProvider() {</p><p>        @Override</p><p>        public ModelNode getModelDescription(Locale locale) {</p><p>            return SpringDescriptionProviders.getSubsystemDescription(locale);</p><p>        }</p><p>    };</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>    private static ModelNode createAddSubSystemOperation() {</p><p>        final ModelNode subsystem = new ModelNode();</p><p>        subsystem.get(OP).set(ADD);</p><p>        subsystem.get(OP_ADDR).add(ModelDescriptionConstants.SUBSYSTEM, SUBSYSTEM_NAME);</p><p>        return subsystem;</p><p>    }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>    public void initialize(ExtensionContext context) {</p><p>        log.debug("Activating Spring Extension");</p><p>       <strong> final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME,MANAGEMENT_API_MAJOR_VERSION,MANAGEMENT_API_MINOR_VERSION,MANAGEMENT_API_MICRO_VERSION);</strong></p><p>        final ManagementResourceRegistration registration = subsystem.registerSubsystemModel(SUBSYSTEM_DESCRIPTION);</p><p>        registration.registerOperationHandler(ADD, SpringSubsystemAdd.INSTANCE, SUBSYSTEM_ADD_DESCRIPTION, false);</p><p>        registration.registerOperationHandler(DESCRIBE, SpringSubsystemDescribeHandler.INSTANCE, SpringSubsystemDescribeHandler.INSTANCE, false, OperationEntry.EntryType.PRIVATE);</p><p>        subsystem.registerXMLElementWriter(parser);</p><p>    }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>    public void initializeParsers(ExtensionParsingContext context) {</p><p>        log.debug("Setting up parsers");</p><p>        context.setSubsystemXmlMapping(NAMESPACE, parser);</p><p>    }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>    static class SpringSubsystemElementParser implements XMLElementReader<List<ModelNode>>,</p><p>            XMLElementWriter<SubsystemMarshallingContext> {</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>        /**</p><p>         * {@inheritDoc}</p><p>         */</p><p>        @Override</p><p>        public void readElement(XMLExtendedStreamReader reader, List<ModelNode> list) throws XMLStreamException {</p><p>            ParseUtils.requireNoAttributes(reader);</p><p>            ParseUtils.requireNoContent(reader);</p><p>            final ModelNode update = new ModelNode();</p><p>            update.get(OP).set(ADD);</p><p>            update.get(OP_ADDR).add(SUBSYSTEM, SUBSYSTEM_NAME);</p><p>            list.add(createAddSubSystemOperation());</p><p>        }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>        private static ModelNode createAddSubSystemOperation() {</p><p>            final ModelNode subsystem = new ModelNode();</p><p>            subsystem.get(OP).set(ADD);</p><p>            subsystem.get(OP_ADDR).add(ModelDescriptionConstants.SUBSYSTEM, SUBSYSTEM_NAME);</p><p>            return subsystem;</p><p>        }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>        /**</p><p>         * {@inheritDoc}</p><p>         */</p><p>        @Override</p><p>        public void writeContent(final XMLExtendedStreamWriter writer, final SubsystemMarshallingContext context) throws</p><p>                XMLStreamException {</p><p>            //TODO seems to be a problem with empty elements cleaning up the queue in FormattingXMLStreamWriter.runAttrQueue</p><p>            context.startSubsystemElement(NAMESPACE, false);</p><p>            writer.writeEndElement();</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>        }</p><p>    }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>    private static class SpringSubsystemDescribeHandler implements OperationStepHandler, DescriptionProvider {</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>        static final SpringSubsystemDescribeHandler INSTANCE = new SpringSubsystemDescribeHandler();</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>        @Override</p><p>        public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {</p><p>            context.getResult().add(createAddSubSystemOperation());</p><p>            context.completeStep();</p><p>        }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>        @Override</p><p>        public ModelNode getModelDescription(Locale locale) {</p><p>            return CommonDescriptions.getSubsystemDescribeOperation(locale);</p><p>        }</p><p>    }</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>