Package org.jboss.managed.plugins

Examples of org.jboss.managed.plugins.ManagedPropertyImpl


            }

            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

                     {
                        aliases[n] = i.next().toString();
                     }
                     ArrayValueSupport value = new ArrayValueSupport(aliasType, aliases);
                     fields.setValue(value);
                     ManagedPropertyImpl aliasesMP = new ManagedPropertyImpl(bmdMO, fields);
                     newProps.put("alias", aliasesMP);
                  }
                  // Add a state property
                  DefaultFieldsImpl stateFields = getFields("state", ControllerStateMetaType.TYPE);
                  stateFields.setViewUse(new ViewUse[]{ViewUse.STATISTIC});
                  EnumValue stateValue = getState(bmd.getName(), kernel);
                  stateFields.setValue(stateValue);
                  stateFields.setDescription("The bean controller state");
                  ManagedPropertyImpl stateMP = new ManagedPropertyImpl(mmo, stateFields);
                  newProps.put("state", stateMP);
                  // Update the properties
                  mmo.setProperties(newProps);
               }
               log.debug("Created ManagedObject: "+bmdMO+" for bean: "+bmd.getName());
View Full Code Here

/* 124 */       values.add(SimpleValueSupport.wrap("local-tx-datasource"));
/* 125 */       values.add(SimpleValueSupport.wrap("no-tx-datasource"));
/* 126 */       values.add(SimpleValueSupport.wrap("xa-datasource"));
/* 127 */       f21.setLegalValues(values);
/* 128 */       f21.setMetaType(SimpleMetaType.STRING);
/* 129 */       ManagedPropertyImpl dsType = new ManagedPropertyImpl(typeMO, f21);
/* 130 */       typeMO.getProperties().put("datasource-type", dsType);
/* 131 */       wrapMO = WrapperAdvice.wrapManagedObject(typeMO);
/* 132 */       map.put(attachName, wrapMO);
/*     */     }
/*     */   }
View Full Code Here

/* 235 */     DefaultFieldsImpl fields = new DefaultFieldsImpl();
/* 236 */     setFieldName(fieldName, fields);
/* 237 */     fields.setDescription(fieldDescr);
/* 238 */     fields.setMandatory(mandatory);
/* 239 */     fields.setMetaType(metaType);
/* 240 */     ManagedPropertyImpl mp = new ManagedPropertyImpl(mo, fields);
/* 241 */     super.addProperty(mp);
/* 242 */     if (value != null)
/* 243 */       mp.setValue(value);
/*     */   }
View Full Code Here

