Package org.jboss.as.server.deployment

Examples of org.jboss.as.server.deployment.DeploymentUnit


* @author Stuart Douglas
*/
public class WebServicesContextJndiSetupProcessor  implements DeploymentUnitProcessor {
    @Override
    public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
        final EEResourceReferenceProcessorRegistry registry = deploymentUnit.getAttachment(Attachments.RESOURCE_REFERENCE_PROCESSOR_REGISTRY);
        // Add a EEResourceReferenceProcessor which handles @Resource references of type WebServiceContext.
        registry.registerResourceReferenceProcessor(new WebServiceContextResourceProcessor());
    }
View Full Code Here


*/
public final class WSIntegrationProcessorJAXRPC_POJO implements DeploymentUnitProcessor {

    @Override
    public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        final DeploymentUnit unit = phaseContext.getDeploymentUnit();
        if (isJaxwsPojoDeployment(unit)) return;
        final JBossWebMetaData jbossWebMD = getJBossWebMetaData(unit);
        final WebservicesMetaData webservicesMD = getOptionalAttachment(unit, WEBSERVICES_METADATA_KEY);
        if (jbossWebMD != null && webservicesMD != null && hasJaxRpcMapping(webservicesMD)) {
            createJaxrpcDeployment(unit, webservicesMD, jbossWebMD);
View Full Code Here

    @Override
    public void start(final Deployment dep) {
        super.start(dep);
        final ServiceTarget target = getOptionalAttachment(dep, ServiceTarget.class);
        if (target != null) {
            final DeploymentUnit unit = getRequiredAttachment(dep, DeploymentUnit.class);
            for (final Endpoint ep : dep.getService().getEndpoints()) {
                EndpointService.install(target, ep, unit);
            }
        }
    }
View Full Code Here

            final String nextSecurityDomain = ejbEndpoint.getSecurityDomain();
            securityDomain = getDomain(securityDomain, nextSecurityDomain);
        }

        if (securityDomain == null) {
            final DeploymentUnit unit = WSHelper.getRequiredAttachment(dep, DeploymentUnit.class);
            if (unit.getParent() != null) {
                final EarMetaData jbossAppMD = unit.getParent().getAttachment(Attachments.EAR_METADATA);
                return jbossAppMD instanceof JBossAppMetaData ? ((JBossAppMetaData)jbossAppMD).getSecurityDomain() : null;
            }
        }

        return securityDomain;
View Full Code Here

*/
public final class WSIntegrationProcessorJAXRPC_EJB implements DeploymentUnitProcessor {

    @Override
    public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        final DeploymentUnit unit = phaseContext.getDeploymentUnit();
        if (isJaxwsEjbDeployment(unit)) return;
        final EjbJarMetaData ejbJarMD = getOptionalAttachment(unit, EjbDeploymentAttachmentKeys.EJB_JAR_METADATA);
        final WebservicesMetaData webservicesMD = getOptionalAttachment(unit, WEBSERVICES_METADATA_KEY);
        if (ejbJarMD != null && webservicesMD != null && hasJaxRpcMapping(webservicesMD)) {
            final EEModuleDescription moduleDescription = getRequiredAttachment(unit, EE_MODULE_DESCRIPTION);
View Full Code Here

        this.clazz = aspect.getClass();
    }

