Package javax.management

Examples of javax.management.InvalidAttributeValueException


            // unrecognized attribute name:
            throw new AttributeNotFoundException("Attribute " + name
                    + " not found in " + m_className);
        }
        if (!propertyField.isWritable()) {
            throw new InvalidAttributeValueException("Attribute " + name
                    + " can not be set");
        }

        if (value == null) {
            try {
                m_instanceManager.onSet(null, propertyField.getField(), null);
            } catch (Exception e) {
                throw new InvalidAttributeValueException(
                    "Cannot set attribute " + name + " to null");
            }
        } else { // if non null value, make sure it is assignable to the
            // attribute
//            if (true /* TODO type.class.isAssignableFrom(value.getClass()) */) {
View Full Code Here


      {
         throw new ReflectionException(x);
      }
      catch (IllegalArgumentException x)
      {
         throw new InvalidAttributeValueException(x.toString());
      }
      catch (InvocationTargetException x)
      {
         Throwable t = x.getTargetException();
         if (t instanceof RuntimeException)
View Full Code Here

         {
            invokeImpl(metadata, attributeName, new String[]{attr.getType()}, new Object[]{attribute.getValue()});
         }
         catch (IllegalArgumentException x)
         {
            throw new InvalidAttributeValueException("Invalid value for attribute " + name + ": " + attribute.getValue());
         }
      }
      else
      {
         throw new AttributeNotFoundException(name);
View Full Code Here

            throw MESSAGES.invalidAttributeType(e, attribute.getName());
        }
        ModelNode result = execute(op);
        String error = getFailureDescription(result);
        if (error != null) {
            throw new InvalidAttributeValueException(error);
        }
    }
View Full Code Here

            throw new AttributeNotFoundException
                ("Attribute name cannot be null");
        }

        if (value == null) {
            throw new InvalidAttributeValueException
                ("Attribute value for attribute " + name + " cannot be null");
        }

        try {
            if (name.equals(ATT_SET_READ_ONLY)) {
                openConfig.setReadOnly(((Boolean) value).booleanValue());
            } else if (name.equals(ATT_SET_TRANSACTIONAL)) {
                openConfig.setTransactional(((Boolean) value).booleanValue());
            } else if (name.equals(ATT_SET_SERIALIZABLE)) {
                openConfig.setTxnSerializableIsolation
                    (((Boolean) value).booleanValue());
            } else {
                /* Set the specified attribute if the environment is open. */
                if (targetEnv != null) {

                    EnvironmentMutableConfig config =
                        targetEnv.getMutableConfig();

                    if (name.equals(ATT_CACHE_SIZE)) {
                        config.setCacheSize(((Long) value).longValue());
                        targetEnv.setMutableConfig(config);
                    } else if (name.equals(ATT_CACHE_PERCENT)) {
                        config.setCachePercent(((Integer) value).intValue());
                        targetEnv.setMutableConfig(config);
                    } else {
                        throw new AttributeNotFoundException
                            ("attribute " + name + " is not valid.");
                    }
                } else {
                    throw new AttributeNotFoundException
                        ("attribute " + name + " is not valid.");
                }
            }
        } catch (NumberFormatException e) {
            throw new InvalidAttributeValueException("attribute name=" + name);
        } catch (DatabaseException e) {
            throw new InvalidAttributeValueException
                ("attribute name=" + name + e.getMessage());
        }
    }
View Full Code Here

            throw new AttributeNotFoundException
                ("Attribute name can't be null.");
        }

        if (value == null) {
            throw new InvalidAttributeValueException
                ("Attribute value for attribute " + name + " can't be null");
        }

        try {
            EnvironmentMutableConfig mutableConfig = env.getMutableConfig();

            if (name.equals(ATT_CACHE_SIZE)) {
                mutableConfig.setCacheSize(((Long) value).longValue());
                env.setMutableConfig(mutableConfig);
            } else if (name.equals(ATT_CACHE_PERCENT)) {
                mutableConfig.setCachePercent(((Integer) value).intValue());
                env.setMutableConfig(mutableConfig);
            } else {
                throw new AttributeNotFoundException
                    ("Attribute " + name + " is not valid.");
            }
        } catch (NumberFormatException e) {
            throw new InvalidAttributeValueException
                ("Attribute value for attribute " + name + " is not valid.");
        } catch (DatabaseException e) {
            throw new InvalidAttributeValueException
                ("Setting value for attribute " + name +
                 "is invalid because of " + e.getMessage());
        }
    }
View Full Code Here

            throw new AttributeNotFoundException
                ("Attribute name can't be null.");
        }

        if (value == null) {
            throw new InvalidAttributeValueException
                ("Attribute value for attribute " + name + " can't be null");
        }

        try {
            EnvironmentImpl envImpl = DbInternal.getEnvironmentImpl(env);
            Level level = Level.parse((String) value);

            if (name.equals(CONSOLEHANDLER_LEVEL)) {
                envImpl.getConsoleHandler().setLevel(level);
            } else if (name.equals(FILEHANDLER_LEVEL)) {
                envImpl.getFileHandler().setLevel(level);
            } else {
                throw new AttributeNotFoundException
                    ("Attribute " + name + " is not valid.");
            }
        } catch (NullPointerException e) {
            throw new InvalidAttributeValueException
                ("Setting value for attribute " + name +
                 "is invalid because of " + e.getMessage());
        } catch (SecurityException e) {
            throw new MBeanException(e, e.getMessage());
        }
View Full Code Here

      s.equals(DestinationLimitBehavior.REMOVE_LOW_PRIORITY))  {

      return;
  }

  throw new InvalidAttributeValueException(
      "Invalid value for Destination LimitBehavior specified: " + s);
    }
View Full Code Here

        throws InvalidAttributeValueException  {
  if (l.longValue() >= -1)  {
      return;
  }

  throw new InvalidAttributeValueException(
      "Invalid value for attribute "
    + attrName
    + ": "
    + l
    + ". Please use a positive number or -1");
View Full Code Here

        throws InvalidAttributeValueException  {
  if (i.intValue() >= -1)  {
      return;
  }

  throw new InvalidAttributeValueException(
      "Invalid value for attribute "
    + attrName
    + ": "
    + i
    + ". Please use a positive number or -1");
View Full Code Here

TOP

Related Classes of javax.management.InvalidAttributeValueException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.