private ManagementResourceRegistration getRegistration(final boolean xa, final DeploymentUnit unit) { final Resource root = unit.getAttachment(DeploymentModelUtils.DEPLOYMENT_RESOURCE); synchronized (root) { ManagementResourceRegistration registration = unit.getAttachment(DeploymentModelUtils.MUTABLE_REGISTRATION_ATTACHMENT); final PathAddress address = xa ? XA_DATASOURCE_ADDRESS : DATASOURCE_ADDRESS; ManagementResourceRegistration subModel = registration.getSubModel(address); if (subModel == null) { throw new IllegalStateException(address.toString()); } return subModel; } }
@Override public void stop(StopContext context) { PathElement peLocaldWm = PathElement.pathElement(Constants.STATISTICS_NAME, "extended"); if (overrideRegistration.getSubModel(PathAddress.pathAddress(peLocaldWm)) != null) overrideRegistration.unregisterSubModel(peLocaldWm); }
@Override public void stop(StopContext context) { PathElement peLocaldWm = PathElement.pathElement(Constants.STATISTICS_NAME, "extended"); if (overrideRegistration.getSubModel(PathAddress.pathAddress(peLocaldWm)) != null) overrideRegistration.unregisterSubModel(peLocaldWm); }
@Override public void stop(StopContext context) { PathElement peDistributedWm = PathElement.pathElement(Constants.STATISTICS_NAME, "distributed"); if (overrideRegistration.getSubModel(PathAddress.pathAddress(peDistributedWm)) != null) overrideRegistration.unregisterSubModel(peDistributedWm); }
@Override public void stop(StopContext context) { PathElement peCD = PathElement.pathElement(Constants.STATISTICS_NAME, "pool"); if (overrideRegistration.getSubModel(PathAddress.pathAddress(peCD)) != null) { overrideRegistration.unregisterSubModel(peCD); } PathElement peExtended = PathElement.pathElement(Constants.STATISTICS_NAME, "extended"); if (overrideRegistration.getSubModel(PathAddress.pathAddress(peExtended)) != null) { overrideRegistration.unregisterSubModel(peExtended); } }
@Override public void stop(StopContext context) { PathElement peLocaldWm = PathElement.pathElement(Constants.STATISTICS_NAME, "local"); if (overrideRegistration.getSubModel(PathAddress.pathAddress(peLocaldWm)) != null) overrideRegistration.unregisterSubModel(peLocaldWm); }
@Override public void registerChildren(ManagementResourceRegistration resourceRegistration) { super.registerChildren(resourceRegistration); PathElement targetPe = RequestLimitHandler.INSTANCE.getPathElement(); AliasEntry aliasEntry = new AliasEntry(resourceRegistration.getSubModel(PathAddress.pathAddress(targetPe))) { @Override public PathAddress convertToTargetAddress(PathAddress aliasAddress, AliasContext aliasContext) { PathElement pe = aliasAddress.getLastElement(); return aliasAddress.getParent().append(PathElement.pathElement(targetPe.getKey(), pe.getValue())); } }; resourceRegistration.registerAlias(PathElement.pathElement("connection-limit"), aliasEntry); } }
ManagementResourceRegistration raReg = registration.getSubModel(RA_ADDRESS.getParent().append(Constants.RESOURCEADAPTER_NAME, deploymentName)); ManagementResourceRegistration cdefReg = raReg.getSubModel(PathAddress.pathAddress(PathElement.pathElement(Constants.CONNECTIONDEFINITIONS_NAME))); ManagementResourceRegistration aoReg = raReg.getSubModel(PathAddress.pathAddress(PathElement.pathElement(Constants.ADMIN_OBJECTS_NAME))); for (AdminObject ao : adminObjects) { ManagementResourceRegistration raBaseReg = registration.getSubModel(RA_ADDRESS); raBaseReg.unregisterOverrideModel(deploymentName);
if (registration != null) { if (jdbcStatsSize > 0) { if (registration.getSubModel(PathAddress.pathAddress(JDBC_STATISTICS)) == null) { if (registration.getSubModel(PathAddress.pathAddress(POOL_STATISTICS)) == null) {
@Override public void start(StartContext context) throws StartException { ROOT_LOGGER.debugf("Starting ResourceAdapterStatusicService"); synchronized (this) { final CommonDeployment deploymentMD = deployment.getValue().getDeployment(); PathElement peExtendedStats = PathElement.pathElement(Constants.STATISTICS_NAME, "extended"); if (deploymentMD.getConnector() != null && deploymentMD.getConnector().getAdminObjects() != null) { for (AdminObject ao : deploymentMD.getConnector().getAdminObjects()) { if (ao.getStatistics() != null) { StatisticsPlugin extendStats = ao.getStatistics(); extendStats.setEnabled(statsEnabled); if (extendStats.getNames().size() != 0) { if (extendStats.getNames().size() != 0 && overrideRegistration.getSubModel(PathAddress.pathAddress(peExtendedStats)) == null) { overrideRegistration.registerSubModel(new StatisticsResourceDefinition(peExtendedStats, CommonAttributes.RESOURCE_NAME, extendStats)); } } } } } } }
if (extendStats.getNames().size() != 0) { if (extendStats.getNames().size() != 0 && overrideRegistration.getSubModel(PathAddress.pathAddress(peExtendedStats)) == null) { overrideRegistration.registerSubModel(new StatisticsResourceDefinition(peExtendedStats, CommonAttributes.RESOURCE_NAME, extendStats)); if (poolStats.getNames().size() != 0 && overrideRegistration.getSubModel(PathAddress.pathAddress(pePoolStats)) == null) { overrideRegistration.registerSubModel(new StatisticsResourceDefinition(pePoolStats, CommonAttributes.RESOURCE_NAME, poolStats));
registration.getSubModel(RA_ADDRESS).registerOverrideModel(deploymentName, OD_PROVIDER); if (extendStats.getNames().size() != 0) { ManagementResourceRegistration cdRegistration = raRegistration.getSubModel(CON_DEF_ADDR); ManagementResourceRegistration overrideCdRegistration = cdRegistration.registerOverrideModel(cf.getJndiName(), OD_PROVIDER); if (overrideCdRegistration.getSubModel(EXTENDED_STATS_ADDR) == null) { overrideCdRegistration.registerSubModel(new StatisticsResourceDefinition(EXTENDED_STATS, CommonAttributes.RESOURCE_NAME, extendStats)); ManagementResourceRegistration cdRegistration = raRegistration.getSubModel(CON_DEF_ADDR); ManagementResourceRegistration overrideCdRegistration = cdRegistration.registerOverrideModel(cm.getJndiName(), OD_PROVIDER); if (overrideCdRegistration.getSubModel(POOL_STATS_ADDR) == null) { overrideCdRegistration.registerSubModel(new StatisticsResourceDefinition(POOL_STATS, CommonAttributes.RESOURCE_NAME, poolStats)); if (extendStats.getNames().size() != 0) { ManagementResourceRegistration cdRegistration = raRegistration.getSubModel(AO_ADDR); ManagementResourceRegistration overrideCdRegistration = cdRegistration.registerOverrideModel(ao.getJndiName(), OD_PROVIDER); if (overrideCdRegistration.getSubModel(EXTENDED_STATS_ADDR) == null) { overrideCdRegistration.registerSubModel(new StatisticsResourceDefinition(EXTENDED_STATS, CommonAttributes.RESOURCE_NAME, extendStats));
registration = baseRegistration.getSubModel(PathAddress.pathAddress(PathElement.pathElement("subdeployment"))); } else { registration = baseRegistration;
registration = baseRegistration.getSubModel(PathAddress.pathAddress(PathElement.pathElement("subdeployment"))); } else { registration = baseRegistration;
@Override public ManagementResourceRegistration getResourceRegistrationForUpdate() { ManagementResourceRegistration parent = primaryContext.getResourceRegistrationForUpdate(); return parent.getSubModel(activeStep.address); }
ManagementResourceRegistration getManagementResourceRegistration(ManagementModel managementModel) { if (resourceRegistration == null) { resourceRegistration = managementModel.getRootResourceRegistration().getSubModel(address); } return resourceRegistration; }
@Override public ManagementResourceRegistration getResourceRegistrationForUpdate() { acquireControllerLock(); ManagementResourceRegistration parent = primaryContext.getResourceRegistrationForUpdate(); return parent.getSubModel(activeStep.address); }
@Override public ManagementResourceRegistration getResourceRegistrationForUpdate() { acquireControllerLock(); ManagementResourceRegistration parent = primaryContext.getResourceRegistrationForUpdate(); return parent.getSubModel(activeStep.address); }
@Override public void stop(StopContext context) { PathElement peLocaldWm = PathElement.pathElement(Constants.STATISTICS_NAME, "extended"); if (overrideRegistration.getSubModel(PathAddress.pathAddress(peLocaldWm)) != null) overrideRegistration.unregisterSubModel(peLocaldWm); }
private void logNoHandler(ParsedBootOp parsedOp) { ImmutableManagementResourceRegistration child = managementModel.get().getRootResourceRegistration().getSubModel(parsedOp.address); if (child == null) { ROOT_LOGGER.error(ROOT_LOGGER.noSuchResourceType(parsedOp.address)); } else { ROOT_LOGGER.error(ROOT_LOGGER.noHandlerForOperation(parsedOp.operationName, parsedOp.address)); } }