Search in sources :

Example 6 with DeploymentResourceSupport

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

the class DsXmlDeploymentInstallProcessor method installManagementModel.

private void installManagementModel(final DataSource ds, final DeploymentUnit deploymentUnit, final PathAddress addr) {
    XMLDataSourceRuntimeHandler.INSTANCE.registerDataSource(addr, ds);
    final DeploymentResourceSupport deploymentResourceSupport = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_RESOURCE_SUPPORT);
    deploymentResourceSupport.getDeploymentSubModel(DataSourcesExtension.SUBSYSTEM_NAME, addr.getLastElement());
    if (ds.getConnectionProperties() != null) {
        for (final Map.Entry<String, String> prop : ds.getConnectionProperties().entrySet()) {
            PathAddress registration = PathAddress.pathAddress(addr.getLastElement(), PathElement.pathElement(CONNECTION_PROPERTIES, prop.getKey()));
            deploymentResourceSupport.getDeploymentSubModel(DataSourcesExtension.SUBSYSTEM_NAME, registration);
        }
    }
}
Also used : DeploymentResourceSupport(org.jboss.as.server.deployment.DeploymentResourceSupport) PathAddress(org.jboss.as.controller.PathAddress) Map(java.util.Map)

Example 7 with DeploymentResourceSupport

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

the class EjbManagementDeploymentUnitProcessor method installManagementResource.

private void installManagementResource(ComponentConfiguration configuration, DeploymentUnit deploymentUnit) {
    final EJBComponentType type = EJBComponentType.getComponentType(configuration);
    PathAddress addr = getComponentAddress(type, configuration, deploymentUnit);
    final AbstractEJBComponentRuntimeHandler<?> handler = type.getRuntimeHandler();
    handler.registerComponent(addr, configuration.getComponentDescription().getStartServiceName());
    deploymentUnit.addToAttachmentList(EjbDeploymentAttachmentKeys.MANAGED_COMPONENTS, new InstalledComponent(type, addr));
    final DeploymentResourceSupport deploymentResourceSupport = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_RESOURCE_SUPPORT);
    deploymentResourceSupport.getDeploymentSubModel(EJB3Extension.SUBSYSTEM_NAME, addr.getLastElement());
    final EJBComponentDescription description = (EJBComponentDescription) configuration.getComponentDescription();
    if (description.isTimerServiceRequired()) {
        final PathAddress timerServiceAddress = PathAddress.pathAddress(addr.getLastElement(), EJB3SubsystemModel.TIMER_SERVICE_PATH);
        final TimerServiceResource timerServiceResource = ((TimerServiceImpl) description.getTimerService()).getResource();
        deploymentResourceSupport.registerDeploymentSubResource(EJB3Extension.SUBSYSTEM_NAME, timerServiceAddress, timerServiceResource);
    }
}
Also used : DeploymentResourceSupport(org.jboss.as.server.deployment.DeploymentResourceSupport) TimerServiceResource(org.jboss.as.ejb3.subsystem.deployment.TimerServiceResource) InstalledComponent(org.jboss.as.ejb3.subsystem.deployment.InstalledComponent) PathAddress(org.jboss.as.controller.PathAddress) EJBComponentType(org.jboss.as.ejb3.subsystem.deployment.EJBComponentType) TimerServiceImpl(org.jboss.as.ejb3.timerservice.TimerServiceImpl) EJBComponentDescription(org.jboss.as.ejb3.component.EJBComponentDescription)

Example 8 with DeploymentResourceSupport

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

the class JaxrsScanningProcessor method addManagement.

private void addManagement(DeploymentUnit deploymentUnit, String componentClass) {
    try {
        final DeploymentResourceSupport deploymentResourceSupport = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.DEPLOYMENT_RESOURCE_SUPPORT);
        deploymentResourceSupport.getDeploymentSubModel(JaxrsExtension.SUBSYSTEM_NAME, PathElement.pathElement(DeploymentRestResourcesDefintion.REST_RESOURCE_NAME, componentClass));
    } catch (Exception e) {
        JaxrsLogger.JAXRS_LOGGER.failedToRegisterManagementViewForRESTResources(componentClass, e);
    }
}
Also used : DeploymentResourceSupport(org.jboss.as.server.deployment.DeploymentResourceSupport) ModuleLoadException(org.jboss.modules.ModuleLoadException) DeploymentUnitProcessingException(org.jboss.as.server.deployment.DeploymentUnitProcessingException)

