Tabnine Logo
ResourceBuilder$Factory
Code IndexAdd Tabnine to your IDE (free)

How to use
ResourceBuilder$Factory
in
org.jboss.as.controller

Best Java code snippets using org.jboss.as.controller.ResourceBuilder$Factory (Showing top 19 results out of 315)

origin: wildfly/wildfly

    registration.getSubModel(RA_ADDRESS).registerOverrideModel(deploymentName, OD_PROVIDER);
ResourceBuilder resourceBuilder = ResourceBuilder.Factory.create(EXTENDED_STATS,
    new StandardResourceDescriptionResolver(Constants.STATISTICS_NAME + "." + Constants.WORKMANAGER_NAME, CommonAttributes.RESOURCE_NAME, CommonAttributes.class.getClassLoader()));
origin: org.jboss.eap/wildfly-connector

    registration.getSubModel(RA_ADDRESS).registerOverrideModel(deploymentName, OD_PROVIDER);
ResourceBuilder resourceBuilder = ResourceBuilder.Factory.create(EXTENDED_STATS,
    new StandardResourceDescriptionResolver(Constants.STATISTICS_NAME + "." + Constants.WORKMANAGER_NAME, CommonAttributes.RESOURCE_NAME, CommonAttributes.class.getClassLoader()));
origin: org.wildfly/wildfly-webservices-server-integration

ResourceBuilder propertyResource = ResourceBuilder.Factory.create(PROPERTY_PATH, getResourceDescriptionResolver(Constants.PROPERTY))
    .setAddOperation(PropertyAdd.INSTANCE)
    .setRemoveOperation(ReloadRequiredRemoveStepHandler.INSTANCE)
ResourceBuilder handlerBuilder = ResourceBuilder.Factory.create(HANDLER_PATH, getResourceDescriptionResolver(HANDLER))
    .setAddOperation(HandlerAdd.INSTANCE)
    .setRemoveOperation(ReloadRequiredRemoveStepHandler.INSTANCE)
    .addReadWriteAttribute(Attributes.CLASS, null, new ReloadRequiredWriteAttributeHandler(Attributes.CLASS));
ResourceBuilder preHandler = ResourceBuilder.Factory.create(PRE_HANDLER_CHAIN_PATH, getResourceDescriptionResolver(Constants.PRE_HANDLER_CHAIN))
    .setAddOperation(HandlerChainAdd.INSTANCE)
    .setRemoveOperation(ReloadRequiredRemoveStepHandler.INSTANCE)
ResourceBuilder postHandler = ResourceBuilder.Factory.create(POST_HANDLER_CHAIN_PATH, getResourceDescriptionResolver(Constants.POST_HANDLER_CHAIN))
    .setAddOperation(HandlerChainAdd.INSTANCE)
    .setRemoveOperation(ReloadRequiredRemoveStepHandler.INSTANCE)
ResourceDefinition epConfigsDef = ResourceBuilder.Factory.create(ENDPOINT_CONFIG_PATH, getResourceDescriptionResolver(ENDPOINT_CONFIG))
    .setAddOperation(EndpointConfigAdd.INSTANCE)
    .setRemoveOperation(ReloadRequiredRemoveStepHandler.INSTANCE)
ResourceDefinition clConfigsDef = ResourceBuilder.Factory.create(CLIENT_CONFIG_PATH, getResourceDescriptionResolver(CLIENT_CONFIG))
   .setAddOperation(ClientConfigAdd.INSTANCE)
   .setRemoveOperation(ReloadRequiredRemoveStepHandler.INSTANCE)
ResourceDefinition subsystemResource = ResourceBuilder.Factory.createSubsystemRoot(SUBSYSTEM_PATH, getResourceDescriptionResolver(), WSSubsystemAdd.INSTANCE, WSSubsystemRemove.INSTANCE)
    .addReadWriteAttribute(Attributes.WSDL_HOST, null, new WSServerConfigAttributeHandler(Attributes.WSDL_HOST))
    .addReadWriteAttribute(Attributes.WSDL_PORT, null, new WSServerConfigAttributeHandler(Attributes.WSDL_PORT))
origin: org.jboss.eap/wildfly-webservices-server-integration

