Search in sources :

Example 1 with StandardResourceDescriptionResolver

use of org.jboss.as.controller.descriptions.StandardResourceDescriptionResolver in project wildfly by wildfly.

the class ProtocolResourceRegistrationHandler method execute.

@Override
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
    OverrideDescriptionProvider provider = new OverrideDescriptionProvider() {

        @Override
        public Map<String, ModelNode> getAttributeOverrideDescriptions(Locale locale) {
            return Collections.emptyMap();
        }

        @Override
        public Map<String, ModelNode> getChildTypeOverrideDescriptions(Locale locale) {
            StandardResourceDescriptionResolver resolver = new JGroupsResourceDescriptionResolver();
            String description = resolver.getChildTypeDescription(ProtocolResourceDefinition.WILDCARD_PATH.getKey(), locale, resolver.getResourceBundle(locale));
            ModelNode result = new ModelNode();
            result.get(ModelDescriptionConstants.DESCRIPTION).set(description);
            return Collections.singletonMap(ProtocolResourceDefinition.WILDCARD_PATH.getKey(), result);
        }
    };
    Resource resource = context.readResourceForUpdate(PathAddress.EMPTY_ADDRESS);
    String stack = STACK.resolveModelAttribute(context, resource.getModel()).asString();
    ManagementResourceRegistration registration = context.getResourceRegistrationForUpdate().registerOverrideModel(context.getCurrentAddressValue(), provider);
    PathAddress stackAddress = context.getCurrentAddress().getParent().append(StackResourceDefinition.pathElement(stack));
    Resource stackResource = context.readResourceFromRoot(stackAddress, false);
    for (String name : stackResource.getChildrenNames(TransportResourceDefinition.WILDCARD_PATH.getKey())) {
        PathAddress transportAddress = stackAddress.append(TransportResourceDefinition.pathElement(name));
        ModelNode transport = context.readResourceFromRoot(transportAddress, false).getModel();
        String moduleName = MODULE.resolveModelAttribute(context, transport).asString();
        Class<? extends Protocol> transportClass = findProtocolClass(context, name, moduleName);
        registration.registerSubModel(this.createProtocolResourceDefinition(name, transportClass));
        resource.registerChild(ProtocolResourceDefinition.pathElement(name), PlaceholderResource.INSTANCE);
    }
    for (String name : stackResource.getChildrenNames(ProtocolResourceDefinition.WILDCARD_PATH.getKey())) {
        Resource protocolResource = context.readResourceFromRoot(stackAddress.append(ProtocolResourceDefinition.pathElement(name)), false);
        String moduleName = MODULE.resolveModelAttribute(context, protocolResource.getModel()).asString();
        Class<? extends Protocol> protocolClass = findProtocolClass(context, name, moduleName);
        registration.registerSubModel(this.createProtocolResourceDefinition(name, protocolClass));
        resource.registerChild(ProtocolResourceDefinition.pathElement(name), PlaceholderResource.INSTANCE);
    }
    if (stackResource.hasChild(RelayResourceDefinition.PATH)) {
        registration.registerSubModel(this.createProtocolResourceDefinition(RelayConfiguration.PROTOCOL_NAME, RELAY2.class));
        resource.registerChild(ProtocolResourceDefinition.pathElement(RelayConfiguration.PROTOCOL_NAME), PlaceholderResource.INSTANCE);
    }
}
Also used : Locale(java.util.Locale) PathAddress(org.jboss.as.controller.PathAddress) Resource(org.jboss.as.controller.registry.Resource) PlaceholderResource(org.jboss.as.controller.registry.PlaceholderResource) OverrideDescriptionProvider(org.jboss.as.controller.descriptions.OverrideDescriptionProvider) StandardResourceDescriptionResolver(org.jboss.as.controller.descriptions.StandardResourceDescriptionResolver) ManagementResourceRegistration(org.jboss.as.controller.registry.ManagementResourceRegistration) ModelNode(org.jboss.dmr.ModelNode) RELAY2(org.jgroups.protocols.relay.RELAY2)

Example 2 with StandardResourceDescriptionResolver

