congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
ThreadMXBeanAttributeHandler.unknownAttribute
Code IndexAdd Tabnine to your IDE (free)

How to use
unknownAttribute
method
in
org.jboss.as.platform.mbean.ThreadMXBeanAttributeHandler

Best Java code snippets using org.jboss.as.platform.mbean.ThreadMXBeanAttributeHandler.unknownAttribute (Showing top 6 results out of 315)

origin: org.wildfly.core/wildfly-platform-mbean

@Override
protected void executeReadAttribute(OperationContext context, ModelNode operation) throws OperationFailedException {
  final String name = operation.require(ModelDescriptionConstants.NAME).asString();
  try {
    if ((PlatformMBeanConstants.OBJECT_NAME.getName().equals(name))
        || ThreadResourceDefinition.THREADING_READ_ATTRIBUTES.contains(name)
        || ThreadResourceDefinition.THREADING_READ_WRITE_ATTRIBUTES.contains(name)
        || ThreadResourceDefinition.THREADING_METRICS.contains(name)) {
      storeResult(name, context.getResult());
    } else {
      // Shouldn't happen; the global handler should reject
      throw unknownAttribute(operation);
    }
  } catch (SecurityException | UnsupportedOperationException e) {
    throw new OperationFailedException(e.toString());
  }
}
origin: org.jboss.as/jboss-as-platform-mbean

@Override
protected void executeReadAttribute(OperationContext context, ModelNode operation) throws OperationFailedException {
  final String name = operation.require(ModelDescriptionConstants.NAME).asString();
  try {
    if ((PlatformMBeanUtil.JVM_MAJOR_VERSION > 6 && PlatformMBeanConstants.OBJECT_NAME.equals(name))
        || PlatformMBeanConstants.THREADING_READ_ATTRIBUTES.contains(name)
        || PlatformMBeanConstants.THREADING_READ_WRITE_ATTRIBUTES.contains(name)
        || PlatformMBeanConstants.THREADING_METRICS.contains(name)) {
      storeResult(name, context.getResult());
    } else {
      // Shouldn't happen; the global handler should reject
      throw unknownAttribute(operation);
    }
  } catch (SecurityException e) {
    throw new OperationFailedException(new ModelNode().set(e.toString()));
  } catch (UnsupportedOperationException e) {
    throw new OperationFailedException(new ModelNode().set(e.toString()));
  }
}
origin: wildfly/wildfly-core

@Override
protected void executeReadAttribute(OperationContext context, ModelNode operation) throws OperationFailedException {
  final String name = operation.require(ModelDescriptionConstants.NAME).asString();
  try {
    if ((PlatformMBeanConstants.OBJECT_NAME.getName().equals(name))
        || ThreadResourceDefinition.THREADING_READ_ATTRIBUTES.contains(name)
        || ThreadResourceDefinition.THREADING_READ_WRITE_ATTRIBUTES.contains(name)
        || ThreadResourceDefinition.THREADING_METRICS.contains(name)) {
      storeResult(name, context.getResult());
    } else {
      // Shouldn't happen; the global handler should reject
      throw unknownAttribute(operation);
    }
  } catch (SecurityException | UnsupportedOperationException e) {
    throw new OperationFailedException(e.toString());
  }
}
origin: org.jboss.as/jboss-as-platform-mbean

@Override
protected void executeWriteAttribute(OperationContext context, ModelNode operation) throws OperationFailedException {
  final String name = operation.require(ModelDescriptionConstants.NAME).asString();
  try {
    if (PlatformMBeanConstants.THREAD_CONTENTION_MONITORING_ENABLED.equals(name)) {
      enabledValidator.validate(operation);
      ManagementFactory.getThreadMXBean().setThreadContentionMonitoringEnabled(operation.require(ModelDescriptionConstants.VALUE).asBoolean());
    } else if (PlatformMBeanConstants.THREAD_CPU_TIME_ENABLED.equals(name)) {
      enabledValidator.validate(operation);
      ManagementFactory.getThreadMXBean().setThreadCpuTimeEnabled(operation.require(ModelDescriptionConstants.VALUE).asBoolean());
    } else if (PlatformMBeanConstants.THREADING_READ_WRITE_ATTRIBUTES.contains(name)) {
      // Bug
      throw PlatformMBeanMessages.MESSAGES.badWriteAttributeImpl4(name);
    } else {
      // Shouldn't happen; the global handler should reject
      throw unknownAttribute(operation);
    }
  } catch (SecurityException e) {
    throw new OperationFailedException(new ModelNode().set(e.toString()));
  } catch (UnsupportedOperationException e) {
    throw new OperationFailedException(new ModelNode().set(e.toString()));
  }
}
origin: org.wildfly.core/wildfly-platform-mbean

