Package org.jboss.managed.api

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


  
   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

      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

      }
     
      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

      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 TempManagedComponentImpl(null, null, mo);
View Full Code Here

   protected DeploymentTemplateInfo assertTemplate(String name, Class<?> clazz) throws Exception
   {
      DeploymentTemplateInfo info = createDeploymentInfo(name, clazz);
      assertNotNull(info);
     
      ManagedObject mo = mof.createManagedObject(clazz);
      assertNotNull(mo);

      log.debug(">> " + info.getName());
      assertTemplateInfo(info, mo);     
     
View Full Code Here

      assertEquals("Correct number of operations", 8, operationNames.size());
     
      for (Map.Entry<String, ManagedProperty> entry : mc.getProperties().entrySet())
      {
         getLog().debug(entry.getKey() + " == " + entry.getValue());
         ManagedObject mo = entry.getValue().getTargetManagedObject();
         if (mo != null)
         {
            getLog().debug(entry.getKey() + " -- ManagedObject == " + mo);
         }
      }
View Full Code Here

     
      @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

     
      // 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

      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

TOP

Related Classes of org.jboss.managed.api.ManagedObject

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.