use of org.jboss.as.controller.descriptions.StandardResourceDescriptionResolver in project wildfly by wildfly.

the class DistributedWorkManagerStatisticsService method start.

@Override
public void start(StartContext context) throws StartException {
    synchronized (this) {
        DistributedWorkManager dwm = distributedWorkManager.getValue();
        dwm.setDistributedStatisticsEnabled(statsEnabled);
        if (dwm.getDistributedStatistics() != null) {
            PathElement peDistributedWm = PathElement.pathElement(Constants.STATISTICS_NAME, "distributed");
            ResourceBuilder resourceBuilder = ResourceBuilder.Factory.create(peDistributedWm, new StandardResourceDescriptionResolver(Constants.STATISTICS_NAME + "." + Constants.WORKMANAGER_NAME, CommonAttributes.RESOURCE_NAME, CommonAttributes.class.getClassLoader()));
            ManagementResourceRegistration dwmSubRegistration = overrideRegistration.registerSubModel(resourceBuilder.build());
            OperationStepHandler metricHandler = new WorkManagerRuntimeAttributeReadHandler(dwm, dwm.getDistributedStatistics(), false);
            for (SimpleAttributeDefinition metric : Constants.WORKMANAGER_METRICS) {
                dwmSubRegistration.registerMetric(metric, metricHandler);
            }
            OperationStepHandler readHandler = new WorkManagerRuntimeAttributeReadHandler(dwm, dwm.getDistributedStatistics(), false);
            OperationStepHandler writeHandler = new WorkManagerRuntimeAttributeWriteHandler(dwm, false, Constants.DISTRIBUTED_WORKMANAGER_RW_ATTRIBUTES);
            for (SimpleAttributeDefinition attribute : Constants.DISTRIBUTED_WORKMANAGER_RW_ATTRIBUTES) {
                dwmSubRegistration.registerReadWriteAttribute(attribute, readHandler, writeHandler);
            }
            dwmSubRegistration.registerOperationHandler(ClearWorkManagerStatisticsHandler.DEFINITION, new ClearWorkManagerStatisticsHandler(dwm));
        }
    }
}
Also used : ResourceBuilder(org.jboss.as.controller.ResourceBuilder) DistributedWorkManager(org.jboss.jca.core.api.workmanager.DistributedWorkManager) PathElement(org.jboss.as.controller.PathElement) WorkManagerRuntimeAttributeWriteHandler(org.jboss.as.connector.subsystems.resourceadapters.WorkManagerRuntimeAttributeWriteHandler) OperationStepHandler(org.jboss.as.controller.OperationStepHandler) SimpleAttributeDefinition(org.jboss.as.controller.SimpleAttributeDefinition) StandardResourceDescriptionResolver(org.jboss.as.controller.descriptions.StandardResourceDescriptionResolver) ManagementResourceRegistration(org.jboss.as.controller.registry.ManagementResourceRegistration) WorkManagerRuntimeAttributeReadHandler(org.jboss.as.connector.subsystems.resourceadapters.WorkManagerRuntimeAttributeReadHandler) ClearWorkManagerStatisticsHandler(org.jboss.as.connector.dynamicresource.ClearWorkManagerStatisticsHandler)

Example 3 with StandardResourceDescriptionResolver

use of org.jboss.as.controller.descriptions.StandardResourceDescriptionResolver in project wildfly by wildfly.

the class WorkManagerStatisticsService method start.