ResourceBuilder propertyResource = ResourceBuilder.Factory.create(PROPERTY_PATH, getResourceDescriptionResolver(Constants.PROPERTY))
    .setAddOperation(PropertyAdd.INSTANCE)
    .setRemoveOperation(ReloadRequiredRemoveStepHandler.INSTANCE)
ResourceBuilder handlerBuilder = ResourceBuilder.Factory.create(HANDLER_PATH, getResourceDescriptionResolver(HANDLER))
    .setAddOperation(HandlerAdd.INSTANCE)
    .setRemoveOperation(ReloadRequiredRemoveStepHandler.INSTANCE)
    .addReadWriteAttribute(Attributes.CLASS, null, new ReloadRequiredWriteAttributeHandler(Attributes.CLASS));
ResourceBuilder preHandler = ResourceBuilder.Factory.create(PRE_HANDLER_CHAIN_PATH, getResourceDescriptionResolver(Constants.PRE_HANDLER_CHAIN))
    .setAddOperation(HandlerChainAdd.INSTANCE)
    .setRemoveOperation(ReloadRequiredRemoveStepHandler.INSTANCE)
ResourceBuilder postHandler = ResourceBuilder.Factory.create(POST_HANDLER_CHAIN_PATH, getResourceDescriptionResolver(Constants.POST_HANDLER_CHAIN))
    .setAddOperation(HandlerChainAdd.INSTANCE)
    .setRemoveOperation(ReloadRequiredRemoveStepHandler.INSTANCE)
ResourceDefinition epConfigsDef = ResourceBuilder.Factory.create(ENDPOINT_CONFIG_PATH, getResourceDescriptionResolver(ENDPOINT_CONFIG))
    .setAddOperation(EndpointConfigAdd.INSTANCE)
    .setRemoveOperation(ReloadRequiredRemoveStepHandler.INSTANCE)
ResourceDefinition clConfigsDef = ResourceBuilder.Factory.create(CLIENT_CONFIG_PATH, getResourceDescriptionResolver(CLIENT_CONFIG))
   .setAddOperation(ClientConfigAdd.INSTANCE)
   .setRemoveOperation(ReloadRequiredRemoveStepHandler.INSTANCE)
ResourceDefinition subsystemResource = ResourceBuilder.Factory.createSubsystemRoot(SUBSYSTEM_PATH, getResourceDescriptionResolver(), WSSubsystemAdd.INSTANCE, WSSubsystemRemove.INSTANCE)
    .addReadWriteAttribute(Attributes.WSDL_HOST, null, new WSServerConfigAttributeHandler(Attributes.WSDL_HOST))
    .addReadWriteAttribute(Attributes.WSDL_PORT, null, new WSServerConfigAttributeHandler(Attributes.WSDL_PORT))
origin: jboss-switchyard/release

subsystem.registerXMLElementWriter(SwitchYardSubsystemWriter.getInstance());
ResourceBuilder securityConfigsResource = ResourceBuilder.Factory.create(SECURITY_CONFIG_PATH, getResourceDescriptionResolver(SECURITY_CONFIG))
    .setAddOperation(SwitchYardSecurityConfigAdd.INSTANCE)
    .setRemoveOperation(SwitchYardSecurityConfigRemove.INSTANCE)
    .addReadWriteAttribute(Attributes.PROPERTIES, null, new ReloadRequiredWriteAttributeHandler(Attributes.PROPERTIES));
ResourceBuilder modulesResource = ResourceBuilder.Factory.create(MODULE_PATH, getResourceDescriptionResolver(MODULE))
    .setAddOperation(SwitchYardModuleAdd.INSTANCE)
    .setRemoveOperation(SwitchYardModuleRemove.INSTANCE)
    .addReadWriteAttribute(Attributes.PROPERTIES, null, new ReloadRequiredWriteAttributeHandler(Attributes.PROPERTIES));
ResourceBuilder extensionsResource = ResourceBuilder.Factory.create(EXTENSION_PATH, getResourceDescriptionResolver(EXTENSION))
    .setAddOperation(SwitchYardExtensionAdd.INSTANCE)
    .setRemoveOperation(SwitchYardExtensionRemove.INSTANCE)
    .addReadWriteAttribute(Attributes.IDENTIFIER, null, new ReloadRequiredWriteAttributeHandler(Attributes.IDENTIFIER));