@Override
protected void executeWriteAttribute(OperationContext context, ModelNode operation) throws OperationFailedException {
  final String name = operation.require(ModelDescriptionConstants.NAME).asString();
  try {
    if (PlatformMBeanConstants.THREAD_CONTENTION_MONITORING_ENABLED.equals(name)) {
      enabledValidator.validate(operation);
      context.getServiceRegistry(true); //to trigger auth
      ManagementFactory.getThreadMXBean().setThreadContentionMonitoringEnabled(operation.require(ModelDescriptionConstants.VALUE).asBoolean());
    } else if (PlatformMBeanConstants.THREAD_CPU_TIME_ENABLED.equals(name)) {
      enabledValidator.validate(operation);
      context.getServiceRegistry(true); //to trigger auth
      ManagementFactory.getThreadMXBean().setThreadCpuTimeEnabled(operation.require(ModelDescriptionConstants.VALUE).asBoolean());
    } else if (ThreadResourceDefinition.THREADING_READ_WRITE_ATTRIBUTES.contains(name)) {
      // Bug
      throw PlatformMBeanLogger.ROOT_LOGGER.badWriteAttributeImpl(name);
    } else {
      // Shouldn't happen; the global handler should reject
      throw unknownAttribute(operation);
    }
  } catch (SecurityException e) {
    throw new OperationFailedException(e.toString());
  } catch (UnsupportedOperationException e) {
    throw new OperationFailedException(e.toString());
  }
}
origin: wildfly/wildfly-core

@Override
protected void executeWriteAttribute(OperationContext context, ModelNode operation) throws OperationFailedException {
  final String name = operation.require(ModelDescriptionConstants.NAME).asString();
  try {
    if (PlatformMBeanConstants.THREAD_CONTENTION_MONITORING_ENABLED.equals(name)) {
      enabledValidator.validate(operation);
      context.getServiceRegistry(true); //to trigger auth
      ManagementFactory.getThreadMXBean().setThreadContentionMonitoringEnabled(operation.require(ModelDescriptionConstants.VALUE).asBoolean());
    } else if (PlatformMBeanConstants.THREAD_CPU_TIME_ENABLED.equals(name)) {
      enabledValidator.validate(operation);
      context.getServiceRegistry(true); //to trigger auth
      ManagementFactory.getThreadMXBean().setThreadCpuTimeEnabled(operation.require(ModelDescriptionConstants.VALUE).asBoolean());
    } else if (ThreadResourceDefinition.THREADING_READ_WRITE_ATTRIBUTES.contains(name)) {
      // Bug
      throw PlatformMBeanLogger.ROOT_LOGGER.badWriteAttributeImpl(name);
    } else {
      // Shouldn't happen; the global handler should reject
      throw unknownAttribute(operation);
    }
  } catch (SecurityException e) {
    throw new OperationFailedException(e.toString());
  } catch (UnsupportedOperationException e) {
    throw new OperationFailedException(e.toString());
  }
}
org.jboss.as.platform.mbeanThreadMXBeanAttributeHandlerunknownAttribute

Popular methods of ThreadMXBeanAttributeHandler

  • storeResult
  • register

Popular in Java

  • Finding current android device location
  • findViewById (Activity)
  • getSystemService (Context)
  • setContentView (Activity)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • JFileChooser (javax.swing)
  • Sublime Text for Python
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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