Package org.jboss.managed.plugins

Examples of org.jboss.managed.plugins.ManagedPropertyImpl


   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


      DefaultFieldsImpl fields = new DefaultFieldsImpl("dsType");
      fields.setDescription("The datasource type");
      fields.setMetaType(SimpleMetaType.STRING);
      fields.setValue(SimpleValueSupport.wrap(dsType));
      fields.setField(Fields.READ_ONLY, Boolean.TRUE);
      ManagedPropertyImpl dsTypeMP = new ManagedPropertyImpl(fields);
      addProperty(dsTypeMP);
     
      // DataSource
//      if("local-tx-datasource".equals(dsType))
//         createLocalTxDsTemplate();
View Full Code Here

            String mappedName = propertyNameMappings.get(name);
            if( mappedName != null )
               f.setField(Fields.MAPPED_NAME, mappedName);
         }
        
         ManagedPropertyImpl newProperty = new ManagedPropertyImpl(f);
        
         MetaValue v = defaultValues.get(name);
         if(v != null)
         {
            newProperty.setValue(v);
         }
        
         // Override
         addProperty(newProperty);
      }
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

    * @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

      DefaultFieldsImpl fields = new DefaultFieldsImpl();
      fields.setDescription(fieldDescr);
      fields.setMandatory(mandatory);
      fields.setMetaType(metaType);
      fields.setName(fieldName);
      ManagedPropertyImpl mp = new ManagedPropertyImpl(mo, fields);
      if(isID)
      {
         Map<String, Annotation> annotations = new HashMap<String, Annotation>();
         Map<String, Object> idFields = Collections.emptyMap();
         try
         {
            ManagementObjectID id = (ManagementObjectID) AnnotationProxy.createProxy(idFields, ManagementObjectID.class);
            annotations.put(ManagementObjectID.class.getName(), id);
            mp.setAnnotations(annotations);
         }
         catch(Exception e)
         {
            throw new UndeclaredThrowableException(e);
         }
      }

      super.addProperty(mp);
      if(value != null)
         mp.setValue(value);
   }
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

    */
   @ManagementProperty(name="runtime-stat", use={ViewUse.STATISTIC})
   public void testViewUseField()
      throws Exception
   {
      ManagedPropertyImpl mp = new ManagedPropertyImpl("runtime");
      mp.setMetaType(SimpleMetaType.LONG);
      mp.setValue(SimpleValueSupport.wrap(1000));
      mp.setViewUse(new ViewUse[]{ViewUse.RUNTIME});
      assertTrue("has ViewUse.RUNTIME", mp.hasViewUse(ViewUse.RUNTIME));

      ManagedPropertyImpl mp2 = new ManagedPropertyImpl("runtime-stat");
      mp2.setMetaType(SimpleMetaType.LONG);
      mp2.setValue(SimpleValueSupport.wrap(1000));
      mp2.setViewUse(new ViewUse[]{ViewUse.RUNTIME, ViewUse.STATISTIC});
      assertTrue("has ViewUse.RUNTIME", mp2.hasViewUse(ViewUse.RUNTIME));
      assertTrue("has ViewUse.STATISTIC", mp2.hasViewUse(ViewUse.STATISTIC));

      ManagedPropertyImpl mp3 = new ManagedPropertyImpl("runtime-stat");
      mp3.setMetaType(SimpleMetaType.LONG);
      mp3.setValue(SimpleValueSupport.wrap(1000));
      mp3.setViewUse(new ViewUse[]{ViewUse.RUNTIME});
      HashMap<String, Annotation> annotations = new HashMap<String, Annotation>();
      ManagementProperty mpa = getClass().getMethod("testViewUseField", null).getAnnotation(ManagementProperty.class);
      annotations.put(ManagementProperty.class.getName(), mpa);
      mp3.setAnnotations(annotations);
      assertTrue("has ViewUse.RUNTIME", mp3.hasViewUse(ViewUse.RUNTIME));
      assertTrue("has ViewUse.STATISTIC", mp3.hasViewUse(ViewUse.STATISTIC));
   }
View Full Code Here

      {
         throw new RuntimeException("Error creating dom", e);
      }
     
      Map<String, ManagedProperty> properties = getProperties();
      properties.put("jndi-name", new ManagedPropertyImpl(this, new MockDOMFields(element, "jndi-name")));
      properties.put("connection-url", new ManagedPropertyImpl(this, new MockDOMFields(element, "connection-url")));
      properties.put("user", new ManagedPropertyImpl(this, new MockDOMFields(element, "user")));
      properties.put("password", new ManagedPropertyImpl(this, new MockDOMFields(element, "password")));
   }
View Full Code Here

      {
         attachment = attachment.clone();
         ManagedObjectImpl managedObject = new ManagedObjectImpl(TestAttachment.class.getName());
         managedObject.setAttachment(attachment);
         Map<String, ManagedProperty> properties = managedObject.getProperties();
         properties.put("string1", new ManagedPropertyImpl(managedObject, new TestFields(attachment, "string1")));
         properties.put("string2", new ManagedPropertyImpl(managedObject, new TestFields(attachment, "string2")));
         managedObjects.put(TestAttachment.class.getName(), managedObject);
      }
   }
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.