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);
}
}
}
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);
}
}
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);
}
}
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);
}
}
}
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;
}
}
}
Aggregations