Search in sources :

Example 6 with DeploymentUnit

use of org.jboss.as.server.deployment.DeploymentUnit in project wildfly by wildfly.

the class EndpointDeployService method install.

public static DeploymentUnit install(final ServiceTarget serviceTarget, final String context, final ClassLoader loader, final String hostName, final Map<String, String> urlPatternToClassName, JBossWebMetaData jbwmd, WebservicesMetaData wsmd, JBossWebservicesMetaData jbwsmd, Map<Class<?>, Object> deploymentAttachments) {
    final DeploymentUnit unit = EndpointPublisherHelper.doPrepareStep(context, loader, urlPatternToClassName, jbwmd, wsmd, jbwsmd);
    if (deploymentAttachments != null) {
        Deployment dep = unit.getAttachment(WSAttachmentKeys.DEPLOYMENT_KEY);
        for (Entry<Class<?>, Object> e : deploymentAttachments.entrySet()) {
            dep.addAttachment(e.getKey(), e.getValue());
        }
    }
    final EndpointDeployService service = new EndpointDeployService(context, unit);
    final ServiceBuilder<DeploymentUnit> builder = serviceTarget.addService(service.getName(), service);
    builder.addDependency(DependencyType.REQUIRED, WSServices.CONFIG_SERVICE);
    builder.setInitialMode(Mode.ACTIVE);
    builder.install();
    return unit;
}
Also used : Deployment(org.jboss.wsf.spi.deployment.Deployment) DeploymentUnit(org.jboss.as.server.deployment.DeploymentUnit)

Example 7 with DeploymentUnit

use of org.jboss.as.server.deployment.DeploymentUnit in project wildfly by wildfly.

the class ModClusterUndertowDeploymentProcessor method deploy.

@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
    DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
    // Add mod_cluster-undertow integration service (jboss.modcluster.undertow) as a web deployment dependency
    deploymentUnit.addToAttachmentList(Attachments.WEB_DEPENDENCIES, UndertowEventHandlerAdapterBuilder.SERVICE_NAME);
    // Request count wrapping
    if (isMetricEnabled(RequestCountLoadMetric.class)) {
        deploymentUnit.addToAttachmentList(UndertowAttachments.UNDERTOW_INITIAL_HANDLER_CHAIN_WRAPPERS, new HandlerWrapper() {

            @Override
            public HttpHandler wrap(final HttpHandler handler) {
                return new RequestCountHttpHandler(handler);
            }
        });
    }
    // Bytes Sent wrapping
    if (isMetricEnabled(SendTrafficLoadMetric.class)) {
        deploymentUnit.addToAttachmentList(UndertowAttachments.UNDERTOW_INITIAL_HANDLER_CHAIN_WRAPPERS, new HandlerWrapper() {

            @Override
            public HttpHandler wrap(final HttpHandler handler) {
                return new BytesSentHttpHandler(handler);
            }
        });
    }
    // Bytes Received wrapping
    if (isMetricEnabled(ReceiveTrafficLoadMetric.class)) {
        deploymentUnit.addToAttachmentList(UndertowAttachments.UNDERTOW_INITIAL_HANDLER_CHAIN_WRAPPERS, new HandlerWrapper() {

            @Override
            public HttpHandler wrap(final HttpHandler handler) {
                return new BytesReceivedHttpHandler(handler);
            }
        });
    }
    // Busyness thread setup actions
    if (isMetricEnabled(BusyConnectorsLoadMetric.class)) {
        deploymentUnit.addToAttachmentList(UndertowAttachments.UNDERTOW_OUTER_HANDLER_CHAIN_WRAPPERS, new HandlerWrapper() {

            @Override
            public HttpHandler wrap(final HttpHandler handler) {
                return new RunningRequestsHttpHandler(handler);
            }
        });
    }
}
Also used : RequestCountHttpHandler(org.wildfly.mod_cluster.undertow.metric.RequestCountHttpHandler) HttpHandler(io.undertow.server.HttpHandler) BytesReceivedHttpHandler(org.wildfly.mod_cluster.undertow.metric.BytesReceivedHttpHandler) BytesSentHttpHandler(org.wildfly.mod_cluster.undertow.metric.BytesSentHttpHandler) RunningRequestsHttpHandler(org.wildfly.mod_cluster.undertow.metric.RunningRequestsHttpHandler) RequestCountHttpHandler(org.wildfly.mod_cluster.undertow.metric.RequestCountHttpHandler) BytesSentHttpHandler(org.wildfly.mod_cluster.undertow.metric.BytesSentHttpHandler) BytesReceivedHttpHandler(org.wildfly.mod_cluster.undertow.metric.BytesReceivedHttpHandler) RunningRequestsHttpHandler(org.wildfly.mod_cluster.undertow.metric.RunningRequestsHttpHandler) DeploymentUnit(org.jboss.as.server.deployment.DeploymentUnit) HandlerWrapper(io.undertow.server.HandlerWrapper)

Example 8 with DeploymentUnit

use of org.jboss.as.server.deployment.DeploymentUnit in project wildfly by wildfly.

the class DefaultJMSConnectionFactoryBindingProcessor method deploy.

