Package javax.management

Examples of javax.management.IntrospectionException


            {
               String key = methodName.substring(3, methodName.length());
               Method setter = (Method) setters.get(key);
               if (setter != null && setter.getParameterTypes()[0].equals(signature[0]) == false)
               {
                  throw new IntrospectionException("overloaded type for attribute set: " + key);
               }
               setters.put(key, methods[i]);
            }
            else if (methodName.startsWith("get") && signature.length == 0 && returnType != Void.TYPE)
            {
               String key = methodName.substring(3, methodName.length());
               Method getter = (Method) getters.get(key);
               if (getter != null && getter.getName().startsWith("get") == false)
               {
                  throw new IntrospectionException("mixed use of get/is for attribute " + key);
               }
               getters.put(key, methods[i]);
            }
            else if (methodName.startsWith("is") && signature.length == 0 && (returnType == Boolean.class || returnType == Boolean.TYPE))
            {
               String key = methodName.substring(2, methodName.length());
               Method getter = (Method) getters.get(key);
               if (getter != null && getter.getName().startsWith("is") == false)
               {
                  throw new IntrospectionException("mixed use of get/is for attribute " + key);
               }
               getters.put(key, methods[i]);
            }
            else
            {
View Full Code Here


            Class argType = getPrimativeClass(argTypes[p]);
            if( argType == null )
               argType = loader.loadClass(argTypes[p]);
            PropertyEditor editor = PropertyEditorManager.findEditor(argType);
            if( editor == null )
               throw new IntrospectionException("Failed to find PropertyEditor for type: "+argTypes[p]);
            editor.setAsText(arg);
            typedArgs[p] = editor.getValue();
         }
         catch(ClassNotFoundException e)
         {
View Full Code Here

                returnType == Void.TYPE)
            {
               String key = methodName.substring(3, methodName.length());
               Method setter = setters.get(key);
               if (setter != null && setter.getGenericParameterTypes()[0].equals(signature[0]) == false)
                  throw new IntrospectionException("overloaded type for attribute set: " + key);
               setters.put(key, method);
            }
            else if (methodName.startsWith("get") &&
                     methodName.length() > 3 &&
                     signature.length == 0 &&
                     returnType != Void.TYPE)
            {
               String key = methodName.substring(3, methodName.length());
               Method getter = getters.get(key);
               if (getter != null && getter.getName().startsWith("is"))
                  throw new IntrospectionException("mixed use of get/is for attribute " + key);
               getters.put(key, method);
            }
            else if (methodName.startsWith("is") &&
                     methodName.length() > 2 &&
                     signature.length == 0 &&
                     isBooleanReturn(returnType))
            {
               String key = methodName.substring(2, methodName.length());
               Method getter = getters.get(key);
               if (getter != null && getter.getName().startsWith("get"))
                  throw new IntrospectionException("mixed use of get/is for attribute " + key);
               getters.put(key, method);
            }
            else
            {
               OpenMBeanOperationInfo info = buildOperation(method);
View Full Code Here

               if (desc != null && desc.getFieldValue("getMethod") != null)
               {
                  getter = mmap.lookupGetter(mmbAttribute);
                  if (getter == null)
                  {
                     throw new IntrospectionException("no getter method found for attribute: " + attribute.getName());
                  }
               }
            }
            else
            {
               getter = mmap.lookupGetter(attribute);
               if (getter == null)
               {
                  throw new IntrospectionException("no getter method found for attribute: " + attribute.getName());
               }
            }
         }

         if (attribute.isWritable())
         {
            if (attribute instanceof ModelMBeanAttributeInfo)
            {
               ModelMBeanAttributeInfo mmbAttribute = (ModelMBeanAttributeInfo) attribute;
               Descriptor desc = mmbAttribute.getDescriptor();
               if (desc != null && desc.getFieldValue("setMethod") != null)
               {
                  setter = mmap.lookupSetter(mmbAttribute);
                  if (setter == null)
                  {
                     throw new IntrospectionException("no setter method found for attribute: " + attribute.getName());
                  }
               }
            }
            else
            {
               setter = mmap.lookupSetter(attribute);
               if (setter == null)
               {
                  throw new IntrospectionException("no setter method found for attribute: " + attribute.getName());
               }
            }
         }

         dispatcher.bindAttributeAt(i, getter, setter);
      }

      MBeanOperationInfo[] operations = info.getOperations();
      for (int i = 0; i < operations.length; i++)
      {
         MBeanOperationInfo operation = operations[i];
         Method method = mmap.lookupOperation(operation);
         if (method == null)
         {
            throw new IntrospectionException("no method found for operation: " + operation.getName()); // FIXME better error!
         }

         dispatcher.bindOperationAt(i, method);
      }