/*  88 */     DefaultFieldsImpl f0 = new DefaultFieldsImpl();
/*  89 */     setFieldName("jndi-name", f0);
/*  90 */     f0.setDescription("The jndi name to bind the DataSource under");
/*  91 */     f0.setMandatory(true);
/*  92 */     f0.setMetaType(SimpleMetaType.STRING);
/*  93 */     ManagedPropertyImpl jndiName = new ManagedPropertyImpl(mo, f0);
/*  94 */     super.addProperty(jndiName);
/*     */
/*  96 */     DefaultFieldsImpl f1 = new DefaultFieldsImpl();
/*  97 */     setFieldName("connection-url", f1);
/*  98 */     f1.setDescription("The jdbc url of the DataSource");
/*  99 */     f1.setMandatory(true);
/* 100 */     f1.setMetaType(SimpleMetaType.STRING);
/* 101 */     ManagedPropertyImpl conURL = new ManagedPropertyImpl(mo, f1);
/* 102 */     super.addProperty(conURL);
/*     */
/* 104 */     DefaultFieldsImpl f2 = new DefaultFieldsImpl();
/* 105 */     setFieldName("user-name", f2);
/* 106 */     f2.setDescription("The username for the connection-url");
/* 107 */     f2.setMandatory(false);
/* 108 */     f2.setMetaType(SimpleMetaType.STRING);
/* 109 */     ManagedPropertyImpl user = new ManagedPropertyImpl(mo, f2);
/* 110 */     super.addProperty(user);
/*     */
/* 112 */     DefaultFieldsImpl f3 = new DefaultFieldsImpl();
/* 113 */     setFieldName("password", f3);
/* 114 */     f3.setDescription("The password for the connection-url");
/* 115 */     f3.setMandatory(false);
/* 116 */     f3.setMetaType(SimpleMetaType.STRING);
/* 117 */     ManagedPropertyImpl password = new ManagedPropertyImpl(mo, f3);
/* 118 */     super.addProperty(password);
/*     */
/* 120 */     DefaultFieldsImpl f4 = new DefaultFieldsImpl();
/* 121 */     setFieldName("security-domain", f4);
/* 122 */     f4.setDescription("The security-domain used to validate connections");
/* 123 */     f4.setMandatory(false);
/* 124 */     f4.setMetaType(SimpleMetaType.STRING);
/* 125 */     ManagedPropertyImpl secDomain = new ManagedPropertyImpl(mo, f4);
/* 126 */     super.addProperty(secDomain);
/*     */
/* 128 */     DefaultFieldsImpl f5 = new DefaultFieldsImpl();
/* 129 */     setFieldName("driver-class", f5);
/* 130 */     f5.setDescription("The jdbc driver class name");
/* 131 */     f5.setMandatory(true);
/* 132 */     f5.setMetaType(SimpleMetaType.STRING);
/* 133 */     ManagedPropertyImpl driverClass = new ManagedPropertyImpl(mo, f5);
/* 134 */     super.addProperty(driverClass);
/*     */
/* 136 */     DefaultFieldsImpl f6 = new DefaultFieldsImpl();
/* 137 */     setFieldName("connection-properties", f6);
/* 138 */     f6.setDescription("The jdbc driver connection properties");
/* 139 */     f6.setMandatory(false);
/* 140 */     String[] itemNames = { "conn-prop1", "conn-prop2" };
/* 141 */     String[] itemDescriptions = { "conn-prop1 description", "conn-prop2 description" };
/* 142 */     MetaType[] itemTypes = { SimpleMetaType.STRING, SimpleMetaType.STRING };
/* 143 */     CompositeMetaType propsType = new ImmutableCompositeMetaType("java.lang.Properties", "DS connection properties", itemNames, itemDescriptions, itemTypes);
/*     */
/* 145 */     f6.setMetaType(propsType);
/* 146 */     ManagedPropertyImpl connProps = new ManagedPropertyImpl(mo, f6);
/* 147 */     super.addProperty(connProps);
/*     */
/* 150 */     ManagedObjectImpl mo2 = new ManagedObjectImpl(this.dsTypeAttachmentName);
/* 151 */     DefaultFieldsImpl f21 = new DefaultFieldsImpl();
/* 152 */     setFieldName("datasource-type", f21);
/* 153 */     f21.setDescription("The type of the ConnectionFactory");
/* 154 */     f21.setMandatory(true);
/* 155 */     f21.setValue("local-tx-datasource");
/* 156 */     HashSet values = new HashSet();
/* 157 */     values.add(SimpleValueSupport.wrap("local-tx-datasource"));
/* 158 */     values.add(SimpleValueSupport.wrap("no-tx-datasource"));
/* 159 */     values.add(SimpleValueSupport.wrap("xa-datasource"));
/* 160 */     f21.setLegalValues(values);
/* 161 */     f21.setMetaType(SimpleMetaType.STRING);
/* 162 */     ManagedPropertyImpl dsType = new ManagedPropertyImpl(mo2, f21);
/* 163 */     super.addProperty(dsType);
/*     */   }
View Full Code Here

/*     */   }
/*     */
/*     */   private Object writeReplace()
/*     */     throws ObjectStreamException
/*     */   {
/* 152 */     ManagedPropertyImpl managedProperty = new ManagedPropertyImpl(getManagedObject(), getFields());
/* 153 */     managedProperty.setTargetManagedObject(getTargetManagedObject());
/* 154 */     return managedProperty;
/*     */   }
View Full Code Here

/*     */   }
/*     */
/*     */   private Object writeReplace()
/*     */     throws ObjectStreamException
/*     */   {
/* 154 */     ManagedPropertyImpl managedProperty = new ManagedPropertyImpl(getManagedObject(), getFields());
/* 155 */     managedProperty.setTargetManagedObject(getTargetManagedObject());
/* 156 */     return managedProperty;
/*     */   }
View Full Code Here

/* 104 */       values.add(SimpleValueSupport.wrap("local-tx-datasource"));
/* 105 */       values.add(SimpleValueSupport.wrap("no-tx-datasource"));
/* 106 */       values.add(SimpleValueSupport.wrap("xa-datasource"));
/* 107 */       f21.setLegalValues(values);
/* 108 */       f21.setMetaType(SimpleMetaType.STRING);
/* 109 */       ManagedPropertyImpl dsType = new ManagedPropertyImpl(typeMO, f21);
/* 110 */       typeMO.getProperties().put("datasource-type", dsType);
/* 111 */       wrapMO = WrapperAdvice.wrapManagedObject(typeMO);
/* 112 */       map.put(attachName, wrapMO);
/*    */     }
/*    */   }
View Full Code Here

/*  88 */           MetaType[] itemTypes = { SimpleMetaType.STRING, SimpleMetaType.STRING };
/*  89 */           CompositeMetaType propsType = new ImmutableCompositeMetaType("java.lang.Properties", "DS connection properties", itemNames, itemDescriptions, itemTypes);
/*     */
/*  91 */           attrFields.setMetaType(propsType);
/*     */         }
/*  93 */         properties.add(new ManagedPropertyImpl(this, attrFields));
/*     */       }
/*     */     }
/*     */     catch (RuntimeException e)
/*     */     {
/*     */       Collection properties;
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.