@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
    final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
    if (DeploymentTypeMarker.isType(EAR, deploymentUnit)) {
        return;
    }
    final EEModuleDescription moduleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION);
    if (moduleDescription == null) {
        return;
    }
    final String defaultJMSConnectionFactory = moduleDescription.getDefaultResourceJndiNames().getJmsConnectionFactory();
    if (defaultJMSConnectionFactory == null) {
        return;
    }
    final LookupInjectionSource injectionSource = new LookupInjectionSource(defaultJMSConnectionFactory);
    if (DeploymentTypeMarker.isType(WAR, deploymentUnit)) {
        moduleDescription.getBindingConfigurations().add(new BindingConfiguration(MODULE_DEFAULT_JMS_CONNECTION_FACTORY, injectionSource));
    } else {
        if (DeploymentTypeMarker.isType(APPLICATION_CLIENT, deploymentUnit)) {
            moduleDescription.getBindingConfigurations().add(new BindingConfiguration(COMP_DEFAULT_JMS_CONNECTION_FACTORY, injectionSource));
        }
        for (ComponentDescription componentDescription : moduleDescription.getComponentDescriptions()) {
            if (componentDescription.getNamingMode() == ComponentNamingMode.CREATE) {
                componentDescription.getBindingConfigurations().add(new BindingConfiguration(COMP_DEFAULT_JMS_CONNECTION_FACTORY, injectionSource));
            }
        }
    }
}
Also used : ComponentDescription(org.jboss.as.ee.component.ComponentDescription) EEModuleDescription(org.jboss.as.ee.component.EEModuleDescription) DeploymentUnit(org.jboss.as.server.deployment.DeploymentUnit) LookupInjectionSource(org.jboss.as.ee.component.LookupInjectionSource) BindingConfiguration(org.jboss.as.ee.component.BindingConfiguration)

Example 9 with DeploymentUnit

use of org.jboss.as.server.deployment.DeploymentUnit in project wildfly by wildfly.

the class FederationDependencyProcessor method getFederationService.

private ServiceName getFederationService(DeploymentPhaseContext phaseContext) {
    DeploymentUnit deployment = phaseContext.getDeploymentUnit();
    ServiceRegistry serviceRegistry = phaseContext.getServiceRegistry();
    // We assume the mgmt ops that trigger IdentityProviderAddHandler or ServiceProviderAddHandler
    // run before the OperationStepHandler that triggers deploy. If not, that's a user mistake.
    // Since those handlers run first, we can count on MSC having services *registered* even
    // though we cannot count on them being *started*.
    ServiceController<?> service = serviceRegistry.getService(IdentityProviderService.createServiceName(deployment.getName()));
    if (service == null) {
        service = serviceRegistry.getService(ServiceProviderService.createServiceName(deployment.getName()));
    } else {
        IdentityProviderService identityProviderService = (IdentityProviderService) service.getService();
        IDPConfiguration idpType = identityProviderService.getValue().getConfiguration();
        if (idpType.isExternal()) {
            return null;
        }
    }
    if (service == null) {
        return null;
    }
    return service.getName();
}
Also used : IDPConfiguration(org.wildfly.extension.picketlink.federation.config.IDPConfiguration) IdentityProviderService(org.wildfly.extension.picketlink.federation.service.IdentityProviderService) ServiceRegistry(org.jboss.msc.service.ServiceRegistry) DeploymentUnit(org.jboss.as.server.deployment.DeploymentUnit)

Example 10 with DeploymentUnit

use of org.jboss.as.server.deployment.DeploymentUnit in project wildfly by wildfly.

the class FederationDeploymentProcessor method deploy.

@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
    DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
    PicketLinkFederationService federationService = deploymentUnit.getAttachment(FederationDependencyProcessor.DEPLOYMENT_ATTACHMENT_KEY);
    if (federationService != null) {
        ROOT_LOGGER.federationConfiguringDeployment(deploymentUnit.getName());
        federationService.configure(deploymentUnit);
    }
}
Also used : PicketLinkFederationService(org.wildfly.extension.picketlink.federation.service.PicketLinkFederationService) DeploymentUnit(org.jboss.as.server.deployment.DeploymentUnit)

Aggregations

DeploymentUnit (org.jboss.as.server.deployment.DeploymentUnit)359 EEModuleDescription (org.jboss.as.ee.component.EEModuleDescription)84 Module (org.jboss.modules.Module)70 ServiceName (org.jboss.msc.service.ServiceName)62 DeploymentUnitProcessingException (org.jboss.as.server.deployment.DeploymentUnitProcessingException)56 ResourceRoot (org.jboss.as.server.deployment.module.ResourceRoot)56 ComponentDescription (org.jboss.as.ee.component.ComponentDescription)47 ModuleSpecification (org.jboss.as.server.deployment.module.ModuleSpecification)45 CapabilityServiceSupport (org.jboss.as.controller.capability.CapabilityServiceSupport)40 VirtualFile (org.jboss.vfs.VirtualFile)39 ArrayList (java.util.ArrayList)37 CompositeIndex (org.jboss.as.server.deployment.annotation.CompositeIndex)37 ModuleLoader (org.jboss.modules.ModuleLoader)35 ServiceTarget (org.jboss.msc.service.ServiceTarget)34 ModuleDependency (org.jboss.as.server.deployment.module.ModuleDependency)33 WarMetaData (org.jboss.as.web.common.WarMetaData)31 HashMap (java.util.HashMap)30 HashSet (java.util.HashSet)30 EEApplicationClasses (org.jboss.as.ee.component.EEApplicationClasses)20 DeploymentReflectionIndex (org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex)20