use of org.jboss.as.controller.PathAddress in project wildfly by wildfly.
the class LockingMetricExecutor method execute.
@Override
public ModelNode execute(OperationContext context, Metric<DefaultLockManager> metric) throws OperationFailedException {
PathAddress cacheAddress = context.getCurrentAddress().getParent();
String containerName = cacheAddress.getParent().getLastElement().getValue();
String cacheName = cacheAddress.getLastElement().getValue();
Cache<?, ?> cache = ServiceContainerHelper.findValue(context.getServiceRegistry(false), InfinispanCacheRequirement.CACHE.getServiceName(context, containerName, cacheName));
return (cache != null) ? metric.execute((DefaultLockManager) cache.getAdvancedCache().getLockManager()) : null;
}
use of org.jboss.as.controller.PathAddress in project wildfly by wildfly.
the class PartitionHandlingMetricExecutor method execute.
@Override
public ModelNode execute(OperationContext context, Metric<AdvancedCache<?, ?>> metric) throws OperationFailedException {
PathAddress cacheAddress = context.getCurrentAddress().getParent();
String containerName = cacheAddress.getParent().getLastElement().getValue();
String cacheName = cacheAddress.getLastElement().getValue();
Cache<?, ?> cache = ServiceContainerHelper.findValue(context.getServiceRegistry(false), InfinispanCacheRequirement.CACHE.getServiceName(context, containerName, cacheName));
return (cache != null) ? metric.execute(cache.getAdvancedCache()) : null;
}
use of org.jboss.as.controller.PathAddress in project wildfly by wildfly.
the class ClusteredCacheMetricExecutor method execute.
@Override
public ModelNode execute(OperationContext context, Metric<RpcManagerImpl> metric) throws OperationFailedException {
PathAddress address = context.getCurrentAddress();
String containerName = address.getParent().getLastElement().getValue();
String cacheName = address.getLastElement().getValue();
Cache<?, ?> cache = ServiceContainerHelper.findValue(context.getServiceRegistry(false), InfinispanCacheRequirement.CACHE.getServiceName(context, containerName, cacheName));
return (cache != null) ? metric.execute((RpcManagerImpl) cache.getAdvancedCache().getRpcManager()) : null;
}
use of org.jboss.as.controller.PathAddress in project wildfly by wildfly.
the class InfinispanSubsystemXMLReader method parseThreadPool.
private void parseThreadPool(ThreadPoolResourceDefinition pool, XMLExtendedStreamReader reader, PathAddress parentAddress, Map<PathAddress, ModelNode> operations) throws XMLStreamException {
PathAddress address = parentAddress.append(pool.getPathElement());
ModelNode operation = Util.createAddOperation(address);
operations.put(address, operation);
for (int i = 0; i < reader.getAttributeCount(); i++) {
XMLAttribute attribute = XMLAttribute.forName(reader.getAttributeLocalName(i));
switch(attribute) {
case MIN_THREADS:
{
readAttribute(reader, i, operation, pool.getMinThreads());
break;
}
case MAX_THREADS:
{
readAttribute(reader, i, operation, pool.getMaxThreads());
break;
}
case QUEUE_LENGTH:
{
readAttribute(reader, i, operation, pool.getQueueLength());
break;
}
case KEEPALIVE_TIME:
{
readAttribute(reader, i, operation, pool.getKeepAliveTime());
break;
}
default:
{
throw ParseUtils.unexpectedAttribute(reader, i);
}
}
}
ParseUtils.requireNoContent(reader);
}
use of org.jboss.as.controller.PathAddress in project wildfly by wildfly.
the class CmpKeyGeneratorSubsystem11TestCase method assertOperation.
private void assertOperation(final ModelNode operation, final String operationName, final PathElement lastElement) {
assertEquals(operationName, operation.get(OP).asString());
final PathAddress addr = PathAddress.pathAddress(operation.get(OP_ADDR));
final PathElement element = addr.getLastElement();
assertEquals(lastElement.getKey(), element.getKey());
assertEquals(lastElement.getValue(), element.getValue());
}
Aggregations