ResourceDefinition subsystemResource = ResourceBuilder.Factory.createSubsystemRoot(SUBSYSTEM_PATH, getResourceDescriptionResolver(), SwitchYardSubsystemAdd.INSTANCE, SwitchYardSubsystemRemove.INSTANCE)
    .addReadWriteAttribute(Attributes.SOCKET_BINDING, null, new ReloadRequiredWriteAttributeHandler(Attributes.SOCKET_BINDING))
    .addReadWriteAttribute(Attributes.PROPERTIES, null, new ReloadRequiredWriteAttributeHandler(Attributes.PROPERTIES))
origin: org.jboss.as/jboss-as-webservices-server-integration

subsystem.registerXMLElementWriter(WSSubsystemWriter.getInstance());
ResourceBuilder propertyResource = ResourceBuilder.Factory.create(PROPERTY_PATH, getResourceDescriptionResolver(Constants.PROPERTY))
    .setAddOperation(PropertyAdd.INSTANCE)
    .setRemoveOperation(PropertyRemove.INSTANCE)
ResourceBuilder handlerBuilder = ResourceBuilder.Factory.create(HANDLER_PATH, getResourceDescriptionResolver("handler"))
    .setAddOperation(HandlerAdd.INSTANCE)
    .setRemoveOperation(HandlerRemove.INSTANCE)
    .addReadWriteAttribute(Attributes.CLASS, null, new ReloadRequiredWriteAttributeHandler(Attributes.CLASS));
ResourceBuilder preHandler = ResourceBuilder.Factory.create(PRE_HANDLER_CHAIN_PATH, getResourceDescriptionResolver(Constants.PRE_HANDLER_CHAIN))
    .setAddOperation(HandlerChainAdd.INSTANCE)
    .setRemoveOperation(HandlerChainRemove.INSTANCE)
    .pushChild(handlerBuilder).pop();
ResourceBuilder postHandler = ResourceBuilder.Factory.create(POST_HANDLER_CHAIN_PATH, getResourceDescriptionResolver(Constants.POST_HANDLER_CHAIN))
    .setAddOperation(HandlerChainAdd.INSTANCE)
    .setRemoveOperation(HandlerChainRemove.INSTANCE)
ResourceDefinition subsystemResource = ResourceBuilder.Factory.createSubsystemRoot(SUBSYSTEM_PATH, getResourceDescriptionResolver(), WSSubsystemAdd.INSTANCE, WSSubsystemRemove.INSTANCE)
    .addReadWriteAttribute(Attributes.WSDL_HOST, null, new WSSubsystemAttributeChangeHandler(Attributes.WSDL_HOST))
    .addReadWriteAttribute(Attributes.WSDL_PORT, null, new WSSubsystemAttributeChangeHandler(Attributes.WSDL_PORT))
  subsystem.registerDeploymentModel(ResourceBuilder.Factory.create(SUBSYSTEM_PATH, getResourceDescriptionResolver("deployment"))
      .pushChild(ENDPOINT_PATH)
      .addMetrics(WSEndpointMetrics.INSTANCE, WSEndpointMetrics.ATTRIBUTES).build());
origin: org.switchyard/switchyard-deploy-jboss-as7

subsystem.registerXMLElementWriter(SwitchYardSubsystemWriter.getInstance());
ResourceBuilder securityConfigsResource = ResourceBuilder.Factory.create(SECURITY_CONFIG_PATH, getResourceDescriptionResolver(SECURITY_CONFIG))
    .setAddOperation(SwitchYardSecurityConfigAdd.INSTANCE)
    .setRemoveOperation(SwitchYardSecurityConfigRemove.INSTANCE)
    .addReadWriteAttribute(Attributes.PROPERTIES, null, new ReloadRequiredWriteAttributeHandler(Attributes.PROPERTIES));
