Package org.jboss.mx.metadata

Examples of org.jboss.mx.metadata.MetaDataBuilder


         // the resource implements a Standard MBean interface
         else if ((resourceType.equals(STANDARD_INTERFACE)) ||
             (resourceType.equals(STANDARD_MBEAN)))
         {
            // create and configure the builder
            MetaDataBuilder builder = new StandardMetaData(resource);
           
            // pass the config keys to the builder instance
            for (Iterator it = properties.keySet().iterator(); it.hasNext();)
            {
               String key = (String)it.next();
               builder.setProperty(key, properties.get(key));
            }
           
            // build the metadata
            MBeanInfo standardInfo = builder.build();
           
            // StandardMetaData is used by the MBean server to introspect
            // standard MBeans. We need to now turn that Standard metadata into
            // ModelMBean metadata (including operation mapping for attributes)
            info = MBeanInfoConversion.toModelMBeanInfo(standardInfo, CREATE_ATTRIBUTE_OPERATION_MAPPING);
         }
        
         // If the resource type string ends with an '.xml' extension attempt
         // to create the metadata with the aggregated XML builder.
         else if (resourceType.endsWith(".xml"))
         {
            // Create and configure the builder. XMLMetaData builder is an
            // aggregate builder that picks the correct schema specific builder
            // based on schema declaration at the beginning of the XML file.
           
            MetaDataBuilder builder = new XMLMetaData(
                  this.getClass().getName(),     // MMBean implementation name
                  resource.getClass().getName(), // resource class name
                  resourceType
            );

            // pass the config keys to the builder instance
            for (Iterator it = properties.keySet().iterator(); it.hasNext();)
            {
               String key = (String)it.next();
               builder.setProperty(key, properties.get(key));
            }
     
            info = builder.build();
         }
         // we must try to load this MBean (as the superclass does), even if only NullPersistence
         // is used - MMM
         load();
      }
View Full Code Here


   {
      //      this(resource, OBJECT_REF);
      try
      {
   setManagedResource(resource, OBJECT_REF);
   MetaDataBuilder builder = new XMLMetaData(
      this.getClass().getName(),     // MMBean implementation name
      resource.getClass().getName(), // resource class name
      element,
      version
            );

   info = builder.build();

      }
      catch (InstanceNotFoundException e)
      {
   throw new MBeanException(e);
View Full Code Here

             (resourceType.equals(STANDARD_MBEAN)))
         {
            dynamicResource = false;
           
            // create and configure the builder
            MetaDataBuilder builder = new StandardMetaData(resource);

            // pass the config keys to the builder instance
            for (Iterator it = properties.keySet().iterator(); it.hasNext();)
            {
               String key = (String)it.next();
               builder.setProperty(key, properties.get(key));
            }

            // build the metadata
            MBeanInfo standardInfo = builder.build();

            // StandardMetaData is used by the MBean server to introspect
            // standard MBeans. We need to now turn that Standard metadata into
            // ModelMBean metadata (including operation mapping for attributes)
            minfo = MBeanInfoConversion.toModelMBeanInfo(standardInfo, CREATE_ATTRIBUTE_OPERATION_MAPPING);
         }

         // If the resource type string ends with an '.xml' extension attempt
         // to create the metadata with the aggregated XML builder.
         else if (resourceType.endsWith(".xml"))
         {
            // Create and configure the builder. XMLMetaData builder is an
            // aggregate builder that picks the correct schema specific builder
            // based on schema declaration at the beginning of the XML file.

            MetaDataBuilder builder = new XMLMetaData(
                  this.getClass().getName(),     // MMBean implementation name
                  resource.getClass().getName(), // resource class name
                  resourceType
            );

            // pass the config keys to the builder instance
            for (Iterator it = properties.keySet().iterator(); it.hasNext();)
            {
               String key = (String)it.next();
               builder.setProperty(key, properties.get(key));
            }

            minfo = (ModelMBeanInfo) builder.build();
         }
         // Sotre the ModelMBeanInfo
         this.setModelMBeanInfo(minfo);

         // we must try to load this MBean (as the superclass does), even if only NullPersistence
View Full Code Here

         throws MBeanException, NotCompliantMBeanException
   {
      try
      {
         setManagedResource(resource, OBJECT_REF);
         MetaDataBuilder builder = new XMLMetaData(
            this.getClass().getName(),     // MMBean implementation name
            resource.getClass().getName(), // resource class name
            element,
            version
            );

         ModelMBeanInfo minfo = (ModelMBeanInfo) builder.build();
         this.setModelMBeanInfo(minfo);
      }
      catch (InstanceNotFoundException e)
      {
         throw new MBeanException(e);
View Full Code Here

/*     */       }
/* 208 */       else if ((resourceType.equals("StandardInterface")) || (resourceType.equals("StandardMBean")))
/*     */       {
/* 211 */         this.dynamicResource = false;
/*     */
/* 214 */         MetaDataBuilder builder = new StandardMetaData(resource);
/*     */
/* 217 */         for (Iterator it = properties.keySet().iterator(); it.hasNext(); )
/*     */         {
/* 219 */           String key = (String)it.next();
/* 220 */           builder.setProperty(key, properties.get(key));
/*     */         }
/*     */
/* 224 */         MBeanInfo standardInfo = builder.build();
/*     */
/* 229 */         minfo = MBeanInfoConversion.toModelMBeanInfo(standardInfo, true);
/*     */       }
/* 234 */       else if (resourceType.endsWith(".xml"))
/*     */       {
/* 240 */         MetaDataBuilder builder = new XMLMetaData(getClass().getName(), resource.getClass().getName(), resourceType);
/*     */
/* 247 */         for (Iterator it = properties.keySet().iterator(); it.hasNext(); )
/*     */         {
/* 249 */           String key = (String)it.next();
/* 250 */           builder.setProperty(key, properties.get(key));
/*     */         }
/*     */
/* 253 */         minfo = (ModelMBeanInfo)builder.build();
/*     */       }
/*     */
/* 256 */       setModelMBeanInfo(minfo);
/*     */
/* 260 */       load();
View Full Code Here

/*     */     throws MBeanException, NotCompliantMBeanException
/*     */   {
/*     */     try
/*     */     {
/* 324 */       setManagedResource(resource, "ObjectReference");
/* 325 */       MetaDataBuilder builder = new XMLMetaData(getClass().getName(), resource.getClass().getName(), element, version);
/*     */
/* 332 */       ModelMBeanInfo minfo = (ModelMBeanInfo)builder.build();
/* 333 */       setModelMBeanInfo(minfo);
/*     */     }
/*     */     catch (InstanceNotFoundException e)
/*     */     {
/* 337 */       throw new MBeanException(e);
View Full Code Here

TOP

Related Classes of org.jboss.mx.metadata.MetaDataBuilder

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.