PageRenderTime 34ms CodeModel.GetById 17ms app.highlight 14ms RepoModel.GetById 0ms app.codeStats 0ms

/jboss-as-7.1.1.Final/webservices/server-integration/src/main/java/org/jboss/as/webservices/deployers/WebservicesDescriptorDeploymentProcessor.java

#
Java | 58 lines | 25 code | 5 blank | 28 comment | 2 complexity | 1560b037c9cea5d8fd38685ad077ab07 MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0
 1/*
 2 * JBoss, Home of Professional Open Source
 3 * Copyright 2011, Red Hat Inc., and individual contributors as indicated
 4 * by the @authors tag. See the copyright.txt in the distribution for a
 5 * full listing of individual contributors.
 6 *
 7 * This is free software; you can redistribute it and/or modify it
 8 * under the terms of the GNU Lesser General Public License as
 9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * This software is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this software; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21 */
22package org.jboss.as.webservices.deployers;
23
24import org.jboss.as.server.deployment.Attachments;
25import org.jboss.as.server.deployment.DeploymentPhaseContext;
26import org.jboss.as.server.deployment.DeploymentUnit;
27import org.jboss.as.server.deployment.DeploymentUnitProcessingException;
28import org.jboss.as.server.deployment.DeploymentUnitProcessor;
29import org.jboss.as.server.deployment.module.ResourceRoot;
30import org.jboss.as.webservices.util.VirtualFileAdaptor;
31import org.jboss.as.webservices.util.WSAttachmentKeys;
32import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
33import org.jboss.wsf.spi.metadata.webservices.WebservicesFactory;
34import org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData;
35
36/**
37 * DUP for parsing webservices.xml
38 *
39 * @author alessio.soldano@jboss.com
40 * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
41 */
42public final class WebservicesDescriptorDeploymentProcessor implements DeploymentUnitProcessor {
43
44    public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
45        final DeploymentUnit unit = phaseContext.getDeploymentUnit();
46        final ResourceRoot deploymentRoot = unit.getAttachment(Attachments.DEPLOYMENT_ROOT);
47        final UnifiedVirtualFile virtualFile = new VirtualFileAdaptor(deploymentRoot.getRoot());
48        final WebservicesMetaData webservicesMD = WebservicesFactory.loadFromVFSRoot(virtualFile);
49        if (webservicesMD != null) {
50            unit.putAttachment(WSAttachmentKeys.WEBSERVICES_METADATA_KEY, webservicesMD);
51        }
52    }
53
54    public void undeploy(final DeploymentUnit unit) {
55        // does nothing
56    }
57
58}