Package org.jboss.beans.metadata.spi.builder

Examples of org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder.addAnnotation()


            BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder(hibernateStatisticsServiceName, StatisticsService.class.getName());
            StringBuffer buffer = new StringBuffer();
            buffer.append("@").append(JMX.class.getName()).append("(name=\"").append(hibernateStatisticsServiceName).append("JMX\"");
            buffer.append(", exposedInterface=").append(StatisticsServiceMBean.class.getName()).append(".class, registerDirectly=true)");
            String jmxAnnotation = buffer.toString();
            builder.addAnnotation(jmxAnnotation);
            controller.install(builder.getBeanMetaData(), hibernateStatisticsService);
         }

         // Handle JNDI binding....        
         bind();
View Full Code Here


   }
  
   protected BeanMetaDataFactory createBeanDataFactory(String name)
   {
      BeanMetaDataBuilder b = BeanMetaDataBuilder.createBuilder(name, SimpleAnnotatedBean.class.getName());
      b.addAnnotation("@org.jboss.managed.api.annotation.ManagementObject(name=\""+ name +"\")");
      b.addPropertyMetaData("stringProperty", "test" + name);
      return b.asBeanMetaDataFactory();
   }
   private static final class TestMapper extends KernelDeploymentComponentMapper
View Full Code Here

         String newName = "ScopedAlias_" + sequence + "_" + name;
     
         BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder(bean);
        
         //Set the alias to the original name
         builder.addAnnotation(new AliasesImpl(name));
        
         //Set the domain name
         builder.addAnnotation(scopeAnnotation);
     
         //set the new name used by the controller for managing beans
View Full Code Here

        
         //Set the alias to the original name
         builder.addAnnotation(new AliasesImpl(name));
        
         //Set the domain name
         builder.addAnnotation(scopeAnnotation);
     
         //set the new name used by the controller for managing beans
         builder.setName(newName);
        
         //Debug stuff
View Full Code Here

        }
        // Setup the fourth constructor argument (temp war directory).
        File esbWarFiles = JBossDeployerUtil.createDir(tmpDir, "esbwarfiles");
        bmdBuilder.addConstructorParameter(File.class.getName(), esbWarFiles);
        // Add management annotation.
        bmdBuilder.addAnnotation("@org.jboss.aop.microcontainer.aspects.jmx.JMX(registerDirectly=true, exposedInterface=void.class, name=\"" + mbeanName + "\")");

        // Add default dependencies.
        for (String dependency : defaultDeps)
        {
            bmdBuilder.addDependency(dependency);
View Full Code Here

        }
        // Setup the fourth constructor argument (temp war directory).
        File esbWarFiles = JBossDeployerUtil.createDir(tmpDir, "esbwarfiles");
        bmdBuilder.addConstructorParameter(File.class.getName(), esbWarFiles);
        // Add management annotation.
        bmdBuilder.addAnnotation("@org.jboss.aop.microcontainer.aspects.jmx.JMX(registerDirectly=true, exposedInterface=void.class, name=\"" + mbeanName + "\")");

        // Add default dependencies.
        for (String dependency : defaultDeps)
        {
            bmdBuilder.addDependency(dependency);
View Full Code Here

   }
  
   protected BeanMetaDataFactory createBeanDataFactory(String name)
   {
      BeanMetaDataBuilder b = BeanMetaDataBuilder.createBuilder(name, SimpleAnnotatedBean.class.getName());
      b.addAnnotation("@org.jboss.managed.api.annotation.ManagementObject(name=\""+ name +"\")");
      b.addPropertyMetaData("stringProperty", "test" + name);
      return b.asBeanMetaDataFactory();
   }
   private static final class TestMapper extends KernelDeploymentComponentMapper
View Full Code Here

      // bean context
      BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("BeanContext", BaseContext.class.getName());
      builder.addConstructorParameter(BeanContainer.class.getName(), new BeanContainer<Object>());
      builder.addAlias(baseName + "$" + "BeanContext");
      builder.addAnnotation(sflAnn);
      result.add(controller.install(builder.getBeanMetaData()).getTarget());

      // instance interceptor
      builder = BeanMetaDataBuilder.createBuilder("InstanceInterceptor", InstanceInterceptor.class.getName());
      builder.addAlias(baseName + "$" + "InstanceInterceptor");
View Full Code Here

      result.add(controller.install(builder.getBeanMetaData()).getTarget());

      // instance interceptor
      builder = BeanMetaDataBuilder.createBuilder("InstanceInterceptor", InstanceInterceptor.class.getName());
      builder.addAlias(baseName + "$" + "InstanceInterceptor");
      builder.addAnnotation(sflAnn);
      builder.addInstallWithThis("addInterceptor", "BeanContext");
      builder.addUninstallWithThis("removeInterceptor", "BeanContext");
      result.add(controller.install(builder.getBeanMetaData()).getTarget());

      return result;
View Full Code Here

      Kernel kernel = bootstrap();
      KernelController controller = kernel.getController();
      try
      {
         BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("bean", SimpleBean.class.getName());
         builder.addAnnotation("@" + SimpleAnnotation.class.getName() + "(name=\"foobar\")");
         controller.install(builder.getBeanMetaData());
         ControllerContext cc = controller.getInstalledContext("bean");
         assertNotNull(cc);
         MetaData metaData = cc.getScopeInfo().getMetaData();
         assertNotNull(metaData);
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.