Tabnine Logo
StrictMaxPoolResourceDefinition
Code IndexAdd Tabnine to your IDE (free)

How to use
StrictMaxPoolResourceDefinition
in
org.jboss.as.ejb3.subsystem

Best Java code snippets using org.jboss.as.ejb3.subsystem.StrictMaxPoolResourceDefinition (Showing top 4 results out of 315)

origin: wildfly/wildfly

@Override
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode strictMaxPoolModel) throws OperationFailedException {
  final String poolName = PathAddress.pathAddress(operation.get(ModelDescriptionConstants.ADDRESS)).getLastElement().getValue();
  final int maxPoolSize = StrictMaxPoolResourceDefinition.MAX_POOL_SIZE.resolveModelAttribute(context, strictMaxPoolModel).asInt();
  final Derive derive = StrictMaxPoolResourceDefinition.parseDeriveSize(context, strictMaxPoolModel);
  final long timeout = StrictMaxPoolResourceDefinition.INSTANCE_ACQUISITION_TIMEOUT.resolveModelAttribute(context, strictMaxPoolModel).asLong();
  final String unit = StrictMaxPoolResourceDefinition.INSTANCE_ACQUISITION_TIMEOUT_UNIT.resolveModelAttribute(context, strictMaxPoolModel).asString();
  // create and install the service
  final StrictMaxPoolConfigService poolConfigService = new StrictMaxPoolConfigService(poolName, maxPoolSize, derive, timeout, TimeUnit.valueOf(unit));
  final ServiceName serviceName = StrictMaxPoolConfigService.EJB_POOL_CONFIG_BASE_SERVICE_NAME.append(poolName);
  ServiceBuilder<StrictMaxPoolConfig> svcBuilder = context.getServiceTarget().addService(serviceName, poolConfigService);
  if (context.hasOptionalCapability(IO_MAX_THREADS_RUNTIME_CAPABILITY_NAME, null, null)) {
    ServiceName name = context.getCapabilityServiceName(IO_MAX_THREADS_RUNTIME_CAPABILITY_NAME, Integer.class);
    svcBuilder.addDependency(name, Integer.class, poolConfigService.getMaxThreadsInjector());
  }
  svcBuilder.install();
}
origin: org.jboss.as/jboss-as-ejb3

  static void registerTransformers_1_1_0(ResourceTransformationDescriptionBuilder parent) {
    parent.addChildResource(INSTANCE.getPathElement())
      .getAttributeBuilder()
      .addRejectCheck(RejectAttributeChecker.SIMPLE_EXPRESSIONS, INSTANCE_ACQUISITION_TIMEOUT_UNIT);
  }
}
origin: org.jboss.as/jboss-as-ejb3

EJB3RemoteResourceDefinition.registerTransformers_1_1_0(builder);
UnboundedQueueThreadPoolResourceDefinition.registerTransformers1_0(builder, EJB3SubsystemModel.THREAD_POOL);
StrictMaxPoolResourceDefinition.registerTransformers_1_1_0(builder);
FilePassivationStoreResourceDefinition.registerTransformers_1_1_0(builder);
ClusterPassivationStoreResourceDefinition.registerTransformers_1_1_0(builder);
origin: wildfly/wildfly

private void applyModelToRuntime(OperationContext context, ModelNode operation, String attributeName, ModelNode model) throws OperationFailedException {
  final String poolName = PathAddress.pathAddress(operation.get(ModelDescriptionConstants.OP_ADDR)).getLastElement().getValue();
  final ServiceName serviceName = StrictMaxPoolConfigService.EJB_POOL_CONFIG_BASE_SERVICE_NAME.append(poolName);
  final ServiceRegistry registry = context.getServiceRegistry(true);
  ServiceController<?> sc = registry.getService(serviceName);
  if (sc != null) {
    StrictMaxPoolConfigService smpc = (StrictMaxPoolConfigService) sc.getService();
    if (smpc != null) {
      if (StrictMaxPoolResourceDefinition.MAX_POOL_SIZE.getName().equals(attributeName)) {
        int maxPoolSize = StrictMaxPoolResourceDefinition.MAX_POOL_SIZE.resolveModelAttribute(context, model).asInt(-1);
        smpc.setMaxPoolSize(maxPoolSize);
      } else if (StrictMaxPoolResourceDefinition.DERIVE_SIZE.getName().equals(attributeName)) {
        StrictMaxPoolConfigService.Derive derive = StrictMaxPoolResourceDefinition.parseDeriveSize(context, model);
        smpc.setDerive(derive);
      } else if (StrictMaxPoolResourceDefinition.INSTANCE_ACQUISITION_TIMEOUT.getName().equals(attributeName)) {
        long timeout = StrictMaxPoolResourceDefinition.INSTANCE_ACQUISITION_TIMEOUT.resolveModelAttribute(context, model).asLong();
        smpc.setTimeout(timeout);
      } else if (StrictMaxPoolResourceDefinition.INSTANCE_ACQUISITION_TIMEOUT_UNIT.getName().equals(attributeName)) {
        String timeoutUnit = StrictMaxPoolResourceDefinition.INSTANCE_ACQUISITION_TIMEOUT_UNIT.resolveModelAttribute(context, model).asString();
        smpc.setTimeoutUnit(TimeUnit.valueOf(timeoutUnit));
      }
    }
  }
}
org.jboss.as.ejb3.subsystemStrictMaxPoolResourceDefinition

Javadoc

org.jboss.as.controller.ResourceDefinition for the strict-max-bean-pool resource.

Most used methods

  • getPathElement
  • parseDeriveSize
  • registerTransformers_1_1_0

Popular in Java

  • Making http requests using okhttp
  • scheduleAtFixedRate (Timer)
  • getExternalFilesDir (Context)
  • getContentResolver (Context)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • JFileChooser (javax.swing)
  • JTextField (javax.swing)
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • 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