void addManagementWebsocket(final DeploymentUnit unit, Class endpoint, String path) { try { final DeploymentResourceSupport deploymentResourceSupport = unit.getAttachment(Attachments.DEPLOYMENT_RESOURCE_SUPPORT); //websockets don't have the concept of a name, however the path much be unique final ModelNode node = deploymentResourceSupport.getDeploymentSubModel(UndertowExtension.SUBSYSTEM_NAME, PathElement.pathElement("websocket", path)); node.get("endpoint-class").set(endpoint.getName()); node.get("path").set(path); } catch (Exception e) { UndertowLogger.ROOT_LOGGER.failedToRegisterWebsocket(endpoint, path, e); } }
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); } } }
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; } } }
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); } } }
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); } }
@Override public ModelNode createDeploymentSubModel(final String subsystemName, final PathElement address) { // Using the getDeploymentSubModel results in the previous behavior return DeploymentResourceSupport.getDeploymentSubModel(subsystemName, address, this); }
@Override public ModelNode createDeploymentSubModel(final String subsystemName, final PathElement address) { // Using the getDeploymentSubModel results in the previous behavior return DeploymentResourceSupport.getDeploymentSubModel(subsystemName, address, this); }
@Override public ModelNode createDeploymentSubModel(String subsystemName, PathAddress address, Resource resource) { // Using the getDeploymentSubModel results in the previous behavior return DeploymentResourceSupport.getDeploymentSubModel(subsystemName, address, resource, this); } }
@Override public ModelNode getDeploymentSubsystemModel(final String subsystemName) { return DeploymentResourceSupport.getDeploymentSubModel(subsystemName, null, this); }
@Override public ModelNode createDeploymentSubModel(String subsystemName, PathAddress address, Resource resource) { // Using the getDeploymentSubModel results in the previous behavior return DeploymentResourceSupport.getDeploymentSubModel(subsystemName, address, resource, this); } }
@Override public ModelNode getDeploymentSubsystemModel(final String subsystemName) { return DeploymentResourceSupport.getDeploymentSubModel(subsystemName, null, this); }
void addManagementWebsocket(final DeploymentUnit unit, Class endpoint, String path) { try { final DeploymentResourceSupport deploymentResourceSupport = unit.getAttachment(Attachments.DEPLOYMENT_RESOURCE_SUPPORT); //websockets don't have the concept of a name, however the path much be unique final ModelNode node = deploymentResourceSupport.getDeploymentSubModel(UndertowExtension.SUBSYSTEM_NAME, PathElement.pathElement("websocket", path)); node.get("endpoint-class").set(endpoint.getName()); node.get("path").set(path); } catch (Exception e) { UndertowLogger.ROOT_LOGGER.failedToRegisterWebsocket(endpoint, path, e); } }
void addManagementWebsocket(final DeploymentUnit unit, Class endpoint, String path) { try { final DeploymentResourceSupport deploymentResourceSupport = unit.getAttachment(Attachments.DEPLOYMENT_RESOURCE_SUPPORT); //websockets don't have the concept of a name, however the path much be unique final ModelNode node = deploymentResourceSupport.getDeploymentSubModel(UndertowExtension.SUBSYSTEM_NAME, PathElement.pathElement("websocket", path)); node.get("endpoint-class").set(endpoint.getName()); node.get("path").set(path); } catch (Exception e) { UndertowLogger.ROOT_LOGGER.failedToRegisterWebsocket(endpoint, path, e); } }
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; } } }
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); } } }
private static void registerDeploymentResource(final DeploymentResourceSupport deploymentResourceSupport, final PathElement base, final ResourceDefinition def, final Collection<String> names) { for (String name : names) { // Replace any blank values with the default root-logger name; this should only happen on loggers final String resourceName = name.isEmpty() ? RootLoggerResourceDefinition.RESOURCE_NAME : name; final PathAddress address = PathAddress.pathAddress(base, PathElement.pathElement(def.getPathElement().getKey(), resourceName)); deploymentResourceSupport.getDeploymentSubModel(LoggingExtension.SUBSYSTEM_NAME, address); } }
private static void registerDeploymentResource(final DeploymentResourceSupport deploymentResourceSupport, final PathElement base, final ResourceDefinition def, final Collection<String> names) { for (String name : names) { // Replace any blank values with the default root-logger name; this should only happen on loggers final String resourceName = name.isEmpty() ? RootLoggerResourceDefinition.RESOURCE_NAME : name; final PathAddress address = PathAddress.pathAddress(base, PathElement.pathElement(def.getPathElement().getKey(), resourceName)); deploymentResourceSupport.getDeploymentSubModel(LoggingExtension.SUBSYSTEM_NAME, address); } }
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); } } }
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); } }
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); } }