View Full Code Here

            {
               String key = methodName.substring(3, methodName.length());
               Method setter = (Method) setters.get(key);
               if (setter != null && setter.getParameterTypes()[0].equals(signature[0]) == false)
               {
                  throw new IntrospectionException("overloaded type for attribute set: " + key);
               }
               setters.put(key, methods[i]);
            }
            else if (methodName.startsWith("get") && methodName.length() > 3
                         && signature.length == 0 && returnType != Void.TYPE)
            {
               String key = methodName.substring(3, methodName.length());
               Method getter = (Method) getters.get(key);
               if (getter != null && getter.getName().startsWith("is"))
               {
                  throw new IntrospectionException("mixed use of get/is for attribute " + key);
               }
               getters.put(key, methods[i]);
            }
            else if (methodName.startsWith("is") && methodName.length() > 2
                        && signature.length == 0 && isBooleanReturn(returnType))
            {
               String key = methodName.substring(2, methodName.length());
               Method getter = (Method) getters.get(key);
               if (getter != null && getter.getName().startsWith("get"))
               {
                  throw new IntrospectionException("mixed use of get/is for attribute " + key);
               }
               getters.put(key, methods[i]);
            }
            else
            {
View Full Code Here

/*     */         {
/* 224 */           String key = methodName.substring(3, methodName.length());
/* 225 */           Method setter = (Method)setters.get(key);
/* 226 */           if ((setter != null) && (!setter.getParameterTypes()[0].equals(signature[0])))
/*     */           {
/* 228 */             throw new IntrospectionException("overloaded type for attribute set: " + key);
/*     */           }
/* 230 */           setters.put(key, methods[i]);
/*     */         }
/* 232 */         else if ((methodName.startsWith("get")) && (methodName.length() > 3) && (signature.length == 0) && (returnType != Void.TYPE))
/*     */         {
/* 235 */           String key = methodName.substring(3, methodName.length());
/* 236 */           Method getter = (Method)getters.get(key);
/* 237 */           if ((getter != null) && (getter.getName().startsWith("is")))
/*     */           {
/* 239 */             throw new IntrospectionException("mixed use of get/is for attribute " + key);
/*     */           }
/* 241 */           getters.put(key, methods[i]);
/*     */         }
/* 243 */         else if ((methodName.startsWith("is")) && (methodName.length() > 2) && (signature.length == 0) && (isBooleanReturn(returnType)))
/*     */         {
/* 246 */           String key = methodName.substring(2, methodName.length());
/* 247 */           Method getter = (Method)getters.get(key);
/* 248 */           if ((getter != null) && (getter.getName().startsWith("get")))
/*     */           {
/* 250 */             throw new IntrospectionException("mixed use of get/is for attribute " + key);
/*     */           }
/* 252 */           getters.put(key, methods[i]);
/*     */         }
/*     */         else
/*     */         {
View Full Code Here

/* 102 */           if ((desc != null) && (desc.getFieldValue("getMethod") != null))
/*     */           {
/* 104 */             getter = mmap.lookupGetter(mmbAttribute);
/* 105 */             if (getter == null)
/*     */             {
/* 107 */               throw new IntrospectionException("no getter method found for attribute: " + attribute.getName());
/*     */             }
/*     */           }
/*     */         }
/*     */         else
/*     */         {
/* 113 */           getter = mmap.lookupGetter(attribute);
/* 114 */           if (getter == null)
/*     */           {
/* 116 */             throw new IntrospectionException("no getter method found for attribute: " + attribute.getName());
/*     */           }
/*     */         }
/*     */       }
/*     */
/* 121 */       if (attribute.isWritable())
/*     */       {
/* 123 */         if ((attribute instanceof ModelMBeanAttributeInfo))
/*     */         {
/* 125 */           ModelMBeanAttributeInfo mmbAttribute = (ModelMBeanAttributeInfo)attribute;
/* 126 */           Descriptor desc = mmbAttribute.getDescriptor();
/* 127 */           if ((desc != null) && (desc.getFieldValue("setMethod") != null))
/*     */           {
/* 129 */             setter = mmap.lookupSetter(mmbAttribute);
/* 130 */             if (setter == null)
/*     */             {
/* 132 */               throw new IntrospectionException("no setter method found for attribute: " + attribute.getName());
/*     */             }
/*     */           }
/*     */         }
/*     */         else
/*     */         {
/* 138 */           setter = mmap.lookupSetter(attribute);
/* 139 */           if (setter == null)
/*     */           {
/* 141 */             throw new IntrospectionException("no setter method found for attribute: " + attribute.getName());
/*     */           }
/*     */         }
/*     */       }
/*     */
/* 146 */       dispatcher.bindAttributeAt(i, getter, setter);
/*     */     }
/*     */
/* 149 */     MBeanOperationInfo[] operations = info.getOperations();
/* 150 */     for (int i = 0; i < operations.length; i++)
/*     */     {
/* 152 */       MBeanOperationInfo operation = operations[i];
/* 153 */       Method method = mmap.lookupOperation(operation);
/* 154 */       if (method == null)
/*     */       {
/* 156 */         throw new IntrospectionException("no method found for operation: " + operation.getName());
/*     */       }
/*     */
/* 159 */       dispatcher.bindOperationAt(i, method);
/*     */     }
/*     */
View Full Code Here

