Examples of ManagedObject


Examples of org.jboss.managed.api.ManagedObject

      // Initial parsing of the dataSource deployment
      ManagedConnectionFactoryDeploymentGroup deployment = parseDataSource("profileservice/persistence/profileservice-test-ds.xml");
      assertNotNull(deployment);

      ManagedObject mo = getMOF().initManagedObject(deployment, null);

      ManagedComponent c = createDSComponent(mo);
      // Change values
      c.getProperty("min-pool-size").setValue(SimpleValueSupport.wrap(13));
      c.getProperty("max-pool-size").setValue(SimpleValueSupport.wrap(53));
View Full Code Here

Examples of org.jboss.managed.api.ManagedObject

  
   protected ManagedComponent createDSComponent(ManagedObject deployment)
   {
      CollectionValue collection = (CollectionValue) deployment.getProperty("deployments").getValue();
      GenericValue generic = (GenericValue) collection.iterator().next();
      ManagedObject mo = (ManagedObject) generic.getValue();
      return createComponent(mo);
   }
View Full Code Here

Examples of org.jboss.managed.api.ManagedObject

     
      @Override
      protected PersistedComponent createComponent(Object attachment, ManagedComponent component)
      {
         // Note: this is using the TestMgtComponentImpl to get the MO
         ManagedObject mo = (ManagedObject) component.getParent();
         PersistedManagedObject persisted = getPersistencePlugin().createPersistedManagedObject(mo);
         PersistedComponent persistedComponent = new PersistedComponent(persisted);
         setComponentName(persistedComponent, mo);
         return persistedComponent;
      }
View Full Code Here

Examples of org.jboss.managed.api.ManagedObject

     
      // Add the testmapper
      addComponentMapper(new TestMapper(getPersistenceFactory()));
     
      // create
      ManagedObject deploymentMO = getDeploymentMO(xmlName);

      ManagedComponent component = createJMSComponent(deploymentMO);
     
      // update property
      component.getProperty("downCacheSize").setValue(SimpleValueSupport.wrap(123456));
     
      ServiceDeployment deployment = parseJbossServiceXml(xmlName);
      PersistenceRoot root = updateComponent(deploymentMO, component);
      getPersistenceFactory().restorePersistenceRoot(root, deployment, null);
     
      //
      ManagedObject restored = getMOF().initManagedObject(deployment, null);
      component = createJMSComponent(restored);
     
      // assert
      assertEquals(SimpleValueSupport.wrap(123456),  component.getProperty("downCacheSize").getValue());
     
View Full Code Here

Examples of org.jboss.managed.api.ManagedObject

      assertNotNull(serviceDeploymentMO);
      CollectionValue collection = (CollectionValue) serviceDeploymentMO.getProperty("services").getValue();
      assertNotNull(collection);
      GenericValue topic = (GenericValue) collection.iterator().next();
      assertNotNull(topic);
      ManagedObject topicMO = (ManagedObject) topic.getValue();
      return createComponent(topicMO);
   }
View Full Code Here

Examples of org.jboss.managed.api.ManagedObject

      assertNotNull(serviceDeploymentMO);
      CollectionValue collection = (CollectionValue) serviceDeploymentMO.getProperty("services").getValue();
      assertNotNull(collection);
      GenericValue topic = (GenericValue) collection.iterator().next();
      assertNotNull(topic);
      ManagedObject topicMO = (ManagedObject) topic.getValue();
      assertNotNull(topicMO);
     
      // downCacheSize
      return topicMO.getProperty(propertyName);
   }
View Full Code Here

Examples of org.jboss.managed.api.ManagedObject

      }
     
      protected PersistedComponent createComponent(Object attachment, ManagedComponent component)
      {
         // Note: this is using the TestMgtComponentImpl to get the MO
         ManagedObject mo = (ManagedObject) component.getParent();
         PersistedManagedObject persisted = getPersistencePlugin().createPersistedManagedObject(mo);
         PersistedComponent persistedComponent = new PersistedComponent(persisted);
         setComponentName(persistedComponent, mo);
         return persistedComponent;
      }
View Full Code Here

Examples of org.jboss.managed.api.ManagedObject

      KernelDeployment deployment = createKernelDeployment(BEAN_NAMES);
      // install
      installDeployment(deployment);
     
      // Create the managed objects
      ManagedObject deploymentMO = getMOF().initManagedObject(deployment, null);
      ManagedObject mo = getBeanMO("SimpleAnnotatedBean");
      assertNotNull("null mo", mo);
      assertTrue(mo.getAttachment() instanceof BeanMetaData);
      ManagedComponent component = createComponent(mo);
      assertNotNull(component);
      assertEquals(component.getAttachmentName(), SimpleAnnotatedBean.class.getName());

      // Change value
      component.getProperty("stringProperty").setValue(SimpleValueSupport.wrap("changedTestValue"));
     
      PersistenceRoot root = updateComponent(deploymentMO, component);
      assertNotNull(root);

      // Uninstall for offline attachment persistence
      uninstallDeployment(deployment);
     
      // Recreate the kernel deployment
      deployment = createKernelDeployment(BEAN_NAMES);
      getPersistenceFactory().restorePersistenceRoot(root, deployment, null);
     
      // check bean meta data
      BeanMetaData bmd = getBeanMetaData(deployment, "SimpleAnnotatedBean");
      boolean sawProperty = false;
      for(PropertyMetaData prop : bmd.getProperties())
      {
         if(prop.getName().equals("stringProperty"))
         {
            assertEquals("changedTestValue", prop.getValue().getUnderlyingValue());
            sawProperty = true;
         }
      }
      assertTrue(sawProperty);
     
      // install
      installDeployment(deployment);
      mo = getBeanMO("SimpleAnnotatedBean");
      assertNotNull(mo);
     
      assertEquals(SimpleValueSupport.wrap("changedTestValue"),
            mo.getProperty("stringProperty").getValue());

   }
View Full Code Here

Examples of org.jboss.managed.api.ManagedObject

      }
     
      protected PersistedComponent createComponent(Object attachment, ManagedComponent component)
      {
         // Note: this is using the TestMgtComponentImpl to get the MO
         ManagedObject mo = (ManagedObject) component.getParent();
         PersistedManagedObject persisted = getPersistencePlugin().createPersistedManagedObject(mo);
         PersistedComponent persistedComponent = new PersistedComponent(persisted);
         setComponentName(persistedComponent, mo);
         return persistedComponent;
      }
View Full Code Here

Examples of org.jboss.managed.api.ManagedObject

      assertNotNull(ctx);
      BeanMetaData bmd = ctx.getBeanMetaData();
      assertNotNull(bmd);

      // Create the ManagedObjects
      ManagedObject deploymentMO = getMOF().initManagedObject(deployment, null);
      ManagedObject mo = getMOF().initManagedObject(bmd, null);
      assertNotNull(mo);
      // Change the value
      CollectionValue bindingSets = (CollectionValue) mo.getProperty("standardBindings").getValue();
      assertNotNull(bindingSets);
      setPortValue("HttpsConnector", bindingSets, 13245);

      // Persist
      ManagedComponent component = new ManagedComponentImpl(null, null, mo);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.