ResourceBuilder modulesResource = ResourceBuilder.Factory.create(MODULE_PATH, getResourceDescriptionResolver(MODULE))
    .setAddOperation(SwitchYardModuleAdd.INSTANCE)
    .setRemoveOperation(SwitchYardModuleRemove.INSTANCE)
    .addReadWriteAttribute(Attributes.PROPERTIES, null, new ReloadRequiredWriteAttributeHandler(Attributes.PROPERTIES));
ResourceBuilder extensionsResource = ResourceBuilder.Factory.create(EXTENSION_PATH, getResourceDescriptionResolver(EXTENSION))
    .setAddOperation(SwitchYardExtensionAdd.INSTANCE)
    .setRemoveOperation(SwitchYardExtensionRemove.INSTANCE)
    .addReadWriteAttribute(Attributes.IDENTIFIER, null, new ReloadRequiredWriteAttributeHandler(Attributes.IDENTIFIER));
ResourceDefinition subsystemResource = ResourceBuilder.Factory.createSubsystemRoot(SUBSYSTEM_PATH, getResourceDescriptionResolver(), SwitchYardSubsystemAdd.INSTANCE, SwitchYardSubsystemRemove.INSTANCE)
    .addReadWriteAttribute(Attributes.SOCKET_BINDING, null, new ReloadRequiredWriteAttributeHandler(Attributes.SOCKET_BINDING))
    .addReadWriteAttribute(Attributes.PROPERTIES, null, new ReloadRequiredWriteAttributeHandler(Attributes.PROPERTIES))
origin: org.jboss.eap/wildfly-connector

@Override
public void start(StartContext context) throws StartException {
  synchronized (this) {
    DistributedWorkManager dwm = distributedWorkManager.getValue();
    dwm.setDistributedStatisticsEnabled(statsEnabled);
    if (dwm.getDistributedStatistics() != null) {
      PathElement peDistributedWm = PathElement.pathElement(Constants.STATISTICS_NAME, "distributed");
      ResourceBuilder resourceBuilder = ResourceBuilder.Factory.create(peDistributedWm,
          new StandardResourceDescriptionResolver(Constants.STATISTICS_NAME + "." + Constants.WORKMANAGER_NAME, CommonAttributes.RESOURCE_NAME, CommonAttributes.class.getClassLoader()));
      ManagementResourceRegistration dwmSubRegistration = overrideRegistration.registerSubModel(resourceBuilder.build());
      OperationStepHandler metricHandler = new WorkManagerRuntimeAttributeReadHandler(dwm, dwm.getDistributedStatistics(), false);
      for (SimpleAttributeDefinition metric : Constants.WORKMANAGER_METRICS) {
        dwmSubRegistration.registerMetric(metric, metricHandler);
      }
      OperationStepHandler readHandler = new WorkManagerRuntimeAttributeReadHandler(dwm, dwm.getDistributedStatistics(), false);
      OperationStepHandler writeHandler = new WorkManagerRuntimeAttributeWriteHandler(dwm, false, Constants.DISTRIBUTED_WORKMANAGER_RW_ATTRIBUTES);
      for (SimpleAttributeDefinition attribute : Constants.DISTRIBUTED_WORKMANAGER_RW_ATTRIBUTES) {
        dwmSubRegistration.registerReadWriteAttribute(attribute, readHandler, writeHandler);
      }
      dwmSubRegistration.registerOperationHandler(ClearWorkManagerStatisticsHandler.DEFINITION, new ClearWorkManagerStatisticsHandler(dwm));
    }
  }
}
origin: org.jboss.eap/wildfly-connector

