Package org.jboss.managed.api.factory

Examples of org.jboss.managed.api.factory.ManagedObjectFactory


      BigDecimal bigDecimal = new BigDecimal(10);
      SimpleUnannotated simple = new SimpleUnannotated();
      simple.setBigDecimalValue(bigDecimal);

      ManagedObjectFactory mof = getMOF();
      ManagedObject managedObject = mof.initManagedObject(simple, metaData);
      assertEquals("testMetaDataRepositoryOverride", managedObject.getName());
      Map<String, Annotation> moAnnotations = managedObject.getAnnotations();
      assertEquals("MO annotations == 2;", 2, moAnnotations.size());
      ManagementObject moAnn = (ManagementObject) moAnnotations.get(ManagementObject.class.getName());
      ManagementComponent componentType = moAnn.componentType();
View Full Code Here


    */
   public void testMCFHierarchy()
      throws Exception
   {
      ManagedConnectionFactoryDeploymentGroup mcf = initMCFDG();
      ManagedObjectFactory mof = getMOF();
      ManagedObject mcfMO = mof.initManagedObject(mcf, "ManagedConnectionFactoryDeploymentGroup", null);
      ManagedProperty deployments = mcfMO.getProperty("deployments");
      Object dvalue = deployments.getValue();
      assertTrue(dvalue.getClass()+"", dvalue instanceof CollectionValue);
      CollectionValue cv = (CollectionValue) dvalue;
      assertEquals(1, cv.getSize());
View Full Code Here

    */
   public void testManagedConnectionFactoryPropertyMetaData()
      throws Exception
   {
      ManagedConnectionFactoryDeploymentGroup mcf = initMCFDG();
      ManagedObjectFactory mof = getMOF();
      LocalDSInstanceClassFactory dsicf = new LocalDSInstanceClassFactory();
      mof.addInstanceClassFactory(dsicf);
      ManagedObject mcfMO = mof.initManagedObject(mcf, "ManagedConnectionFactoryDeploymentGroup", null);
      ManagedProperty deployments = mcfMO.getProperty("deployments");
      Object dvalue = deployments.getValue();
      assertTrue(dvalue.getClass()+"", dvalue instanceof CollectionValue);
      CollectionValue cv = (CollectionValue) dvalue;
      assertEquals(1, cv.getSize());
View Full Code Here

    * Override to allow test specific ManagedObjectFactory
    */
   @Override
   protected ManagedObjectFactory getMOF()
   {
      ManagedObjectFactory mof = testMOF;
      if (mof == null)
         mof = super.getMOF();
      return mof;
   }
View Full Code Here

      super(name);
   }

   public void testAnnotationScan() throws Exception
   {
      ManagedObjectFactory mof = ManagedObjectFactory.getInstance();
      ManagedObject mo = mof.createManagedObject(DSMetaData.class, null);

      Map<String, ManagedProperty> props = mo.getProperties();
      log.info("DSMetaData props: "+props);
      assertEquals(2, props.size());
   }
View Full Code Here

   public void testComponentNameAndSetValue() throws Exception
   {
      DeployerClient main = getMainDeployer();
      MockProfileService ps = new MockProfileService(main);
      ManagedObjectFactory mof = ManagedObjectFactory.getInstance();
      TestServiceMetaDataICF tsicf = new TestServiceMetaDataICF();
      mof.setInstanceClassFactory(TestServiceMetaData.class, tsicf);

      // Deploy a datasource with local and xa factories
      Deployment ctx1 = createSimpleDeployment("deployment1");
      MutableAttachments a1 = (MutableAttachments) ctx1.getPredeterminedManagedObjects();
View Full Code Here

   public void testManagedDeployment() throws Exception
   {
      DeployerClient main = getMainDeployer();
      MockProfileService ps = new MockProfileService(main);
      ManagedObjectFactory mof = ManagedObjectFactory.getInstance();
      TestServiceMetaDataICF tsicf = new TestServiceMetaDataICF();
      mof.setInstanceClassFactory(TestServiceMetaData.class, tsicf);

      // Deploy a datasource with local and xa factories
      Deployment ctx1 = createSimpleDeployment("deployment1");
      DSMetaData dsmd = new DSMetaData();
      dsmd.setDiplayName("deployment1 DS");
View Full Code Here

    *
    */
   @SuppressWarnings("unchecked")
   public void testDSMetaDataManagedObjectFactory()
   {
      ManagedObjectFactory mof = ManagedObjectFactory.getInstance();
      ManagedObject mo = mof.createManagedObject(DSMetaData.class, null);

      // Validate the expected properties
      Map<String, ManagedProperty> propsMap = mo.getProperties();
      assertEquals(2, propsMap.size());
      log.info("DSMetaData properties: "+propsMap);
View Full Code Here

    *
    */
   @SuppressWarnings("unchecked")
   public void testDSMetaDataManagedObjectFactoryInit()
   {
      ManagedObjectFactory mof = ManagedObjectFactory.getInstance();
      DSMetaData dsmd = new DSMetaData();
      LocalDataSourceMetaData ds = new LocalDataSourceMetaData();
      XADataSourceMetaData xads = new XADataSourceMetaData();
      ArrayList<ConnMetaData> deployments = new ArrayList<ConnMetaData>();
      deployments.add(ds);
      deployments.add(xads);
      dsmd.setDeployments(deployments);
      ManagedObject mo = mof.initManagedObject(dsmd, null, null);

      // Validate the expected properties
      Map<String, ManagedProperty> propsMap = mo.getProperties();
      assertEquals(2, propsMap.size());
      log.info("DSMetaData properties: "+propsMap);
View Full Code Here

   public void build(DeploymentUnit unit, Set<String> outputs,
      Map<String, ManagedObject> managedObjects)
      throws DeploymentException
   {
      ManagedObjectFactory factory = ManagedObjectFactoryBuilder.create();
      Map<String, Object> attachments = unit.getAttachments();
      for(Object metaData : attachments.values() )
      {
         if( metaData instanceof Serializable )
         {
            Serializable smetaData = Serializable.class.cast(metaData);
            ManagedObject mo = factory.initManagedObject(smetaData, null, null);
            if (mo != null)
               managedObjects.put(mo.getName(), mo);
         }
      }
   }
View Full Code Here

TOP

Related Classes of org.jboss.managed.api.factory.ManagedObjectFactory

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.