enum DWmCapabilities {
    CHANNEL_FACTORY(
        RuntimeCapability.Builder.of("org.wildfly.connector.workmanager")
            .addRequirements(JGroupsDefaultRequirement.CHANNEL_FACTORY.getName())
            .build());

    private final RuntimeCapability<Void> capability;

    DWmCapabilities(RuntimeCapability<Void> capability) {
      this.capability = capability;
    }

    RuntimeCapability<Void> getRuntimeCapability() {
      return this.capability;
    }
  }
Exemplo n.º 2
0
  @Override
  protected void recordCapabilitiesAndRequirements(
      OperationContext context, ModelNode operation, Resource resource)
      throws OperationFailedException {
    super.recordCapabilitiesAndRequirements(context, operation, resource);

    ModelNode model = resource.getModel();
    if (CommonAttributes.JGROUPS_CHANNEL.resolveModelAttribute(context, model).isDefined()
        && !BroadcastGroupDefinition.JGROUPS_STACK
            .resolveModelAttribute(context, model)
            .isDefined()) {
      context.registerAdditionalCapabilityRequirement(
          JGroupsDefaultRequirement.CHANNEL_FACTORY.getName(),
          RuntimeCapability.buildDynamicCapabilityName(
              BroadcastGroupDefinition.CHANNEL_FACTORY_CAPABILITY.getName(),
              context.getCurrentAddressValue()),
          BroadcastGroupDefinition.JGROUPS_STACK.getName());
    }
  }