Package org.jboss.managed.plugins

Examples of org.jboss.managed.plugins.ManagedPropertyImpl


    * @return simpler ManagedPropertyImpl
    * @throws java.io.ObjectStreamException for any error
    */
   private Object writeReplace() throws ObjectStreamException
   {
      ManagedPropertyImpl managedProperty = new ManagedPropertyImpl(getManagedObject(), getFields());
      managedProperty.setTargetManagedObject(getTargetManagedObject());
      return managedProperty;
   }
View Full Code Here


    * @return simpler ManagedPropertyImpl
    * @throws java.io.ObjectStreamException for any error
    */
   private Object writeReplace() throws ObjectStreamException
   {
      ManagedPropertyImpl managedProperty = new ManagedPropertyImpl(getManagedObject(), getFields());
      managedProperty.setTargetManagedObject(getTargetManagedObject());
      return managedProperty;
   }
View Full Code Here

   public void testXADSInstanceClassFactory()
      throws Exception
   {
      XADSInstanceClassFactory icf = new XADSInstanceClassFactory();
      XADataSourceDeploymentMetaData xads = new XADataSourceDeploymentMetaData();
      ManagedPropertyImpl property = new ManagedPropertyImpl("xa-datasource-properties");
      icf.getValue(null, property, null, xads);
      InstanceClassFactory icfref = icf;
      Serializable x = xads;
      icfref.getValue(null, property, null, x);
   }
View Full Code Here

               if (mpf != null)
                  mpClass = mpf.value();
               if (mpClass != null)
                  property = AbstractManagedObjectFactory.createManagedProperty(mpClass, fields);
               if (property == null)
                  property = new ManagedPropertyImpl(fields);
               // Pass the MetaMapper as an attachment
               if (mapperReturn[0] != null)
                  property.setTransientAttachment(MetaMapper.class.getName(), mapperReturn[0]);
               properties.add(property);
            }
View Full Code Here

            }

            Map<String, ManagedProperty> newProps = new HashMap<String, ManagedProperty>(oldProps);
            // Create a beans ManagedProperty, a list of BeanMetaData ManagedObjects
            Fields fields = getFields("beans", beansType);
            ManagedPropertyImpl beansMP = new ManagedPropertyImpl(bmdfMO, fields);
            newProps.put("beans", beansMP);

            // Create a ManagedObject for each of the beans BeanMetaData
            List<BeanMetaData> beans = bmdf.getBeans();
            if(beans != null)
            {
               for(BeanMetaData bmd : beans)
               {
                  DeploymentUnit compUnit = unit.getComponent(bmd.getName());
                  if(compUnit == null)
                  {
                     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()) ?
                              compUnit.getName() : compMO.getName();
                     }
                     // Add the managed object
                     managedObjects.put(managedObjectName, compMO);
                     // Add the bean MO to the beans list
                     tmpBeans.add(gv);
                  }
               }
            }
            GenericValue[] beanMOs = new GenericValue[tmpBeans.size()];
            tmpBeans.toArray(beanMOs);
            CollectionValueSupport values = new CollectionValueSupport(beansType, beanMOs);
            beansMP.setValue(values);
            // Update the bean factory properties
            bmdfMMO.setProperties(newProps);
         }
      }
      GenericValue[] mos = new GenericValue[tmpBFs.size()];
View Full Code Here

         mmo.setParent(parentMO);
         Map<String, ManagedProperty> oldProps = mmo.getProperties();
         Map<String, ManagedProperty> newProps = new HashMap<String, ManagedProperty>(oldProps);
         // Add a state property
         Fields stateFields = getFields("state", ControllerStateMetaType.TYPE);
         ManagedPropertyImpl stateMP = new ManagedPropertyImpl(mmo, stateFields);
         newProps.put("state", stateMP);
         mmo.setProperties(newProps);
      }
      return new GenericValueSupport(AbstractManagedObjectFactory.MANAGED_OBJECT_META_TYPE, mo);
   }
View Full Code Here

      DefaultFieldsImpl fields = new DefaultFieldsImpl("destinationType");
      fields.setDescription("The destination type");
      fields.setMetaType(SimpleMetaType.STRING);
      fields.setValue(SimpleValueSupport.wrap(destinationType));
      fields.setField(Fields.READ_ONLY, Boolean.TRUE);
      ManagedPropertyImpl destTypeMP = new ManagedPropertyImpl(fields);
      addProperty(destTypeMP);

      if(getProperties() == null) return;
      for(ManagedProperty property : getProperties().values())
      {
         // Create a new (non-writethrough) managed property
         Fields f = property.getFields();
        
         ManagedPropertyImpl newProperty = new ManagedPropertyImpl(f);
        
         // Skip non configuration properties except clustered
         if(newProperty.hasViewUse(ViewUse.CONFIGURATION) == false
               && property.getName().equals("clustered") == false)
            continue;
        
         // Override
         addProperty(newProperty);
View Full Code Here

      DefaultFieldsImpl fields = new DefaultFieldsImpl("destinationType");
      fields.setDescription("The destination type");
      fields.setMetaType(SimpleMetaType.STRING);
      fields.setValue(SimpleValueSupport.wrap(destinationType));
      fields.setField(Fields.READ_ONLY, Boolean.TRUE);
      ManagedPropertyImpl destTypeMP = new ManagedPropertyImpl(fields);
      addProperty(destTypeMP);

      // FIXME
      if(getProperties() == null) return;
      for(ManagedProperty property : getProperties().values())
      {
         // Create a new (non-writethrough) managed property
         Fields f = property.getFields();
        
         ManagedPropertyImpl newProperty = new ManagedPropertyImpl(f);
        
         // Override
         addProperty(newProperty);
      }
   }
View Full Code Here

               if (mpf != null)
                  mpClass = mpf.value();
               if (mpClass != null)
                  property = AbstractManagedObjectFactory.createManagedProperty(mpClass, fields);
               if (property == null)
                  property = new ManagedPropertyImpl(fields);
               // Pass the MetaMapper as an attachment
               if (mapperReturn[0] != null)
                  property.setTransientAttachment(MetaMapper.class.getName(), mapperReturn[0]);
               properties.add(property);
            }
View Full Code Here

    public MetaValue convertToMetaValue(PropertyMap propMap, PropertyDefinitionMap propDefMap, MetaType metaType) {
        //GenericMetaType genericMetaType = (GenericMetaType)metaType;
        ManagedObjectImpl managedObject = new ManagedObjectImpl(propDefMap.getName());
        for (PropertyDefinition mapMemberPropDef : propDefMap.getMap().values()) {
            ManagedPropertyImpl managedProp = new ManagedPropertyImpl(mapMemberPropDef.getName());
            MetaType managedPropMetaType = ConversionUtils.convertPropertyDefinitionToMetaType(mapMemberPropDef);
            managedProp.setMetaType(managedPropMetaType);
            managedProp.setManagedObject(managedObject);
            managedObject.getProperties().put(managedProp.getName(), managedProp);
        }
        GenericValue genericValue = new GenericValueSupport(new GenericMetaType(propDefMap.getName(),
            propDefMap.getDescription()), managedObject);
        populateMetaValueFromProperty(propMap, genericValue, propDefMap);
        return genericValue;
View Full Code Here

TOP

Related Classes of org.jboss.managed.plugins.ManagedPropertyImpl

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.