@Override
public void start(StartContext context) throws StartException {
  synchronized (this) {
    WorkManager wm = workManager.getValue();
    wm.setStatisticsEnabled(statsEnabled);
    if (wm.getStatistics() != null) {
      PathElement peLocaldWm = PathElement.pathElement(Constants.STATISTICS_NAME, "local");
      ResourceBuilder resourceBuilder = ResourceBuilder.Factory.create(peLocaldWm,
          new StandardResourceDescriptionResolver(Constants.STATISTICS_NAME + "." + Constants.WORKMANAGER_NAME, CommonAttributes.RESOURCE_NAME, CommonAttributes.class.getClassLoader()));
      ManagementResourceRegistration wmSubRegistration = overrideRegistration.registerSubModel(resourceBuilder.build());
      OperationStepHandler metricHandler = new WorkManagerRuntimeAttributeReadHandler(wm, wm.getStatistics(), false);
      for (SimpleAttributeDefinition metric : Constants.WORKMANAGER_METRICS) {
        wmSubRegistration.registerMetric(metric, metricHandler);
      }
      OperationStepHandler readHandler = new WorkManagerRuntimeAttributeReadHandler(wm, wm.getStatistics(), false);
      OperationStepHandler writeHandler = new WorkManagerRuntimeAttributeWriteHandler(wm, false, Constants.WORKMANAGER_RW_ATTRIBUTES);
      for (SimpleAttributeDefinition attribute : Constants.WORKMANAGER_RW_ATTRIBUTES) {
        wmSubRegistration.registerReadWriteAttribute(attribute, readHandler, writeHandler);
      }
      wmSubRegistration.registerOperationHandler(ClearWorkManagerStatisticsHandler.DEFINITION, new ClearWorkManagerStatisticsHandler(wm));
    }
  }
}
origin: org.jboss.eap/wildfly-clustering-jgroups-extension

private ResourceDefinition createProtocolResourceDefinition(String protocolName, Class<? extends Protocol> protocolClass) {
  SimpleResourceDescriptionResolver resolver = new SimpleResourceDescriptionResolver(protocolName, protocolClass.getSimpleName());
  ResourceBuilder builder = ResourceBuilder.Factory.create(ProtocolResourceDefinition.pathElement(protocolName), resolver).setRuntime();
  ProtocolMetricsHandler handler = new ProtocolMetricsHandler(this);
  for (Map.Entry<String, Attribute> entry: ProtocolMetricsHandler.findProtocolAttributes(protocolClass).entrySet()) {
    String name = entry.getKey();
    Attribute attribute = entry.getValue();
    FieldType type = FieldType.valueOf(attribute.getType());
    resolver.addDescription(name, attribute.getDescription());
    builder.addMetric(new SimpleAttributeDefinitionBuilder(name, type.getModelType(), true).setStorageRuntime().build(), handler);
  }
  return builder.build();
}
origin: wildfly/wildfly-core

  public static ResourceBuilder createSubsystemRoot(PathElement pathElement,
                           StandardResourceDescriptionResolver resolver,
                           OperationStepHandler addHandler,
                           OperationStepHandler removeHandler,
                           OperationStepHandler describeHandler) {
    ResourceBuilder builder = ResourceBuilderRoot.create(pathElement, resolver, addHandler, removeHandler);
    builder.addOperation(GenericSubsystemDescribeHandler.DEFINITION, describeHandler); //operation description is always the same
    return builder;
  }
}
origin: org.infinispan.server/infinispan-server-jgroups

private ResourceDefinition createProtocolResourceDefinition(String protocolName, Class<? extends Protocol> protocolClass) {
  SimpleResourceDescriptionResolver resolver = new SimpleResourceDescriptionResolver(protocolName, protocolClass.getSimpleName());
  ResourceBuilder builder = ResourceBuilder.Factory.create(ProtocolResourceDefinition.pathElement(protocolName), resolver);
  ProtocolMetricsHandler handler = new ProtocolMetricsHandler(this);
  for (Map.Entry<String, Attribute> entry: ProtocolMetricsHandler.findProtocolAttributes(protocolClass).entrySet()) {
    String name = entry.getKey();
    Attribute attribute = entry.getValue();
    FieldType type = FieldType.valueOf(attribute.getType());
    resolver.addDescription(name, attribute.getDescription());
    builder.addMetric(new SimpleAttributeDefinitionBuilder(name, type.getModelType()).setStorageRuntime().build(), handler);
  }
  return builder.build();
}
origin: org.wildfly.core/wildfly-controller

  public static ResourceBuilder createSubsystemRoot(PathElement pathElement,
                           StandardResourceDescriptionResolver resolver,
                           OperationStepHandler addHandler,
                           OperationStepHandler removeHandler,
                           OperationStepHandler describeHandler) {
    ResourceBuilder builder = ResourceBuilderRoot.create(pathElement, resolver, addHandler, removeHandler);
    builder.addOperation(GenericSubsystemDescribeHandler.DEFINITION, describeHandler); //operation description is always the same
    return builder;
  }
}
origin: org.jboss.as/jboss-as-controller

  public static ResourceBuilder createSubsystemRoot(PathElement pathElement,
                           StandardResourceDescriptionResolver resolver,
                           OperationStepHandler addHandler,
                           OperationStepHandler removeHandler,
                           OperationStepHandler describeHandler) {
    ResourceBuilder builder = ResourceBuilderRoot.create(pathElement, resolver, addHandler, removeHandler);
    builder.addOperation(GenericSubsystemDescribeHandler.DEFINITION, describeHandler); //operation description is always the same
    return builder;
  }
}
origin: org.wildfly/wildfly-controller

  public static ResourceBuilder createSubsystemRoot(PathElement pathElement,
                           StandardResourceDescriptionResolver resolver,
                           OperationStepHandler addHandler,
                           OperationStepHandler removeHandler,
                           OperationStepHandler describeHandler) {
    ResourceBuilder builder = ResourceBuilderRoot.create(pathElement, resolver, addHandler, removeHandler);
    builder.addOperation(GenericSubsystemDescribeHandler.DEFINITION, describeHandler); //operation description is always the same
    return builder;
  }
}
origin: camunda/camunda-bpm-platform

