@Override
 public Builder<P> configure(OperationContext context, ModelNode model)
     throws OperationFailedException {
   this.module =
       ModelNodes.asModuleIdentifier(MODULE.getDefinition().resolveModelAttribute(context, model));
   String binding =
       ModelNodes.asString(SOCKET_BINDING.getDefinition().resolveModelAttribute(context, model));
   if (binding != null) {
     this.socketBinding =
         new InjectedValueDependency<>(
             SocketBinding.JBOSS_BINDING_NAME.append(binding), SocketBinding.class);
   }
   for (Property property :
       ModelNodes.asPropertyList(
           PROPERTIES.getDefinition().resolveModelAttribute(context, model))) {
     this.properties.put(property.getName(), property.getValue().asString());
   }
   return this;
 }
  @Override
  public Builder<Configuration> configure(OperationContext context, ModelNode model)
      throws OperationFailedException {
    this.module =
        ModelNodes.asModuleIdentifier(MODULE.getDefinition().resolveModelAttribute(context, model));

    boolean enabled =
        STATISTICS_ENABLED.getDefinition().resolveModelAttribute(context, model).asBoolean();
    this.statistics =
        new ConfigurationBuilder().jmxStatistics().enabled(enabled).available(enabled).create();

    return this;
  }
Example #3
0
 @Override
 public Builder<EvictionConfiguration> configure(ExpressionResolver resolver, ModelNode model)
     throws OperationFailedException {
   EvictionStrategy strategy =
       ModelNodes.asEnum(
           STRATEGY.getDefinition().resolveModelAttribute(resolver, model),
           EvictionStrategy.class);
   this.builder.strategy(strategy);
   this.builder.maxEntries(
       strategy.isEnabled()
           ? MAX_ENTRIES.getDefinition().resolveModelAttribute(resolver, model).asLong()
           : -1L);
   return this;
 }