@Override
public void start(StartContext context) throws StartException {
    synchronized (this) {
        WorkManager wm = workManager.getValue();
        wm.setStatisticsEnabled(statsEnabled);
        if (wm.getStatistics() != null) {
            PathElement peLocaldWm = PathElement.pathElement(Constants.STATISTICS_NAME, "local");
            ResourceBuilder resourceBuilder = ResourceBuilder.Factory.create(peLocaldWm, new StandardResourceDescriptionResolver(Constants.STATISTICS_NAME + "." + Constants.WORKMANAGER_NAME, CommonAttributes.RESOURCE_NAME, CommonAttributes.class.getClassLoader()));
            ManagementResourceRegistration wmSubRegistration = overrideRegistration.registerSubModel(resourceBuilder.build());
            OperationStepHandler metricHandler = new WorkManagerRuntimeAttributeReadHandler(wm, wm.getStatistics(), false);
            for (SimpleAttributeDefinition metric : Constants.WORKMANAGER_METRICS) {
                wmSubRegistration.registerMetric(metric, metricHandler);
            }
            OperationStepHandler readHandler = new WorkManagerRuntimeAttributeReadHandler(wm, wm.getStatistics(), false);
            OperationStepHandler writeHandler = new WorkManagerRuntimeAttributeWriteHandler(wm, false, Constants.WORKMANAGER_RW_ATTRIBUTES);
            for (SimpleAttributeDefinition attribute : Constants.WORKMANAGER_RW_ATTRIBUTES) {
                wmSubRegistration.registerReadWriteAttribute(attribute, readHandler, writeHandler);
            }
            wmSubRegistration.registerOperationHandler(ClearWorkManagerStatisticsHandler.DEFINITION, new ClearWorkManagerStatisticsHandler(wm));
        }
    }
}
Also used : ResourceBuilder(org.jboss.as.controller.ResourceBuilder) PathElement(org.jboss.as.controller.PathElement) WorkManagerRuntimeAttributeWriteHandler(org.jboss.as.connector.subsystems.resourceadapters.WorkManagerRuntimeAttributeWriteHandler) WorkManager(org.jboss.jca.core.api.workmanager.WorkManager) OperationStepHandler(org.jboss.as.controller.OperationStepHandler) SimpleAttributeDefinition(org.jboss.as.controller.SimpleAttributeDefinition) StandardResourceDescriptionResolver(org.jboss.as.controller.descriptions.StandardResourceDescriptionResolver) ManagementResourceRegistration(org.jboss.as.controller.registry.ManagementResourceRegistration) WorkManagerRuntimeAttributeReadHandler(org.jboss.as.connector.subsystems.resourceadapters.WorkManagerRuntimeAttributeReadHandler) ClearWorkManagerStatisticsHandler(org.jboss.as.connector.dynamicresource.ClearWorkManagerStatisticsHandler)

Example 4 with StandardResourceDescriptionResolver

use of org.jboss.as.controller.descriptions.StandardResourceDescriptionResolver in project wildfly by wildfly.

the class IronJacamarActivationResourceService method start.