public void initialize(ExtensionContext context) {
 // Register the subsystem and operation handlers
 SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, BPM_PLATFORM_SUBSYSTEM_MAJOR_VERSION, BPM_PLATFORM_SUBSYSTEM_MINOR_VERSION);
 subsystem.registerXMLElementWriter(parser);
 // build resource definitions
 ResourceBuilder processEnginesResource = ResourceBuilder.Factory.create(PROCESS_ENGINES_PATH, getResourceDescriptionResolver(ModelConstants.PROCESS_ENGINES))
  .setAddOperation(ProcessEngineAdd.INSTANCE)
  .setRemoveOperation(ProcessEngineRemove.INSTANCE);
 ResourceBuilder jobAcquisitionResource = ResourceBuilder.Factory.create(JOB_ACQUISTIONS_PATH, getResourceDescriptionResolver(ModelConstants.JOB_ACQUISITIONS))
   .setAddOperation(JobAcquisitionAdd.INSTANCE)
   .setRemoveOperation(JobAcquisitionRemove.INSTANCE);
 ResourceBuilder jobExecutorResource = ResourceBuilder.Factory.create(JOB_EXECUTOR_PATH, getResourceDescriptionResolver(ModelConstants.JOB_EXECUTOR))
  .setAddOperation(JobExecutorAdd.INSTANCE)
  .setRemoveOperation(JobExecutorRemove.INSTANCE)
  .pushChild(jobAcquisitionResource).pop();
 ResourceDefinition subsystemResource = ResourceBuilder.Factory.createSubsystemRoot(SUBSYSTEM_PATH, getResourceDescriptionResolver(SUBSYSTEM_NAME), BpmPlatformSubsystemAdd.INSTANCE, BpmPlatformSubsystemRemove.INSTANCE)
  .pushChild(processEnginesResource).pop()
  .pushChild(jobExecutorResource).pop()
  .build();
 subsystem.registerSubsystemModel(subsystemResource);
}
origin: wildfly/wildfly

