use of org.jboss.as.ejb3.cache.distributable.DistributableCacheFactoryBuilder in project wildfly by wildfly.
the class PassivationStoreWriteHandler method applyModelToRuntime.
private void applyModelToRuntime(OperationContext context, ModelNode operation, String attributeName, ModelNode model) throws OperationFailedException {
String name = PathAddress.pathAddress(operation.get(ModelDescriptionConstants.OP_ADDR)).getLastElement().getValue();
ServiceName serviceName = DistributableCacheFactoryBuilderService.getServiceName(name);
ServiceRegistry registry = context.getServiceRegistry(true);
ServiceController<?> service = registry.getService(serviceName);
if (service != null) {
DistributableCacheFactoryBuilder<?, ?> builder = (DistributableCacheFactoryBuilder<?, ?>) service.getValue();
if (builder != null) {
if (this.maxSizeAttribute.getName().equals(attributeName)) {
int maxSize = this.maxSizeAttribute.resolveModelAttribute(context, model).asInt();
builder.getConfiguration().setMaxSize(maxSize);
}
}
}
}
Aggregations