PathAddress AO_ADDR = PathAddress.EMPTY_ADDRESS.append(Constants.ADMIN_OBJECTS_NAME); for (AdminObject ao : adminObjects) { StatisticsPlugin extendStats = ao.getStatistics(); if (extendStats != null) { extendStats.setEnabled(statsEnabled); cdRegistration.registerOverrideModel(ao.getJndiName(), OD_PROVIDER); if (overrideCdRegistration.getSubModel(EXTENDED_STATS_ADDR) == null) { overrideCdRegistration.registerSubModel(new StatisticsResourceDefinition(EXTENDED_STATS, CommonAttributes.RESOURCE_NAME, extendStats));
if (mgtAo.getAdminObject() != null) String jndiName = cleanJndiName(mgtAo.getJndiName()); for (org.jboss.jca.core.api.management.ConfigProperty mgtCp : mgtAo.getConfigProperties()) ",type=AdminObject,class=" + getClassName(mgtAo.getAdminObject().getClass().getName()); DynamicMBean aoDMB = JMX.createMBean(mgtAo.getAdminObject(), "Admin object", writeable, if (mgtAo.getStatistics() != null) getClassName(mgtAo.getAdminObject().getClass().getName()); excludeStatOperations.add("delta(.)*"); DynamicMBean aoSDMB = JMX.createMBean(mgtAo.getStatistics(), "Admin object statistics", writeStatAttributes, null,
/** * String representation * @return The string */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("AdminObject@").append(Integer.toHexString(System.identityHashCode(this))); sb.append("[instance=").append(getAdminObject()); sb.append(" configProperties=").append(configProperties); sb.append(" statistics=").append(getStatistics()); sb.append("]"); return sb.toString(); } }
@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)); } } } } } } }
aoReg.unregisterOverrideModel(ao.getJndiName());
/** * Get the statistics * @return The value; <code>null</code> if no statistics is available */ public StatisticsPlugin getStatistics() { if (getAdminObject() != null && getAdminObject() instanceof Statistics) { return ((Statistics)getAdminObject()).getStatistics(); } return 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)); } } } } } } }
aoReg.unregisterOverrideModel(ao.getJndiName());
PathAddress AO_ADDR = PathAddress.EMPTY_ADDRESS.append(Constants.ADMIN_OBJECTS_NAME); for (AdminObject ao : adminObjects) { StatisticsPlugin extendStats = ao.getStatistics(); if (extendStats != null) { extendStats.setEnabled(statsEnabled); cdRegistration.registerOverrideModel(ao.getJndiName(), OD_PROVIDER); if (overrideCdRegistration.getSubModel(EXTENDED_STATS_ADDR) == null) { overrideCdRegistration.registerSubModel(new StatisticsResourceDefinition(EXTENDED_STATS, CommonAttributes.RESOURCE_NAME, extendStats));