@Override
public void start(StartContext context) throws StartException {
    ManagementResourceRegistration subRegistration;
    final CommonDeployment deploymentMD = deployment.getValue().getDeployment();
    ROOT_LOGGER.debugf("Starting IronJacamarActivationResourceService %s", deploymentMD.getDeploymentName());
    try {
        ResourceBuilder resourceBuilder = ResourceBuilder.Factory.create(SUBSYSTEM_PATH_ELEMENT, new StandardResourceDescriptionResolver(Constants.STATISTICS_NAME, CommonAttributes.RESOURCE_NAME, CommonAttributes.class.getClassLoader()));
        subRegistration = registration.registerSubModel(resourceBuilder.build());
    } catch (IllegalArgumentException iae) {
        subRegistration = registration.getSubModel(PathAddress.pathAddress(SUBSYSTEM_PATH_ELEMENT));
    }
    ManagementResourceRegistration ijRegistration;
    try {
        ijRegistration = subRegistration.registerSubModel(new IronJacamarResourceDefinition());
    } catch (IllegalArgumentException iae) {
        ijRegistration = subRegistration.getSubModel(PathAddress.pathAddress(Constants.IRONJACAMAR_NAME, Constants.IRONJACAMAR_NAME));
    }
    try {
        if (deploymentResource != null) {
            PathElement peLocalStats = PathElement.pathElement(Constants.STATISTICS_NAME, "extended");
            if (deploymentMD.getConnector() != null && deploymentMD.getConnector().getResourceAdapter() != null) {
                ManagementResourceRegistration raRegistration = ijRegistration.getSubModel(PathAddress.EMPTY_ADDRESS.append(PathElement.pathElement(Constants.RESOURCEADAPTER_NAME))).registerOverrideModel(deploymentMD.getDeploymentName(), new OverrideDescriptionProvider() {

                    @Override
                    public Map<String, ModelNode> getAttributeOverrideDescriptions(Locale locale) {
                        return Collections.emptyMap();
                    }

                    @Override
                    public Map<String, ModelNode> getChildTypeOverrideDescriptions(Locale locale) {
                        return Collections.emptyMap();
                    }
                });
                ResourceBuilder resourceBuilder = ResourceBuilder.Factory.create(peLocalStats, new StandardResourceDescriptionResolver(Constants.STATISTICS_NAME + "." + Constants.WORKMANAGER_NAME, CommonAttributes.RESOURCE_NAME, CommonAttributes.class.getClassLoader()));
                ManagementResourceRegistration raStatsSubRegistration = raRegistration.registerSubModel(resourceBuilder.build());
                if (deploymentMD.getConnector().getResourceAdapter().getStatistics() != null) {
                    StatisticsPlugin raStats = deploymentMD.getConnector().getResourceAdapter().getStatistics();
                    raStats.setEnabled(statsEnabled);
                    PoolMetrics.ParametrizedPoolMetricsHandler handler = new PoolMetrics.ParametrizedPoolMetricsHandler(raStats);
                    for (AttributeDefinition attribute : StatisticsResourceDefinition.getAttributesFromPlugin(raStats)) {
                        raStatsSubRegistration.registerMetric(attribute, handler);
                    }
                    raStatsSubRegistration.registerOperationHandler(ClearStatisticsHandler.DEFINITION, new ClearStatisticsHandler(raStats));
                }
                if (deploymentMD.getConnector() != null && deploymentMD.getConnector().getConnectionFactories() != null) {
                    for (ConnectionFactory cf : deploymentMD.getConnector().getConnectionFactories()) {
                        if (cf.getManagedConnectionFactory() != null && cf.getManagedConnectionFactory().getStatistics() != null) {
                            PathElement peCD = PathElement.pathElement(Constants.CONNECTIONDEFINITIONS_NAME, cf.getJndiName());
                            PathElement peCdStats = PathElement.pathElement(Constants.STATISTICS_NAME, "extended");
                            StatisticsPlugin extendStats = cf.getManagedConnectionFactory().getStatistics();
                            extendStats.setEnabled(statsEnabled);
                            if (extendStats.getNames().size() != 0) {
                                if (extendStats.getNames().size() != 0) {
                                    ManagementResourceRegistration cdRegistration = raRegistration.getSubModel(PathAddress.pathAddress(peCD));
                                    ManagementResourceRegistration overrideCdRegistration = cdRegistration.registerOverrideModel(cf.getJndiName(), new OverrideDescriptionProvider() {

                                        @Override
                                        public Map<String, ModelNode> getAttributeOverrideDescriptions(Locale locale) {
                                            return Collections.emptyMap();
                                        }

                                        @Override
                                        public Map<String, ModelNode> getChildTypeOverrideDescriptions(Locale locale) {
                                            return Collections.emptyMap();
                                        }
                                    });
                                    if (extendStats.getNames().size() != 0 && overrideCdRegistration.getSubModel(PathAddress.pathAddress(peCdStats)) == null) {
                                        overrideCdRegistration.registerSubModel(new StatisticsResourceDefinition(peCdStats, CommonAttributes.RESOURCE_NAME, extendStats));
                                    }
                                }
                            }
                        }
                    }
                }
                if (deploymentMD.getConnectionManagers() != null) {
                    for (ConnectionManager cm : deploymentMD.getConnectionManagers()) {
                        if (cm.getPool() != null) {
                            PathElement peCD = PathElement.pathElement(Constants.CONNECTIONDEFINITIONS_NAME, cm.getJndiName());
                            PathElement peCdStats = PathElement.pathElement(Constants.STATISTICS_NAME, "pool");
                            StatisticsPlugin poolStats = cm.getPool().getStatistics();
                            poolStats.setEnabled(statsEnabled);
                            if (poolStats.getNames().size() != 0) {
                                ManagementResourceRegistration cdRegistration = raRegistration.getSubModel(PathAddress.pathAddress(peCD));
                                ManagementResourceRegistration overrideCdRegistration = cdRegistration.registerOverrideModel(cm.getJndiName(), new OverrideDescriptionProvider() {

                                    @Override
                                    public Map<String, ModelNode> getAttributeOverrideDescriptions(Locale locale) {
                                        return Collections.emptyMap();
                                    }

                                    @Override
                                    public Map<String, ModelNode> getChildTypeOverrideDescriptions(Locale locale) {
                                        return Collections.emptyMap();
                                    }
                                });
                                if (poolStats.getNames().size() != 0 && overrideCdRegistration.getSubModel(PathAddress.pathAddress(peCdStats)) == null) {
                                    overrideCdRegistration.registerSubModel(new StatisticsResourceDefinition(peCdStats, CommonAttributes.RESOURCE_NAME, poolStats));
                                }
                            }
                        }
                    }
                }
                if (deploymentMD.getConnector() != null && deploymentMD.getConnector().getAdminObjects() != null) {
                    for (AdminObject ao : deploymentMD.getConnector().getAdminObjects()) {
                        if (ao.getStatistics() != null) {
                            PathElement peCD = PathElement.pathElement(Constants.ADMIN_OBJECTS_NAME, ao.getJndiName());
                            PathElement peCdStats = PathElement.pathElement(Constants.STATISTICS_NAME, "extended");
                            StatisticsPlugin extendStats = ao.getStatistics();
                            extendStats.setEnabled(statsEnabled);
                            if (extendStats.getNames().size() != 0) {
                                if (extendStats.getNames().size() != 0) {
                                    ManagementResourceRegistration cdRegistration = raRegistration.getSubModel(PathAddress.pathAddress(peCD));
                                    ManagementResourceRegistration overrideCdRegistration = cdRegistration.registerOverrideModel(ao.getJndiName(), new OverrideDescriptionProvider() {

                                        @Override
                                        public Map<String, ModelNode> getAttributeOverrideDescriptions(Locale locale) {
                                            return Collections.emptyMap();
                                        }

                                        @Override
                                        public Map<String, ModelNode> getChildTypeOverrideDescriptions(Locale locale) {
                                            return Collections.emptyMap();
                                        }
                                    });
                                    if (extendStats.getNames().size() != 0 && overrideCdRegistration.getSubModel(PathAddress.pathAddress(peCdStats)) == null) {
                                        overrideCdRegistration.registerSubModel(new StatisticsResourceDefinition(peCdStats, CommonAttributes.RESOURCE_NAME, extendStats));
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    } catch (IllegalArgumentException e) {
    //ignore it, already restered
    }
    Resource subsystemResource;
    if (!deploymentResource.hasChild(SUBSYSTEM_PATH_ELEMENT)) {
        subsystemResource = new IronJacamarResource.IronJacamarRuntimeResource();
        deploymentResource.registerChild(SUBSYSTEM_PATH_ELEMENT, subsystemResource);
    } else {
        subsystemResource = deploymentResource.getChild(SUBSYSTEM_PATH_ELEMENT);
    }
    IronJacamarResourceCreator.INSTANCE.execute(subsystemResource, mdr.getValue(), deployment.getValue().getRaName());
}
Also used : Locale(java.util.Locale) StatisticsResourceDefinition(org.jboss.as.connector.dynamicresource.StatisticsResourceDefinition) ResourceBuilder(org.jboss.as.controller.ResourceBuilder) IronJacamarResourceDefinition(org.jboss.as.connector.subsystems.resourceadapters.IronJacamarResourceDefinition) StatisticsPlugin(org.jboss.jca.core.spi.statistics.StatisticsPlugin) Resource(org.jboss.as.controller.registry.Resource) IronJacamarResource(org.jboss.as.connector.subsystems.resourceadapters.IronJacamarResource) AttributeDefinition(org.jboss.as.controller.AttributeDefinition) IronJacamarResource(org.jboss.as.connector.subsystems.resourceadapters.IronJacamarResource) StandardResourceDescriptionResolver(org.jboss.as.controller.descriptions.StandardResourceDescriptionResolver) OverrideDescriptionProvider(org.jboss.as.controller.descriptions.OverrideDescriptionProvider) ManagementResourceRegistration(org.jboss.as.controller.registry.ManagementResourceRegistration) PoolMetrics(org.jboss.as.connector.subsystems.common.pool.PoolMetrics) CommonDeployment(org.jboss.jca.deployers.common.CommonDeployment) ConnectionFactory(org.jboss.jca.core.api.management.ConnectionFactory) ConnectionManager(org.jboss.jca.core.connectionmanager.ConnectionManager) PathElement(org.jboss.as.controller.PathElement) ClearStatisticsHandler(org.jboss.as.connector.dynamicresource.ClearStatisticsHandler) Map(java.util.Map) AdminObject(org.jboss.jca.core.api.management.AdminObject)

Example 5 with StandardResourceDescriptionResolver

use of org.jboss.as.controller.descriptions.StandardResourceDescriptionResolver in project wildfly by wildfly.

the class JPAService method createManagementStatisticsResource.

/**
     * Create single instance of management statistics resource per managementAdaptor version.
     *
     * ManagementAccess
     *
     * The persistence provider and jipijapa adapters will be in the same classloader,
     * either a static module or included directly in the application.  Those are the two supported use
     * cases for management of deployment persistence units also.
     *
     * From a management point of view, the requirements are:
     *   1.  show management statistics for static persistence provider modules and applications that have
     *       their own persistence provider module.
     *
     *   2.  persistence provider adapters will provide a unique key that identifies the management version of supported
     *       management statistics/operations.  For example, Hibernate 3.x might be 1.0, Hibernate 4.1/4.2 might
     *       be version 2.0 and Hibernate 4.3 could be 2.0 also as long as its compatible (same stats) with 4.1/4.2.
     *       Eventually, a Hibernate (later version) change in statistics is likely to happen, the management version
     *       will be incremented.
     *
     *
     * @param managementAdaptor the management adaptor that will provide statistics
     * @param scopedPersistenceUnitName name of the persistence unit
     * @param deploymentUnit deployment unit for the deployment requesting a resource
     * @return the management resource
     */
public static Resource createManagementStatisticsResource(final ManagementAdaptor managementAdaptor, final String scopedPersistenceUnitName, final DeploymentUnit deploymentUnit) {
    synchronized (existingResourceDescriptionResolver) {
        final EntityManagerFactoryLookup entityManagerFactoryLookup = new EntityManagerFactoryLookup();
        final Statistics statistics = managementAdaptor.getStatistics();
        if (false == existingResourceDescriptionResolver.contains(managementAdaptor.getVersion())) {
            // setup statistics (this used to be part of JPA subsystem startup)
            ResourceDescriptionResolver resourceDescriptionResolver = new StandardResourceDescriptionResolver(statistics.getResourceBundleKeyPrefix(), statistics.getResourceBundleName(), statistics.getClass().getClassLoader()) {

                private ResourceDescriptionResolver fallback = JPAExtension.getResourceDescriptionResolver();

                //add a fallback in case provider doesn't have all properties properly defined
                @Override
                public String getResourceAttributeDescription(String attributeName, Locale locale, ResourceBundle bundle) {
                    if (bundle.containsKey(getBundleKey(attributeName))) {
                        return super.getResourceAttributeDescription(attributeName, locale, bundle);
                    } else {
                        return fallback.getResourceAttributeDescription(attributeName, locale, fallback.getResourceBundle(locale));
                    }
                }
            };
            PathElement subsystemPE = PathElement.pathElement(ModelDescriptionConstants.SUBSYSTEM, JPAExtension.SUBSYSTEM_NAME);
            ManagementResourceRegistration deploymentResourceRegistration = deploymentUnit.getAttachment(DeploymentModelUtils.MUTABLE_REGISTRATION_ATTACHMENT);
            ManagementResourceRegistration deploymentSubsystemRegistration = deploymentResourceRegistration.getSubModel(PathAddress.pathAddress(subsystemPE));
            ManagementResourceRegistration subdeploymentSubsystemRegistration = deploymentResourceRegistration.getSubModel(PathAddress.pathAddress(PathElement.pathElement(ModelDescriptionConstants.SUBDEPLOYMENT), subsystemPE));
            ManagementResourceRegistration providerResource = deploymentSubsystemRegistration.registerSubModel(new ManagementResourceDefinition(PathElement.pathElement(managementAdaptor.getIdentificationLabel()), resourceDescriptionResolver, statistics, entityManagerFactoryLookup));
            providerResource.registerReadOnlyAttribute(PersistenceUnitServiceHandler.SCOPED_UNIT_NAME, null);
            providerResource = subdeploymentSubsystemRegistration.registerSubModel(new ManagementResourceDefinition(PathElement.pathElement(managementAdaptor.getIdentificationLabel()), resourceDescriptionResolver, statistics, entityManagerFactoryLookup));
            providerResource.registerReadOnlyAttribute(PersistenceUnitServiceHandler.SCOPED_UNIT_NAME, null);
            existingResourceDescriptionResolver.add(managementAdaptor.getVersion());
        }
        // create (per deployment) dynamic Resource implementation that can reflect the deployment specific names (e.g. jpa entity classname/Hibernate region name)
        return new DynamicManagementStatisticsResource(statistics, scopedPersistenceUnitName, managementAdaptor.getIdentificationLabel(), entityManagerFactoryLookup);
    }
}
Also used : Locale(java.util.Locale) ManagementResourceDefinition(org.jboss.as.jpa.management.ManagementResourceDefinition) PathElement(org.jboss.as.controller.PathElement) DynamicManagementStatisticsResource(org.jboss.as.jpa.management.DynamicManagementStatisticsResource) StandardResourceDescriptionResolver(org.jboss.as.controller.descriptions.StandardResourceDescriptionResolver) ResourceDescriptionResolver(org.jboss.as.controller.descriptions.ResourceDescriptionResolver) EntityManagerFactoryLookup(org.jboss.as.jpa.management.EntityManagerFactoryLookup) StandardResourceDescriptionResolver(org.jboss.as.controller.descriptions.StandardResourceDescriptionResolver) ResourceBundle(java.util.ResourceBundle) ManagementResourceRegistration(org.jboss.as.controller.registry.ManagementResourceRegistration) Statistics(org.jipijapa.management.spi.Statistics)

Aggregations

StandardResourceDescriptionResolver (org.jboss.as.controller.descriptions.StandardResourceDescriptionResolver)6 ManagementResourceRegistration (org.jboss.as.controller.registry.ManagementResourceRegistration)5 PathElement (org.jboss.as.controller.PathElement)4 Locale (java.util.Locale)3 ResourceBuilder (org.jboss.as.controller.ResourceBuilder)3 ClearWorkManagerStatisticsHandler (org.jboss.as.connector.dynamicresource.ClearWorkManagerStatisticsHandler)2 WorkManagerRuntimeAttributeReadHandler (org.jboss.as.connector.subsystems.resourceadapters.WorkManagerRuntimeAttributeReadHandler)2 WorkManagerRuntimeAttributeWriteHandler (org.jboss.as.connector.subsystems.resourceadapters.WorkManagerRuntimeAttributeWriteHandler)2 OperationStepHandler (org.jboss.as.controller.OperationStepHandler)2 SimpleAttributeDefinition (org.jboss.as.controller.SimpleAttributeDefinition)2 OverrideDescriptionProvider (org.jboss.as.controller.descriptions.OverrideDescriptionProvider)2 ResourceDescriptionResolver (org.jboss.as.controller.descriptions.ResourceDescriptionResolver)2 Resource (org.jboss.as.controller.registry.Resource)2 Statistics (org.jipijapa.management.spi.Statistics)2 Map (java.util.Map)1 ResourceBundle (java.util.ResourceBundle)1 ClearStatisticsHandler (org.jboss.as.connector.dynamicresource.ClearStatisticsHandler)1 StatisticsResourceDefinition (org.jboss.as.connector.dynamicresource.StatisticsResourceDefinition)1 PoolMetrics (org.jboss.as.connector.subsystems.common.pool.PoolMetrics)1 IronJacamarResource (org.jboss.as.connector.subsystems.resourceadapters.IronJacamarResource)1