/* 195 */         if ((methodName.startsWith("set")) && (methodName.length() > 3) && (signature.length == 1) && (returnType == Void.TYPE))
/*     */         {
/* 200 */           String key = methodName.substring(3, methodName.length());
/* 201 */           Method setter = (Method)setters.get(key);
/* 202 */           if ((setter != null) && (!setter.getGenericParameterTypes()[0].equals(signature[0])))
/* 203 */             throw new IntrospectionException("overloaded type for attribute set: " + key);
/* 204 */           setters.put(key, method);
/*     */         }
/* 206 */         else if ((methodName.startsWith("get")) && (methodName.length() > 3) && (signature.length == 0) && (returnType != Void.TYPE))
/*     */         {
/* 211 */           String key = methodName.substring(3, methodName.length());
/* 212 */           Method getter = (Method)getters.get(key);
/* 213 */           if ((getter != null) && (getter.getName().startsWith("is")))
/* 214 */             throw new IntrospectionException("mixed use of get/is for attribute " + key);
/* 215 */           getters.put(key, method);
/*     */         }
/* 217 */         else if ((methodName.startsWith("is")) && (methodName.length() > 2) && (signature.length == 0) && (isBooleanReturn(returnType)))
/*     */         {
/* 222 */           String key = methodName.substring(2, methodName.length());
/* 223 */           Method getter = (Method)getters.get(key);
/* 224 */           if ((getter != null) && (getter.getName().startsWith("get")))
/* 225 */             throw new IntrospectionException("mixed use of get/is for attribute " + key);
/* 226 */           getters.put(key, method);
/*     */         }
/*     */         else
/*     */         {
/* 230 */           OpenMBeanOperationInfo info = buildOperation(method);
View Full Code Here

TOP

Related Classes of javax.management.IntrospectionException

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.