    @Override
    public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        final DeploymentUnit unit = phaseContext.getDeploymentUnit();
        if (isWebServiceDeployment(unit)) {
            ensureAspectInitialized();
            final Deployment dep = ASHelper.getRequiredAttachment(unit, WSAttachmentKeys.DEPLOYMENT_KEY);
            if (aspect.canHandle(dep)) {
                ROOT_LOGGER.aspectStart(aspect, unit.getName());
                ClassLoader origClassLoader = SecurityActions.getContextClassLoader();
                try {
                    SecurityActions.setContextClassLoader(aspect.getLoader());
                    dep.addAttachment(ServiceTarget.class, phaseContext.getServiceTarget());
                    aspect.start(dep);
View Full Code Here

    private static final String SERVICE_NAME = "serviceName";
    private static final String TARGET_NAMESPACE = "targetNamespace";

    @Override
    public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        final DeploymentUnit unit = phaseContext.getDeploymentUnit();
        if (DeploymentTypeMarker.isType(DeploymentType.EAR, unit)) {
            return;
        }
        final List<AnnotationInstance> webServiceAnnotations = getAnnotations(unit, WEB_SERVICE_ANNOTATION);
        // TODO: how about @WebServiceProvider JMS based endpoints?

        //group @WebService annotations in the deployment by wsdl contract location
        Map<String, List<AnnotationInstance>> map = new HashMap<String, List<AnnotationInstance>>();
        for (AnnotationInstance webServiceAnnotation : webServiceAnnotations) {
            final AnnotationValue wsdlLocation = webServiceAnnotation.value(WSDL_LOCATION);
            final AnnotationValue port = webServiceAnnotation.value(PORT_NAME);
            final AnnotationValue service = webServiceAnnotation.value(SERVICE_NAME);
            //support for contract-first development only: pick-up @WebService annotations referencing a provided wsdl contract only
            if (wsdlLocation != null && port != null && service != null) {
                String key = wsdlLocation.asString();
                List<AnnotationInstance> annotations = map.get(key);
                if (annotations == null) {
                    annotations = new LinkedList<AnnotationInstance>();
                    map.put(key, annotations);
                }
                annotations.add(webServiceAnnotation);
            }
        }

        //extract SOAP-over-JMS 1.0 bindings
        final JMSEndpointsMetaData endpointsMetaData = new JMSEndpointsMetaData();
        if (!map.isEmpty()) {

            for (String wsdlLocation : map.keySet()) {
                try {
                    final ResourceRoot resourceRoot = getWsdlResourceRoot(unit, wsdlLocation);
                    if (resourceRoot == null) continue;
                    final UnifiedVirtualFile uvf = new VirtualFileAdaptor(resourceRoot.getRoot());
                    URL url = uvf.findChild(wsdlLocation).toURL();
                    SOAPAddressWSDLParser parser = new SOAPAddressWSDLParser(url);
                    for (AnnotationInstance ai : map.get(wsdlLocation)) {
                        String port = ai.value(PORT_NAME).asString();
                        String service = ai.value(SERVICE_NAME).asString();
                        AnnotationValue targetNS = ai.value(TARGET_NAMESPACE);
                        String tns = targetNS != null ? targetNS.asString() : null;
                        QName serviceName = new QName(tns, service);
                        QName portName = new QName(tns, port);
                        String soapAddress = parser.filterSoapAddress(serviceName, portName, SOAPAddressWSDLParser.SOAP_OVER_JMS_NS);
                        if (soapAddress != null) {
                            ClassInfo webServiceClassInfo = (ClassInfo) ai.target();
                            String beanClassName = webServiceClassInfo.name().toString();
                            //service name ?
                            JMSEndpointMetaData endpointMetaData = new JMSEndpointMetaData(endpointsMetaData);
                            endpointMetaData.setEndpointName(port);
                            endpointMetaData.setName(beanClassName);
                            endpointMetaData.setImplementor(beanClassName);
                            //endpointMetaData.setName(name);
                            endpointMetaData.setSoapAddress(soapAddress);
                            endpointMetaData.setWsdlLocation(wsdlLocation);
                            endpointsMetaData.addEndpointMetaData(endpointMetaData);
                        }
                    }
                } catch (Exception ignore) {
                    ROOT_LOGGER.cannotReadWsdl(wsdlLocation);
                }
            }

        }
        unit.putAttachment(JMS_ENDPOINT_METADATA_KEY, endpointsMetaData);
    }
View Full Code Here

* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
public final class JBossWebservicesDescriptorDeploymentProcessor implements DeploymentUnitProcessor {

    public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        final DeploymentUnit unit = phaseContext.getDeploymentUnit();
        final ResourceRoot deploymentRoot = unit.getAttachment(Attachments.DEPLOYMENT_ROOT);
        final UnifiedVirtualFile virtualFile = new VirtualFileAdaptor(deploymentRoot.getRoot());
        final JBossWebservicesMetaData jbossWebservicesMD = JBossWebservicesFactory.loadFromVFSRoot(virtualFile);
        if (jbossWebservicesMD != null) {
            unit.putAttachment(WSAttachmentKeys.JBOSS_WEBSERVICES_METADATA_KEY, jbossWebservicesMD);
        }
    }
View Full Code Here

*/
public final class WSModelDeploymentProcessor extends TCCLDeploymentProcessor implements DeploymentUnitProcessor {

    @Override
    public void internalDeploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        final DeploymentUnit unit = phaseContext.getDeploymentUnit();
        WSDeploymentBuilder.getInstance().build(unit);
    }
View Full Code Here

* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
public final class WebservicesDescriptorDeploymentProcessor implements DeploymentUnitProcessor {

    public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        final DeploymentUnit unit = phaseContext.getDeploymentUnit();
        final ResourceRoot deploymentRoot = unit.getAttachment(Attachments.DEPLOYMENT_ROOT);
        final UnifiedVirtualFile virtualFile = new VirtualFileAdaptor(deploymentRoot.getRoot());
        final WebservicesMetaData webservicesMD = WebservicesFactory.loadFromVFSRoot(virtualFile);
        if (webservicesMD != null) {
            unit.putAttachment(WSAttachmentKeys.WEBSERVICES_METADATA_KEY, webservicesMD);
        }
    }
View Full Code Here

TOP

Related Classes of org.jboss.as.server.deployment.DeploymentUnit

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.