Package javax.management

Examples of javax.management.InvalidAttributeValueException


    {
      this.mutatorMap.get(attribute.getName()).invoke(this.bean, attribute.getValue());
    }
    catch (IllegalArgumentException e)
    {
      throw new InvalidAttributeValueException(e.getMessage());
    }
    catch (IllegalAccessException e)
    {
      throw new MBeanException(e);
    }
View Full Code Here


      + " is not a settable attribute for MBean"
      + getMBeanName());
  }

  if (!attrInfo.getType().equals(value.getClass().getName()))  {
      throw new InvalidAttributeValueException(
  "The type of the value used to set the attribute "
      + name
      + " is incorrect ("
      + value.getClass().getName()
      + ").\n"
View Full Code Here

         InvalidAttributeValueException, MBeanException, ReflectionException
   {
      // TODO:  __JBOSSMX_INVOCATION
     
      if (attribute == null)
         throw new InvalidAttributeValueException("null attribute");
        
      // lookup the server side invocation context
      InvocationContext ctx = (InvocationContext)attributeContextMap.get(attribute.getName());
     
      // if we don't have a server side invocation context for the attribute,
View Full Code Here

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

         assignable = declared.isAssignableFrom(parameter);

      if (!assignable)
      {
         if (logger.isEnabledFor(Logger.TRACE)) logger.trace("Parameter value's class and attribute's declared return class are not assignable");
         throw new MBeanException(new InvalidAttributeValueException("Returned type and declared type are not assignable"));
      }
   }
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

         assignable = declared.isAssignableFrom(parameter);

      if (!assignable)
      {
         if (logger.isEnabledFor(Logger.TRACE)) logger.trace("Parameter value's class and attribute's declared return class are not assignable");
         throw new MBeanException(new InvalidAttributeValueException("Returned type and declared type are not assignable"));
      }
   }
View Full Code Here

      return new InvalidApplicationException("InvalidApplicationException");
   }

   public InvalidAttributeValueException createInvalidAttributeValueException()
   {
      return new InvalidAttributeValueException("InvalidAttributeValueException");
   }
View Full Code Here

            /* run method from operations descriptor */
            if (attrSetMethod == null) {
                if (attrValue != null) {
                    try {
                        final Class<?> clazz = loadClass(attrType);
                        if (! clazz.isInstance(attrValue))  throw new
                            InvalidAttributeValueException(clazz.getName() +
                                                           " expected, "   +
                                            attrValue.getClass().getName() +
                                                           " received.");
                    } catch (ClassNotFoundException x) {
                        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
                            MODELMBEAN_LOGGER.logp(Level.FINER,
                                    RequiredModelMBean.class.getName(),
                                "setAttribute(Attribute)","Class " +
                                    attrType + " for attribute "
                                + attrName + " not found: ", x);
                        }
                    }
                }
                updateDescriptor = true;
            } else {
                invoke(attrSetMethod,
                       (new Object[] {attrValue}),
                       (new String[] {attrType}) );
            }

            /* change cached value */
            Object objctl = attrDescr.getFieldValue("currencyTimeLimit");
            String ctl;
            if (objctl != null) ctl = objctl.toString();
            else ctl = null;

            if ((ctl == null) && (mmbDesc != null)) {
                objctl = mmbDesc.getFieldValue("currencyTimeLimit");
                if (objctl != null) ctl = objctl.toString();
                else ctl = null;
            }

            final boolean updateCache = ((ctl != null) && !(ctl.equals("-1")));

             if(attrSetMethod == null  && !updateCache && attrGetMethod != null)
                throw new MBeanException(new ServiceNotFoundException("No " +
                        "setMethod field is defined in the descriptor for " +
                        attrName + " attribute and caching is not enabled " +
                        "for it"));

            if (updateCache || updateDescriptor) {
                if (tracing) {
                    MODELMBEAN_LOGGER.logp(Level.FINER,
                        RequiredModelMBean.class.getName(),
                            "setAttribute(Attribute)",
                            "setting cached value of " +
                            attrName + " to " + attrValue);
                }

                attrDescr.setField("value", attrValue);

                if (updateCache) {
                    final String currtime = String.valueOf(
                        (new Date()).getTime());

                    attrDescr.setField("lastUpdatedTimeStamp", currtime);
                }

                attrInfo.setDescriptor(attrDescr);

                modelMBeanInfo.setDescriptor(attrDescr,"attribute");
                if (tracing) {
                    final StringBuilder strb = new StringBuilder()
                    .append("new descriptor is ").append(attrDescr)
                    .append(". AttributeInfo descriptor is ")
                    .append(attrInfo.getDescriptor())
                    .append(". AttributeInfo descriptor is ")
                    .append(modelMBeanInfo.getDescriptor(attrName,"attribute"));
                    MODELMBEAN_LOGGER.logp(Level.FINER,
                            RequiredModelMBean.class.getName(),
                            "setAttribute(Attribute)",strb.toString());
                }

            }

            if (tracing) {
                MODELMBEAN_LOGGER.logp(Level.FINER,
                        RequiredModelMBean.class.getName(),
                "setAttribute(Attribute)","sending sendAttributeNotification");
            }
            sendAttributeChangeNotification(oldAttr,attribute);

        } else { // if descriptor ... else no descriptor

            if (tracing) {
                    MODELMBEAN_LOGGER.logp(Level.FINER,
                            RequiredModelMBean.class.getName(),
                        "setAttribute(Attribute)","setMethod failed "+attrName+
                        " not in attributeDescriptor\n");
            }

            throw new InvalidAttributeValueException(
                      "Unable to resolve attribute value, "+
                      "no defined in descriptor for attribute");
        } // else no descriptor

        if (tracing) {
View Full Code Here

            Object cookie)
            throws InvalidAttributeValueException {
        if (!validParameter(setter, arg, 0, cookie)) {
            final String msg =
                    "Invalid value for attribute " + name + ": " + arg;
            throw new InvalidAttributeValueException(msg);
        }
    }
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.