Example 9 with DeploymentResourceSupport

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

the class DsXmlDeploymentInstallProcessor method installManagementModel.

private void installManagementModel(final XaDataSource ds, final DeploymentUnit deploymentUnit, final PathAddress addr) {
    XMLXaDataSourceRuntimeHandler.INSTANCE.registerDataSource(addr, ds);
    final DeploymentResourceSupport deploymentResourceSupport = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_RESOURCE_SUPPORT);
    deploymentResourceSupport.getDeploymentSubModel(DataSourcesExtension.SUBSYSTEM_NAME, addr.getLastElement());
    if (ds.getXaDataSourceProperty() != null) {
        for (final Map.Entry<String, String> prop : ds.getXaDataSourceProperty().entrySet()) {
            PathAddress registration = PathAddress.pathAddress(addr.getLastElement(), PathElement.pathElement(XA_CONNECTION_PROPERTIES, prop.getKey()));
            deploymentResourceSupport.getDeploymentSubModel(DataSourcesExtension.SUBSYSTEM_NAME, registration);
        }
    }
}
Also used : DeploymentResourceSupport(org.jboss.as.server.deployment.DeploymentResourceSupport) PathAddress(org.jboss.as.controller.PathAddress) Map(java.util.Map)

Example 10 with DeploymentResourceSupport

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

the class UndertowDeploymentProcessor method processManagement.

//todo move to UndertowDeploymentService and use all registered servlets from Deployment instead of just one found by metadata
void processManagement(final DeploymentUnit unit, JBossWebMetaData metaData) {
    final DeploymentResourceSupport deploymentResourceSupport = unit.getAttachment(Attachments.DEPLOYMENT_RESOURCE_SUPPORT);
    for (final JBossServletMetaData servlet : metaData.getServlets()) {
        try {
            final String name = servlet.getName();
            final ModelNode node = deploymentResourceSupport.getDeploymentSubModel(UndertowExtension.SUBSYSTEM_NAME, PathElement.pathElement("servlet", name));
            node.get("servlet-class").set(servlet.getServletClass());
            node.get("servlet-name").set(servlet.getServletName());
        } catch (Exception e) {
            // Should a failure in creating the mgmt view also make to the deployment to fail?
            continue;
        }
    }
}
Also used : DeploymentResourceSupport(org.jboss.as.server.deployment.DeploymentResourceSupport) JBossServletMetaData(org.jboss.metadata.web.jboss.JBossServletMetaData) ModelNode(org.jboss.dmr.ModelNode) DeploymentUnitProcessingException(org.jboss.as.server.deployment.DeploymentUnitProcessingException) MalformedURLException(java.net.MalformedURLException)

Aggregations

DeploymentResourceSupport (org.jboss.as.server.deployment.DeploymentResourceSupport)13 PathAddress (org.jboss.as.controller.PathAddress)8 ModelNode (org.jboss.dmr.ModelNode)8 DeploymentUnitProcessingException (org.jboss.as.server.deployment.DeploymentUnitProcessingException)5 PathElement (org.jboss.as.controller.PathElement)4 DeploymentUnit (org.jboss.as.server.deployment.DeploymentUnit)4 Map (java.util.Map)3 ServiceName (org.jboss.msc.service.ServiceName)3 MalformedURLException (java.net.MalformedURLException)2 JBossServletMetaData (org.jboss.metadata.web.jboss.JBossServletMetaData)2 DeploymentInfo (io.undertow.servlet.api.DeploymentInfo)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 Executor (java.util.concurrent.Executor)1 Queue (javax.jms.Queue)1 Topic (javax.jms.Topic)1 CapabilityServiceSupport (org.jboss.as.controller.capability.CapabilityServiceSupport)1 ComponentRegistry (org.jboss.as.ee.component.ComponentRegistry)1 EJBComponentDescription (org.jboss.as.ejb3.component.EJBComponentDescription)1