if (connector != null && connector.getResourceAdapter() != null) { ManagementResourceRegistration cdefReg = raReg.getSubModel(PathAddress.pathAddress(PathElement.pathElement(Constants.CONNECTIONDEFINITIONS_NAME))); List<ConnectionFactory> connectionFactories = connector.getConnectionFactories(); if (connectionFactories != null) { // code reads that it won't be null but it's not documented, so... for (ConnectionFactory cf : connectionFactories) { List<AdminObject> adminObjects = connector.getAdminObjects(); if (adminObjects != null) { // code reads that it won't be null but it's not documented, so... ManagementResourceRegistration aoReg = raReg.getSubModel(PathAddress.pathAddress(PathElement.pathElement(Constants.ADMIN_OBJECTS_NAME)));
@Override protected boolean applyUpdateToRuntime(final OperationContext context, final ModelNode operation, final String parameterName, final ModelNode newValue, final ModelNode currentValue, final HandbackHolder<List<ConnectionManager>> handbackHolder) throws OperationFailedException { final String jndiName = context.readResource(PathAddress.EMPTY_ADDRESS).getModel().get(Constants.JNDINAME.getName()).asString(); final ServiceController<?> managementRepoService = context.getServiceRegistry(false).getService( ConnectorServices.MANAGEMENT_REPOSITORY_SERVICE); Boolean boolValue = Constants.ENLISTMENT_TRACE.resolveValue(context, newValue).asBoolean(); try { final ManagementRepository repository = (ManagementRepository) managementRepoService.getValue(); if (repository.getConnectors() != null) { List<ConnectionManager> handback = new LinkedList<>(); for (Connector connector : repository.getConnectors()) { for (ConnectionManager cm : connector.getConnectionManagers()) { if (jndiName.equalsIgnoreCase(cm.getUniqueId())) { cm.setEnlistmentTrace(boolValue); handback.add(cm); } } } handbackHolder.setHandback(handback); } } catch (Exception e) { throw new OperationFailedException(ConnectorLogger.ROOT_LOGGER.failedToSetAttribute(e.getLocalizedMessage())); } return false; }
String baseName = domain + ":deployment=" + mgtConnector.getUniqueId(); if (mgtConnector.getResourceAdapter() != null) org.jboss.jca.core.api.management.ResourceAdapter mgtRa = mgtConnector.getResourceAdapter(); mgtConnector.getConnectionFactories()) for (org.jboss.jca.core.api.management.AdminObject mgtAo : mgtConnector.getAdminObjects())
protected List<PoolConfiguration> getMatchingPoolConfigs(String poolName, ManagementRepository repository) { ArrayList<PoolConfiguration> result = new ArrayList<PoolConfiguration>(repository.getConnectors().size()); if (repository.getConnectors() != null) { for (Connector conn : repository.getConnectors()) { if (conn.getConnectionFactories() == null || conn.getConnectionFactories().get(0) == null || conn.getConnectionFactories().get(0).getPool() == null) continue; ConnectionFactory connectionFactory = conn.getConnectionFactories().get(0); if (poolName.equals(connectionFactory.getPool().getName())) { PoolConfiguration pc = conn.getConnectionFactories().get(0).getPoolConfiguration(); result.add(pc); } } } result.trimToSize(); return result; }
protected List<PoolConfiguration> getMatchingPoolConfigs(String jndiName, ManagementRepository repository) { ArrayList<PoolConfiguration> result = new ArrayList<PoolConfiguration>(repository.getConnectors().size()); if (repository.getConnectors() != null) { for (Connector conn : repository.getConnectors()) { if (jndiName.equalsIgnoreCase(conn.getUniqueId())) { if (conn.getConnectionFactories() == null || conn.getConnectionFactories().get(0) == null) continue; PoolConfiguration pc = conn.getConnectionFactories().get(0).getPoolConfiguration(); result.add(pc); } } } result.trimToSize(); return result; }
@Override public void start(StartContext context) throws StartException { ROOT_LOGGER.debugf("Starting ResourceAdapterStatusicService"); synchronized (this) { PathElement peExtendedStats = PathElement.pathElement(Constants.STATISTICS_NAME, "extended"); final CommonDeployment deploymentMD = deployment.getValue().getDeployment(); if (deploymentMD.getConnector() != null && deploymentMD.getConnector().getResourceAdapter() != null && deploymentMD.getConnector().getResourceAdapter().getStatistics() != null) { StatisticsPlugin raStats = deploymentMD.getConnector().getResourceAdapter().getStatistics(); raStats.setEnabled(statsEnabled); overrideRegistration.registerSubModel(new StatisticsResourceDefinition(peExtendedStats, CommonAttributes.RESOURCE_NAME, raStats)); } } }
@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)); } } } } } } }
public List<Pool> match(String jndiName, ManagementRepository repository) { ArrayList<Pool> result = new ArrayList<Pool>(repository.getConnectors().size()); if (repository.getConnectors() != null) { for (Connector c : repository.getConnectors()) { if (c.getConnectionFactories() == null || c.getConnectionFactories().size() == 0) continue; for (ConnectionFactory cf : c.getConnectionFactories()) { if (cf != null && cf.getPool() != null && jndiName.equalsIgnoreCase(cf.getJndiName())) { result.add(cf.getPool()); } } } } return result; } }
@Override public void start(StartContext context) throws StartException { ROOT_LOGGER.debugf("Starting ResourceAdapterStatusicService"); synchronized (this) { PathElement peExtendedStats = PathElement.pathElement(Constants.STATISTICS_NAME, "extended"); final CommonDeployment deploymentMD = deployment.getValue().getDeployment(); if (deploymentMD.getConnector() != null && deploymentMD.getConnector().getResourceAdapter() != null && deploymentMD.getConnector().getResourceAdapter().getStatistics() != null) { StatisticsPlugin raStats = deploymentMD.getConnector().getResourceAdapter().getStatistics(); raStats.setEnabled(statsEnabled); overrideRegistration.registerSubModel(new StatisticsResourceDefinition(peExtendedStats, CommonAttributes.RESOURCE_NAME, raStats)); } } }
@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 (connector != null && connector.getResourceAdapter() != null) { StatisticsPlugin raStats = connector.getResourceAdapter().getStatistics(); if (raStats != null) { raStats.setEnabled(statsEnabled); List<ConnectionFactory> connectionFactories = connector.getConnectionFactories(); if (connectionFactories != null) { for (ConnectionFactory cf : connectionFactories) { List<AdminObject> adminObjects = connector.getAdminObjects(); if (adminObjects != null) { PathAddress AO_ADDR = PathAddress.EMPTY_ADDRESS.append(Constants.ADMIN_OBJECTS_NAME);
PathElement peExtendedStats = PathElement.pathElement(Constants.STATISTICS_NAME, "extended"); if (deploymentMD.getConnector() != null && deploymentMD.getConnector().getConnectionFactories() != null) { for (ConnectionFactory cf : deploymentMD.getConnector().getConnectionFactories()) { if (cf.getManagedConnectionFactory() != null && cf.getManagedConnectionFactory().getStatistics() != null) { StatisticsPlugin extendStats = cf.getManagedConnectionFactory().getStatistics();
@Override protected boolean applyUpdateToRuntime(final OperationContext context, final ModelNode operation, final String parameterName, final ModelNode newValue, final ModelNode currentValue, final HandbackHolder<List<ConnectionManager>> handbackHolder) throws OperationFailedException { final String jndiName = context.readResource(PathAddress.EMPTY_ADDRESS).getModel().get(Constants.JNDINAME.getName()).asString(); final ServiceController<?> managementRepoService = context.getServiceRegistry(false).getService( ConnectorServices.MANAGEMENT_REPOSITORY_SERVICE); Boolean boolValue = Constants.ENLISTMENT_TRACE.resolveValue(context, newValue).asBoolean(); try { final ManagementRepository repository = (ManagementRepository) managementRepoService.getValue(); if (repository.getConnectors() != null) { List<ConnectionManager> handback = new LinkedList<>(); for (Connector connector : repository.getConnectors()) { for (ConnectionManager cm : connector.getConnectionManagers()) { if (jndiName.equalsIgnoreCase(cm.getUniqueId())) { cm.setEnlistmentTrace(boolValue); handback.add(cm); } } } handbackHolder.setHandback(handback); } } catch (Exception e) { throw new OperationFailedException(ConnectorLogger.ROOT_LOGGER.failedToSetAttribute(e.getLocalizedMessage())); } return false; }
if (connector != null && connector.getResourceAdapter() != null) { ManagementResourceRegistration cdefReg = raReg.getSubModel(PathAddress.pathAddress(PathElement.pathElement(Constants.CONNECTIONDEFINITIONS_NAME))); List<ConnectionFactory> connectionFactories = connector.getConnectionFactories(); if (connectionFactories != null) { // code reads that it won't be null but it's not documented, so... for (ConnectionFactory cf : connectionFactories) { List<AdminObject> adminObjects = connector.getAdminObjects(); if (adminObjects != null) { // code reads that it won't be null but it's not documented, so... ManagementResourceRegistration aoReg = raReg.getSubModel(PathAddress.pathAddress(PathElement.pathElement(Constants.ADMIN_OBJECTS_NAME)));
protected List<PoolConfiguration> getMatchingPoolConfigs(String poolName, ManagementRepository repository) { ArrayList<PoolConfiguration> result = new ArrayList<PoolConfiguration>(repository.getConnectors().size()); if (repository.getConnectors() != null) { for (Connector conn : repository.getConnectors()) { if (conn.getConnectionFactories() == null || conn.getConnectionFactories().get(0) == null || conn.getConnectionFactories().get(0).getPool() == null) continue; ConnectionFactory connectionFactory = conn.getConnectionFactories().get(0); if (poolName.equals(connectionFactory.getPool().getName())) { PoolConfiguration pc = conn.getConnectionFactories().get(0).getPoolConfiguration(); result.add(pc); } } } result.trimToSize(); return result; }
if (connector != null && connector.getResourceAdapter() != null) { StatisticsPlugin raStats = connector.getResourceAdapter().getStatistics(); if (raStats != null) { raStats.setEnabled(statsEnabled); List<ConnectionFactory> connectionFactories = connector.getConnectionFactories(); if (connectionFactories != null) { for (ConnectionFactory cf : connectionFactories) { List<AdminObject> adminObjects = connector.getAdminObjects(); if (adminObjects != null) { PathAddress AO_ADDR = PathAddress.EMPTY_ADDRESS.append(Constants.ADMIN_OBJECTS_NAME);
public List<Pool> match(String jndiName, ManagementRepository repository) { ArrayList<Pool> result = new ArrayList<Pool>(repository.getConnectors().size()); if (repository.getConnectors() != null) { for (Connector c : repository.getConnectors()) { if (c.getConnectionFactories() == null || c.getConnectionFactories().size() == 0) continue; for (ConnectionFactory cf : c.getConnectionFactories()) { if (cf != null && cf.getPool() != null && jndiName.equalsIgnoreCase(cf.getJndiName())) { result.add(cf.getPool()); } } } } return result; } }
public List<Pool> match(String jndiName, ManagementRepository repository) { ArrayList<Pool> result = new ArrayList<Pool>(repository.getConnectors().size()); if (repository.getConnectors() != null) { for (Connector c : repository.getConnectors()) { if (c.getConnectionFactories() == null || c.getConnectionFactories().size() == 0) continue; for (ConnectionFactory cf : c.getConnectionFactories()) { if (cf != null && cf.getPool() != null && jndiName.equalsIgnoreCase(cf.getJndiName())) { result.add(cf.getPool()); } } } } return result; } }
PathElement peExtendedStats = PathElement.pathElement(Constants.STATISTICS_NAME, "extended"); if (deploymentMD.getConnector() != null && deploymentMD.getConnector().getConnectionFactories() != null) { for (ConnectionFactory cf : deploymentMD.getConnector().getConnectionFactories()) { if (cf.getManagedConnectionFactory() != null && cf.getManagedConnectionFactory().getStatistics() != null) { StatisticsPlugin extendStats = cf.getManagedConnectionFactory().getStatistics();