Package org.jboss.managed.api.factory

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


         SimpleValue dsTypeSV = (SimpleValue) dsTypeMP.getValue();
         cfType = dsTypeSV.getValue().toString();
      }

      ManagedConnectionFactoryDeploymentMetaData mcf;
      ManagedObjectFactory mof = ManagedObjectFactoryBuilder.create();
      ManagedObject cfMO;

      String rootElementName = "datasources";
      if("local-tx-datasource".equals(cfType))
      {
         mcf = new LocalDataSourceDeploymentMetaData();
         mof.setInstanceClassFactory(LocalDataSourceDeploymentMetaData.class, new LocalDSInstanceClassFactory(mof));
         cfMO = mof.initManagedObject(mcf,
            KnownComponentTypes.DataSourceTypes.LocalTx.getType().getType(),
            KnownComponentTypes.DataSourceTypes.LocalTx.getType().getSubtype());
      }
      else if("xa-datasource".equals(cfType))
      {
         mcf = new XADataSourceDeploymentMetaData();
         mof.setInstanceClassFactory(XADataSourceDeploymentMetaData.class, new XADSInstanceClassFactory(mof));
         cfMO = mof.initManagedObject(mcf,
            KnownComponentTypes.DataSourceTypes.XA.getType().getType(),
            KnownComponentTypes.DataSourceTypes.XA.getType().getSubtype());
      }
      else if("tx-connection-factory".equals(cfType))
      {
         rootElementName = "connection-factories";
         mcf = new TxConnectionFactoryDeploymentMetaData();
         mof.setInstanceClassFactory(TxConnectionFactoryDeploymentMetaData.class, new TxInstanceClassFactory(mof));
         cfMO = mof.initManagedObject(mcf,
            KnownComponentTypes.ConnectionFactoryTypes.XA.getType().getType(),
            KnownComponentTypes.ConnectionFactoryTypes.XA.getType().getSubtype());
      }
      else if("no-tx-connection-factory".equals(cfType))
      {
         rootElementName = "connection-factories";
         mcf = new NoTxConnectionFactoryDeploymentMetaData();
         mof.setInstanceClassFactory(NoTxConnectionFactoryDeploymentMetaData.class, new NoTxCFInstanceClassFactory(mof));
         cfMO = mof.initManagedObject(mcf,
            KnownComponentTypes.ConnectionFactoryTypes.NoTx.getType().getType(),
            KnownComponentTypes.ConnectionFactoryTypes.NoTx.getType().getSubtype());
      }
      else if("no-tx-datasource".equals(cfType))
      {
         mcf = new NoTxDataSourceDeploymentMetaData();
         mof.setInstanceClassFactory(NoTxDataSourceDeploymentMetaData.class, new NoTxInstanceClassFactory(mof));
         cfMO = mof.initManagedObject(mcf,
            KnownComponentTypes.DataSourceTypes.NoTx.getType().getType(),
            KnownComponentTypes.DataSourceTypes.NoTx.getType().getSubtype());
      }
      else
         throw new IllegalStateException("Unexpected value connection factory type: " + cfType);
View Full Code Here


      Map<String, ManagedObject> managedObjects)
      throws DeploymentException
   {
      MetaData metaData = unit.getMetaData();

      ManagedObjectFactory factory = mof;
      if(factory == null )
         factory = ManagedObjectFactoryBuilder.create();

      for(String name : attachments)
      {
         Object instance = unit.getAttachment(name);
         if (instance != null)
         {
            ManagedObject mo = factory.initManagedObject(instance, metaData);
            if (mo != null)
               managedObjects.put(mo.getName(), mo);
         }
      }
   }
View Full Code Here

    * Test the transformer value of the annotation
    */
   public void testClassLoadingMXBean()
   {
      super.enableTrace("org.jboss.managed.plugins.factory");
      ManagedObjectFactory mof = getMOF();
      ManagedObject mo = ManagementFactoryUtils.getClassLoadingMO(mof);
      assertNotNull(mo);
      assertEquals(ManagementFactory.CLASS_LOADING_MXBEAN_NAME, mo.getName());
      validateComponentType(mo);
      assertEquals(ManagementFactory.CLASS_LOADING_MXBEAN_NAME, mo.getComponentName());
View Full Code Here

     
   }

   public void testMemoryMXBean()
   {
      ManagedObjectFactory mof = getMOF();
      ManagedObject mo = ManagementFactoryUtils.getMemoryMXBean(mof);
      assertNotNull(mo);
      assertEquals(ManagementFactory.MEMORY_MXBEAN_NAME, mo.getName());
      validateComponentType(mo);
View Full Code Here

   }

   public void testThreadMXBean()
      throws Exception
   {
      ManagedObjectFactory mof = getMOF();
      ManagedObject mo = ManagementFactoryUtils.getThreadMXBean(mof);
      assertNotNull(mo);
      assertEquals(ManagementFactory.THREAD_MXBEAN_NAME, mo.getName());
      validateComponentType(mo);
     
View Full Code Here

   }

   public void testRuntimeMXBean()
   {
      ManagedObjectFactory mof = getMOF();
      ManagedObject mo = ManagementFactoryUtils.getRuntimeMXBean(mof);
      assertNotNull(mo);
      assertEquals(ManagementFactory.RUNTIME_MXBEAN_NAME, mo.getName());
      validateComponentType(mo);
View Full Code Here

         // assertEquals(key, p1, p2);
      }
   }
   public void testOperatingSystemMXBean()
   {
      ManagedObjectFactory mof = getMOF();
      ManagedObject mo = ManagementFactoryUtils.getOperatingSystemMXBean(mof);
      assertNotNull(mo);
      assertEquals(ManagementFactory.OPERATING_SYSTEM_MXBEAN_NAME, mo.getName());
      validateComponentType(mo);
View Full Code Here

      assertNotNull(version);
      log.debug(version.getValue());
   }
   public void testMemoryManagerMXBeans()
   {
      ManagedObjectFactory mof = getMOF();
      List<ManagedObject> mos = ManagementFactoryUtils.getMemoryManagerMXBeans(mof);
      assertTrue(mos.size() > 0);
      for(ManagedObject mo : mos)
      {
         ManagedProperty nameMP = mo.getProperty("name");
View Full Code Here

         validateComponentType(mo);
      }
   }
   public void testMemoryPoolMXBeans()
   {
      ManagedObjectFactory mof = getMOF();
      List<ManagedObject> mos = ManagementFactoryUtils.getMemoryPoolMXBeans(mof);
      assertTrue(mos.size() > 0);
      for(ManagedObject mo : mos)
      {
         ManagedProperty nameMP = mo.getProperty("name");
View Full Code Here

         validateComponentType(mo);
      }
   }
   public void testGarbageCollectorMXBeans()
   {
      ManagedObjectFactory mof = getMOF();
      List<ManagedObject> mos = ManagementFactoryUtils.getGarbageCollectorMXBeans(mof);
      assertTrue(mos.size() > 0);
      for(ManagedObject mo : mos)
      {
         log.debug("GC.MO.props: "+mo.getPropertyNames());
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.