Package org.jboss.system.metadata

Examples of org.jboss.system.metadata.ServiceTextValueMetaData


  
   public ServiceAttributeMetaData buildSimpleAttribute(String name, String value)
   {
      ServiceAttributeMetaData att = new ServiceAttributeMetaData();
      att.setName(name);
      ServiceTextValueMetaData dep = new ServiceTextValueMetaData(value);
      att.setValue(dep);
      return att;
     
   }
View Full Code Here


         }
  
         // Unwrap the ServiceValueMetaData types
         if (value instanceof ServiceTextValueMetaData)
         {
            ServiceTextValueMetaData text = (ServiceTextValueMetaData) value;
            value = text.getText();
         }
         else if (value instanceof ServiceDependencyValueMetaData)
         {
            ServiceDependencyValueMetaData depends = (ServiceDependencyValueMetaData) value;
            value = depends.getDependency();
View Full Code Here

            if(aname != null)
            {
               ServiceAttributeMetaData attr = new ServiceAttributeMetaData();
               attr.setName(aname);
               md.addAttribute(attr);
               attributeValue = new ServiceTextValueMetaData("");
               attr.setValue(attributeValue);
            }
         }
         if (attributeValue != null)
         {
            // Unwrap the ServiceValueMetaData types
            if (attributeValue instanceof ServiceTextValueMetaData)
            {
               ServiceTextValueMetaData text = (ServiceTextValueMetaData) attributeValue;
               text.setText(String.valueOf(plainValue));
            }
            else if (value instanceof ServiceDependencyValueMetaData)
            {
               ServiceDependencyValueMetaData depends = (ServiceDependencyValueMetaData) attributeValue;
               depends.setDependency(String.valueOf(plainValue));
View Full Code Here

         // Unwrap the ServiceValueMetaData types
         try
         {
            if (value instanceof ServiceTextValueMetaData)
            {
               ServiceTextValueMetaData text = (ServiceTextValueMetaData) value;
               try
               {
                  // TODO: cache this somehow
                  HashMap<String, MBeanAttributeInfo> attrs = ServiceConfigurator.getAttributeMap(mbeanServer, mbean);
                  MBeanAttributeInfo mbi = attrs.get(attrName);
                  ServiceValueContext svc = new ServiceValueContext(mbeanServer, controller, mbi, loader);
                  value = text.getValue(svc);
               }
               catch(Exception e)
               {
                  // TODO: better way to determine if the bean was installed, as this does not make much sense
                  PropertyEditor editor = PropertyEditors.getEditor(metaType.getTypeName());
                  editor.setAsText(text.getText());
                  value = editor.getValue();
               }
            }
            else if (value instanceof ServiceDependencyValueMetaData)
            {
View Full Code Here

               {                
                  // Create a text value
                  String textValue = String.valueOf(plainValue);
                  // Don't create a empty value
                  if(textValue.trim().length() > 0 )
                     attributeValue = new ServiceTextValueMetaData(textValue);
               }
               // Don't create a null serviceAttribute
               if(attributeValue == null)
                  return;
              
               // Add
               attr.setValue(attributeValue);
               md.addAttribute(attr);
            }
         }
         if (attributeValue != null)
         {
            // Unwrap the ServiceValueMetaData types
            if (attributeValue instanceof ServiceTextValueMetaData)
            {
               String textValue = plainValue != null ? String.valueOf(plainValue) : null;
               ServiceTextValueMetaData text = (ServiceTextValueMetaData) attributeValue;
               text.setText(textValue);
            }
            else if (attributeValue instanceof ServiceElementValueMetaData)
            {
               if(plainValue != null)
                  ((ServiceElementValueMetaData) attributeValue).setElement((Element) plainValue);
View Full Code Here

/* 178 */     ServiceAttributeMetaData attribute = new ServiceAttributeMetaData();
/*     */
/* 180 */     attribute.setName("JndiName");
/* 181 */     attribute.setReplace(true);
/* 182 */     attribute.setTrim(true);
/* 183 */     attribute.setValue(new ServiceTextValueMetaData(jndiName));
/* 184 */     attributes.add(attribute);
/*     */
/* 186 */     attribute = new ServiceAttributeMetaData();
/* 187 */     attribute.setName("JdbcURL");
/* 188 */     if (ds.getJdbcURL() != null)
/* 189 */       attribute.setValue(new ServiceTextValueMetaData(ds.getJdbcURL()));
/* 190 */     attributes.add(attribute);
/*     */
/* 192 */     attribute = new ServiceAttributeMetaData();
/* 193 */     attribute.setName("DriverClass");
/* 194 */     if (ds.getDriverClass() != null)
/* 195 */       attribute.setValue(new ServiceTextValueMetaData(ds.getDriverClass()));
/* 196 */     attributes.add(attribute);
/*     */
/* 198 */     attribute = new ServiceAttributeMetaData();
/* 199 */     attribute.setName("Username");
/* 200 */     if (ds.getUsername() != null)
/* 201 */       attribute.setValue(new ServiceTextValueMetaData(ds.getUsername()));
/* 202 */     attributes.add(attribute);
/*     */
/* 204 */     attribute = new ServiceAttributeMetaData();
/* 205 */     attribute.setName("Password");
/* 206 */     if (ds.getPassword() != null)
/* 207 */       attribute.setValue(new ServiceTextValueMetaData(ds.getPassword()));
/* 208 */     attributes.add(attribute);
/*     */
/* 210 */     attribute = new ServiceAttributeMetaData();
/* 211 */     attribute.setName("SecurityDomain");
/* 212 */     if (ds.getSecurityDomain() != null)
/* 213 */       attribute.setValue(new ServiceTextValueMetaData(ds.getSecurityDomain()));
/* 214 */     attributes.add(attribute);
/*     */
/* 216 */     attribute = new ServiceAttributeMetaData();
/* 217 */     attribute.setName("MinPoolSize");
/* 218 */     if (ds.getMinPoolSize() != null)
/* 219 */       attribute.setValue(new ServiceTextValueMetaData(ds.getMinPoolSize()));
/* 220 */     attributes.add(attribute);
/*     */
/* 222 */     attribute = new ServiceAttributeMetaData();
/* 223 */     attribute.setName("MaxPoolSize");
/* 224 */     if (ds.getMaxPoolSize() != null)
/* 225 */       attribute.setValue(new ServiceTextValueMetaData(ds.getMaxPoolSize()));
/* 226 */     attributes.add(attribute);
/*     */
/* 228 */     attribute = new ServiceAttributeMetaData();
/* 229 */     attribute.setName("ConnectionProperties");
/* 230 */     if (ds.getMaxPoolSize() != null)
/* 231 */       attribute.setValue(new ServiceTextValueMetaData(ds.getMaxPoolSize()));
/* 232 */     attributes.add(attribute);
/*     */
/* 234 */     dsMbean.setAttributes(attributes);
/*     */
/* 237 */     Collection depends = ds.getDepends();
View Full Code Here

/*     */
/*     */   public ServiceAttributeMetaData buildSimpleAttribute(String name, String value)
/*     */   {
/*  89 */     ServiceAttributeMetaData att = new ServiceAttributeMetaData();
/*  90 */     att.setName(name);
/*  91 */     ServiceTextValueMetaData dep = new ServiceTextValueMetaData(value);
/*  92 */     att.setValue(dep);
/*  93 */     return att;
/*     */   }
View Full Code Here

/*     */       }
/*     */     }
/*     */
/* 125 */     if ((value instanceof ServiceTextValueMetaData))
/*     */     {
/* 127 */       ServiceTextValueMetaData text = (ServiceTextValueMetaData)value;
/* 128 */       value = text.getText();
/*     */     }
/* 130 */     else if ((value instanceof ServiceDependencyValueMetaData))
/*     */     {
/* 132 */       ServiceDependencyValueMetaData depends = (ServiceDependencyValueMetaData)value;
/* 133 */       value = depends.getDependency();
View Full Code Here

/* 172 */       PropertyInfo propertyInfo = beanInfo.getProperty(name);
/* 173 */       Object plainValue = this.metaValueFactory.unwrap(value, propertyInfo.getType());
/*     */
/* 176 */       if ((attributeValue instanceof ServiceTextValueMetaData))
/*     */       {
/* 178 */         ServiceTextValueMetaData text = (ServiceTextValueMetaData)attributeValue;
/* 179 */         text.setText(String.valueOf(plainValue));
/*     */       }
/* 181 */       else if ((value instanceof ServiceDependencyValueMetaData))
/*     */       {
/* 183 */         ServiceDependencyValueMetaData depends = (ServiceDependencyValueMetaData)attributeValue;
/* 184 */         depends.setDependency(String.valueOf(plainValue));
View Full Code Here

/*    */
/*    */   public Serializable getField(String name)
/*    */   {
/* 74 */     if ("value".equals(name))
/*    */     {
/* 76 */       ServiceTextValueMetaData text = (ServiceTextValueMetaData)this.metaData.getValue();
/* 77 */       return text.getText();
/*    */     }
/* 79 */     return super.getField(name);
/*    */   }
View Full Code Here

TOP

Related Classes of org.jboss.system.metadata.ServiceTextValueMetaData

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.