@Override
public void start(StartContext context) throws StartException {
  synchronized (this) {
    WorkManager wm = workManager.getValue();
    wm.setStatisticsEnabled(statsEnabled);
    if (wm.getStatistics() != null) {
      PathElement peLocaldWm = PathElement.pathElement(Constants.STATISTICS_NAME, "local");
      ResourceBuilder resourceBuilder = ResourceBuilder.Factory.create(peLocaldWm,
          new StandardResourceDescriptionResolver(Constants.STATISTICS_NAME + "." + Constants.WORKMANAGER_NAME, CommonAttributes.RESOURCE_NAME, CommonAttributes.class.getClassLoader()));
      ManagementResourceRegistration wmSubRegistration = overrideRegistration.registerSubModel(resourceBuilder.build());
      OperationStepHandler metricHandler = new WorkManagerRuntimeAttributeReadHandler(wm, wm.getStatistics(), false);
      for (SimpleAttributeDefinition metric : Constants.WORKMANAGER_METRICS) {
        wmSubRegistration.registerMetric(metric, metricHandler);
      }
      OperationStepHandler readHandler = new WorkManagerRuntimeAttributeReadHandler(wm, wm.getStatistics(), false);
      OperationStepHandler writeHandler = new WorkManagerRuntimeAttributeWriteHandler(wm, false, Constants.WORKMANAGER_RW_ATTRIBUTES);
      for (SimpleAttributeDefinition attribute : Constants.WORKMANAGER_RW_ATTRIBUTES) {
        wmSubRegistration.registerReadWriteAttribute(attribute, readHandler, writeHandler);
      }
      wmSubRegistration.registerOperationHandler(ClearWorkManagerStatisticsHandler.DEFINITION, new ClearWorkManagerStatisticsHandler(wm));
    }
  }
}
origin: wildfly/wildfly

@Override
public void start(StartContext context) throws StartException {
  synchronized (this) {
    DistributedWorkManager dwm = distributedWorkManager.getValue();
    dwm.setDistributedStatisticsEnabled(statsEnabled);
    if (dwm.getDistributedStatistics() != null) {
      PathElement peDistributedWm = PathElement.pathElement(Constants.STATISTICS_NAME, "distributed");
      ResourceBuilder resourceBuilder = ResourceBuilder.Factory.create(peDistributedWm,
          new StandardResourceDescriptionResolver(Constants.STATISTICS_NAME + "." + Constants.WORKMANAGER_NAME, CommonAttributes.RESOURCE_NAME, CommonAttributes.class.getClassLoader()));
      ManagementResourceRegistration dwmSubRegistration = overrideRegistration.registerSubModel(resourceBuilder.build());
      OperationStepHandler metricHandler = new WorkManagerRuntimeAttributeReadHandler(dwm, dwm.getDistributedStatistics(), false);
      for (SimpleAttributeDefinition metric : Constants.WORKMANAGER_METRICS) {
        dwmSubRegistration.registerMetric(metric, metricHandler);
      }
      OperationStepHandler readHandler = new WorkManagerRuntimeAttributeReadHandler(dwm, dwm.getDistributedStatistics(), false);
      OperationStepHandler writeHandler = new WorkManagerRuntimeAttributeWriteHandler(dwm, false, Constants.DISTRIBUTED_WORKMANAGER_RW_ATTRIBUTES);
      for (SimpleAttributeDefinition attribute : Constants.DISTRIBUTED_WORKMANAGER_RW_ATTRIBUTES) {
        dwmSubRegistration.registerReadWriteAttribute(attribute, readHandler, writeHandler);
      }
      dwmSubRegistration.registerOperationHandler(ClearWorkManagerStatisticsHandler.DEFINITION, new ClearWorkManagerStatisticsHandler(dwm));
    }
  }
}
origin: wildfly/wildfly

private ResourceDefinition createProtocolResourceDefinition(String protocolName, Class<? extends Protocol> protocolClass) {
  SimpleResourceDescriptionResolver resolver = new SimpleResourceDescriptionResolver(protocolName, protocolClass.getSimpleName());
  ResourceBuilder builder = ResourceBuilder.Factory.create(ProtocolResourceDefinition.pathElement(protocolName), resolver).setRuntime();
  ProtocolMetricsHandler handler = new ProtocolMetricsHandler(this);
  for (Map.Entry<String, Attribute> entry: ProtocolMetricsHandler.findProtocolAttributes(protocolClass).entrySet()) {
    String name = entry.getKey();
    Attribute attribute = entry.getValue();
    FieldType type = FieldType.valueOf(attribute.getType());
    resolver.addDescription(name, attribute.getDescription());
    builder.addMetric(new SimpleAttributeDefinitionBuilder(name, type.getModelType(), true).setStorageRuntime().build(), handler);
  }
  return builder.build();
}
org.jboss.as.controllerResourceBuilder$Factory

Most used methods

  • create
  • createSubsystemRoot

Popular in Java

  • Making http requests using okhttp
  • onRequestPermissionsResult (Fragment)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • onCreateOptionsMenu (Activity)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now