Package org.jboss.mx.util

Examples of org.jboss.mx.util.JBossNotCompliantMBeanException


         } // end of else

      }
      catch (DocumentException e)
      {
         throw new JBossNotCompliantMBeanException("Error parsing the XML file, from XMLMetaData: ", e);
      }
   }
View Full Code Here


   {
      try
      {
         if (element == null)
         {
            throw new JBossNotCompliantMBeanException("No xml configuration supplied!");
         }
         String description = element.elementTextTrim("description");

         if (resourceClassName == null)
         {
            resourceClassName = element.elementTextTrim("class");
         }
        
         List constructors = element.elements("constructor");
         List operations = element.elements("operation");
         List attributes = element.elements("attribute");
         List notifications = element.elements("notification");

         Descriptor descr = getDescriptor(element, mmbClassName, MBEAN_DESCRIPTOR);

         ModelMBeanInfo info = buildMBeanMetaData(
            description, constructors, operations,
            attributes, notifications, descr
         );

         return (MBeanInfo) info;
      }
      catch (Throwable t)
      {
         throw new JBossNotCompliantMBeanException("Error parsing the XML file: ", t);
      }
   }
View Full Code Here

         if (valid[i].equalsIgnoreCase(value))
         {
            return;
         } // end of if ()
      } // end of for ()
      throw new JBossNotCompliantMBeanException("Unknown descriptor value: " + value);     
   }
View Full Code Here

                     {
                        typeClass = cl.loadClass(typeName);
                     }
                     catch (ClassNotFoundException e)
                     {
                        throw new JBossNotCompliantMBeanException
                           ("Class not found '" + typeName + "'", e);
                     }
                  }

                  /* Attributes of type Element are passed as is after optionally
                  performing system property replacement
                  */
                  if (typeClass.equals(org.w3c.dom.Element.class))
                  {
                     // Use the first child Element of this element as the value
                     NodeList nl = element.getChildNodes();
                     for (int j=0; j < nl.getLength(); j++)
                     {
                        Node n = nl.item(j);
                        if (n.getNodeType() == Node.ELEMENT_NODE)
                        {
                           value = n;
                           break;
                        }
                     }
                     // Replace any ${x} references in the element text
                     if( replace )
                     {
                        PropertyEditor editor = PropertyEditorManager.findEditor(typeClass);
                        if( editor == null )
                        {
                           log.warn("Cannot perform property replace on Element");
                        }
                        else
                        {
                           editor.setValue(value);
                           String text = editor.getAsText();
                           text = StringPropertyReplacer.replaceProperties(text);
                           editor.setAsText(text);
                           value = editor.getValue();
                        }
                     }
                  }

                  if (value == null)
                  {
                     PropertyEditor editor = PropertyEditorManager.findEditor(typeClass);
                     if (editor == null)
                     {
                        throw new JBossNotCompliantMBeanException
                           ("No property editor for type '" + typeName + "'");
                     }
                     // Get the attribute value
                     String attributeText = getElementContent(element, trim, replace);
                     editor.setAsText(attributeText);
                     value = editor.getValue();
                  }
               }
               catch (org.dom4j.DocumentException e)
               {
                  throw new JBossNotCompliantMBeanException(
                        "cannot convert '" + which + "' descriptor to org.w3c.dom.Element", e);
               }

               // stop processing
               break;
View Full Code Here

/*     */   {
/*     */     try
/*     */     {
/* 101 */       if (this.element == null)
/*     */       {
/* 103 */         throw new JBossNotCompliantMBeanException("No xml configuration supplied!");
/*     */       }
/* 105 */       String description = this.element.elementTextTrim("description");
/*     */
/* 107 */       if (this.resourceClassName == null)
/*     */       {
/* 109 */         this.resourceClassName = this.element.elementTextTrim("class");
/*     */       }
/*     */
/* 112 */       List constructors = this.element.elements("constructor");
/* 113 */       List operations = this.element.elements("operation");
/* 114 */       List attributes = this.element.elements("attribute");
/* 115 */       List notifications = this.element.elements("notification");
/*     */
/* 117 */       Descriptor descr = getDescriptor(this.element, this.mmbClassName, "mbean");
/*     */
/* 119 */       ModelMBeanInfo info = buildMBeanMetaData(description, constructors, operations, attributes, notifications, descr);
/*     */
/* 124 */       return (MBeanInfo)info;
/*     */     }
/*     */     catch (Throwable t) {
/*     */     }
/* 128 */     throw new JBossNotCompliantMBeanException("Error parsing the XML file: ", t);
/*     */   }
View Full Code Here

/* 222 */       if (valid[i].equalsIgnoreCase(value))
/*     */       {
/* 224 */         return;
/*     */       }
/*     */     }
/* 227 */     throw new JBossNotCompliantMBeanException("Unknown descriptor value: " + value);
/*     */   }
View Full Code Here

/*     */               {
/* 500 */                 typeClass = cl.loadClass(typeName);
/*     */               }
/*     */               catch (ClassNotFoundException e)
/*     */               {
/* 504 */                 throw new JBossNotCompliantMBeanException("Class not found '" + typeName + "'", e);
/*     */               }
/*     */
/*     */             }
/*     */
/* 512 */             if (typeClass.equals(org.w3c.dom.Element.class))
/*     */             {
/* 515 */               NodeList nl = element.getChildNodes();
/* 516 */               for (int j = 0; j < nl.getLength(); j++)
/*     */               {
/* 518 */                 Node n = nl.item(j);
/* 519 */                 if (n.getNodeType() != 1)
/*     */                   continue;
/* 521 */                 value = n;
/* 522 */                 break;
/*     */               }
/*     */
/* 526 */               if (replace)
/*     */               {
/* 528 */                 PropertyEditor editor = PropertyEditorManager.findEditor(typeClass);
/* 529 */                 if (editor == null)
/*     */                 {
/* 531 */                   log.warn("Cannot perform property replace on Element");
/*     */                 }
/*     */                 else
/*     */                 {
/* 535 */                   editor.setValue(value);
/* 536 */                   String text = editor.getAsText();
/* 537 */                   text = StringPropertyReplacer.replaceProperties(text);
/* 538 */                   editor.setAsText(text);
/* 539 */                   value = editor.getValue();
/*     */                 }
/*     */               }
/*     */             }
/*     */
/* 544 */             if (value == null)
/*     */             {
/* 546 */               PropertyEditor editor = PropertyEditorManager.findEditor(typeClass);
/* 547 */               if (editor == null)
/*     */               {
/* 549 */                 throw new JBossNotCompliantMBeanException("No property editor for type '" + typeName + "'");
/*     */               }
/*     */
/* 553 */               String attributeText = getElementContent(element, trim, replace);
/* 554 */               editor.setAsText(attributeText);
/* 555 */               value = editor.getValue();
/*     */             }
/*     */           }
/*     */           catch (DocumentException e)
/*     */           {
/* 560 */             throw new JBossNotCompliantMBeanException("cannot convert '" + which + "' descriptor to org.w3c.dom.Element", e);
/*     */           }
/*     */
/*     */         }
/*     */
/*     */       }
View Full Code Here

/*     */     }
/*     */     catch (DocumentException e)
/*     */     {
/*     */     }
/*     */
/* 292 */     throw new JBossNotCompliantMBeanException("Error parsing the XML file, from XMLMetaData: ", e);
/*     */   }
View Full Code Here

TOP

Related Classes of org.jboss.mx.util.JBossNotCompliantMBeanException

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.