Package org.jboss.metatype.api.values

Examples of org.jboss.metatype.api.values.GenericValue


         }

         MetaType propType = prop.getMetaType();
         if (propType == AbstractManagedObjectFactory.MANAGED_OBJECT_META_TYPE)
         {
            GenericValue gv = (GenericValue) prop.getValue();
            ManagedObject propMO = (ManagedObject) gv.getValue();
            processManagedObject(propMO, md);
         }
         else if (propType.isArray())
         {
            ArrayMetaType amt = (ArrayMetaType) propType;
            MetaType etype = amt.getElementType();
            if (etype == AbstractManagedObjectFactory.MANAGED_OBJECT_META_TYPE)
            {
               ArrayValue avalue = (ArrayValue) prop.getValue();
               for(int n = 0; n < avalue.getLength(); n ++)
               {
                  GenericValue gv = (GenericValue) avalue.getValue(n);
                  ManagedObject propMO = (ManagedObject) gv.getValue();
                  processManagedObject(propMO, md);
               }
            }
         }
         else if (propType.isCollection())
         {
            CollectionMetaType amt = (CollectionMetaType) propType;
            MetaType etype = amt.getElementType();
            if (etype == AbstractManagedObjectFactory.MANAGED_OBJECT_META_TYPE)
            {
               CollectionValue avalue = (CollectionValue) prop.getValue();
               MetaValue[] elements = avalue.getElements();
               for(int n = 0; n < avalue.getSize(); n ++)
               {
                  GenericValue gv = (GenericValue) elements[n];
                  ManagedObject propMO = (ManagedObject) gv.getValue();
                  processManagedObject(propMO, md);
               }
            }
         }
      }
View Full Code Here


      Map<String, ManagedProperty> localDataProps = localDataMO.getProperties();
      log.debug("LocalDataSourceMetaData MO.props: "+localDataProps);
      assertNotNull("LocalDataSourceMetaData MO.props", localDataProps);
      ManagedProperty localSecDomainProp = localDataMO.getProperty("security-domain");
      assertNotNull("localSecDomainProp", localSecDomainProp);
      GenericValue localSecDomainPropGV = (GenericValue) localSecDomainProp.getValue();
      ManagedObject localSecDomainPropMO = (ManagedObject) localSecDomainPropGV.getValue();
      ManagedProperty localSecDomainRefProp = localSecDomainPropMO.getProperty("domain-name");
      assertNotNull("localSecDomainRefProp", localSecDomainRefProp);

      // Get the XADataSourceMetaData/SecMetaData/domain ManagedProperty
      log.debug("XADataSourceMetaData MO: "+xaDataMO);
      assertNotNull("XADataSourceMetaData", xaDataMO);
      assertEquals("XADataSourceMetaData comp type", new ComponentType("DataSource", "XA"), xaDataMO.getType());
      assertNotNull("XADataSourceMetaData MO.props", xaDataMO.getProperties());
      ManagedProperty xaSecDomainProp = xaDataMO.getProperty("security-domain");
      assertNotNull("xaSecDomainProp", xaSecDomainProp);
      GenericValue xaSecDomainPropGV = (GenericValue) xaSecDomainProp.getValue();
      ManagedObject xaSecDomainPropMO = (ManagedObject) xaSecDomainPropGV.getValue();
      ManagedProperty xaSecDomainRefProp = xaSecDomainPropMO.getProperty("domain-name");
      assertNotNull("xaSecDomainRefProp", xaSecDomainRefProp);

      // Should be 0 unresolved ManagementObjectRef for the sec-domain1/sec-domain2
      Map<String, Set<ManagedProperty>> unresolvedRefs = ps.getUnresolvedRefs();
View Full Code Here

      ManagedProperty beanFactories = kdMO.getProperty("beanFactories");
      assertNotNull(beanFactories);
      CollectionValue beanFactoriesAV = CollectionValue.class.cast(beanFactories.getValue());
      beanFactoriesAV.getMetaType();
      assertEquals("BeanFactories size", 2, beanFactoriesAV.getSize());
      GenericValue beanFactoriesGV = (GenericValue) beanFactoriesAV.getElements()[0];
      log.info("BeanFactories[0].GV: "+beanFactoriesGV);
      ManagedObject beanFactoriesMO = (ManagedObject) beanFactoriesGV.getValue();
      assertNotNull(beanFactoriesMO);
      log.info("beanFactories.ManagedProperties: "+beanFactoriesMO.getProperties());
      ManagedProperty properties = beanFactoriesMO.getProperty("properties");
      assertNotNull(properties);
      CollectionValue propertiesArray = CollectionValue.class.cast(properties.getValue());
View Full Code Here

      CollectionMetaType valueType = value.getMetaType();
      assertEquals(AbstractManagedObjectFactory.MANAGED_OBJECT_META_TYPE, valueType.getElementType());

      assertEquals(1, value.getSize());
      // Validate the ConnMetaData ManagedObject
      GenericValue localConnMOGV = GenericValue.class.cast(value.getElements()[0]);
      ManagedObject localConnMO = ManagedObject.class.cast(localConnMOGV.getValue());
      assertEquals(ConnMetaData.class.getName(), localConnMO.getName());
      propsMap = localConnMO.getProperties();
      assertEquals(10, propsMap.size());
      log.info("ConnMetaData properties: "+propsMap);
      ManagedProperty dsType = propsMap.get("datasource-type");
View Full Code Here

      assertEquals(2, value.getSize());
      ManagedObject localConnMO = null;
      ManagedObject xaConnMO = null;
      for(Object md : value)
      {
         GenericValue tmpGV = GenericValue.class.cast(md);
         ManagedObject tmpMO = ManagedObject.class.cast(tmpGV.getValue());
         if (tmpMO.getName().equals(LocalDataSourceMetaData.class.getName()))
            localConnMO = tmpMO;
         if (tmpMO.getName().equals(XADataSourceMetaData.class.getName()))
            xaConnMO = tmpMO;
      }
View Full Code Here

                  {
                     log.debug("Failed to find component for bean: "+bmd.getName());
                     continue;
                  }
                  MetaData compMetaData = compUnit.getMetaData();
                  GenericValue gv = getManagedObjectValue(bmd, compMetaData, bmdfMO);
                  if(gv != null)
                  {
                     // The component managed objects need to be in the root map
                     ManagedObject compMO = (ManagedObject) gv.getValue();
                     // Use the ManagedObject name if it's not the same as the attachmentName
                     String managedObjectName = compUnit.getName();
                     if(compMO != null && compMO.getAttachmentName() != null)
                     {
                        managedObjectName = compMO.getAttachmentName().equals(compMO.getName()) ?
View Full Code Here

         return null;
     
      if (value instanceof Serializable == false)
         throw new IllegalArgumentException("Not serializable: " + value.getClass().getName());

      GenericValue result = new GenericValueSupport(type, (Serializable) value);
      mapping.put(value, result);
      return result;
   }
View Full Code Here

/* 351 */           if (avalue != null)
/*     */           {
/* 353 */             MetaValue[] elements = avalue.getElements();
/* 354 */             for (int n = 0; n < avalue.getSize(); n++)
/*     */             {
/* 356 */               GenericValue gv = (GenericValue)elements[n];
/* 357 */               ManagedObject propMO = (ManagedObject)gv.getValue();
/* 358 */               if (propMO != null)
/* 359 */                 processManagedObject(propMO, md);
/*     */             }
/*     */           }
/*     */         }
View Full Code Here

/*  197 */       return null;
/*      */     }
/*  199 */     if (!(value instanceof Serializable)) {
/*  200 */       throw new IllegalArgumentException("Not serializable: " + value.getClass().getName());
/*      */     }
/*  202 */     GenericValue result = new GenericValueSupport(type, (Serializable)value);
/*  203 */     mapping.put(value, result);
/*  204 */     return result;
/*      */   }
View Full Code Here

         return null;
     
      if (value instanceof Serializable == false)
         throw new IllegalArgumentException("Not serializable: " + value.getClass().getName());

      GenericValue result = new GenericValueSupport(type, (Serializable) value);
      mapping.put(value, result);
      return result;
   }
View Full Code Here

TOP

Related Classes of org.jboss.metatype.api.values.GenericValue

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.