Examples of Bean


Examples of javax.enterprise.inject.spi.Bean

        assertNull( incrementalBuildResults );
    }

    @Test
    public void testResourceDeleted() throws Exception {
        final Bean buildChangeListenerBean = (Bean) beanManager.getBeans( ResourceChangeIncrementalBuilder.class ).iterator().next();
        final CreationalContext cc = beanManager.createCreationalContext( buildChangeListenerBean );
        final ResourceChangeIncrementalBuilder buildChangeListener = (ResourceChangeIncrementalBuilder) beanManager.getReference( buildChangeListenerBean,
                                                                                                                                  ResourceChangeIncrementalBuilder.class,
                                                                                                                                  cc );
View Full Code Here

Examples of javax.enterprise.inject.spi.Bean

                      ruleNamesService.getRuleNames( resourcePath ).get( 1 ) );
    }

    @Test
    public void testBatchResourceChanges() throws Exception {
        final Bean buildChangeListenerBean = (Bean) beanManager.getBeans( ResourceChangeIncrementalBuilder.class ).iterator().next();
        final CreationalContext cc = beanManager.createCreationalContext( buildChangeListenerBean );
        final ResourceChangeIncrementalBuilder buildChangeListener = (ResourceChangeIncrementalBuilder) beanManager.getReference( buildChangeListenerBean,
                                                                                                                                  ResourceChangeIncrementalBuilder.class,
                                                                                                                                  cc );
View Full Code Here

Examples of javax.enterprise.inject.spi.Bean

        assertTrue( results.getMessages().isEmpty() );
    }

    private <T> T getReference( Class<T> clazz ) {
        Bean bean = (Bean) beanManager.getBeans( clazz ).iterator().next();
        CreationalContext cc = beanManager.createCreationalContext( bean );
        return (T) beanManager.getReference( bean,
                                             clazz,
                                             cc );
    }
View Full Code Here

Examples of javax.enterprise.inject.spi.Bean

                                             clazz,
                                             cc );
    }

    private void setUpGuvnorM2Repo() {
        Bean m2RepoServiceBean = (Bean) beanManager.getBeans( ExtendedM2RepoService.class ).iterator().next();
        CreationalContext cc = beanManager.createCreationalContext( m2RepoServiceBean );
        ExtendedM2RepoService m2RepoService = (ExtendedM2RepoService) beanManager.getReference( m2RepoServiceBean,
                                                                                                ExtendedM2RepoService.class,
                                                                                                cc );
View Full Code Here

Examples of javax.enterprise.inject.spi.Bean

                                                 "org.drools.compiler.cdi.test.KProjectTestClassfol4");
            ((KieServicesImpl) KieServices.Factory.get()).nullKieClasspathContainer();
            WeldContainer container = weld.initialize();           
           
            Set<Bean< ? >> beans = container.getBeanManager().getBeans( KProjectTestClass.class, new KPTestLiteral( "jar1" ) );
            Bean bean = (Bean) beans.toArray()[0];
            KProjectTestClass o1 = (KProjectTestClass) bean.create( container.getBeanManager().createCreationalContext( null ) );
            assertNotNull( o1 );           
            testEntry(o1, "jar1");
           
            beans = container.getBeanManager().getBeans( KProjectTestClass.class, new KPTestLiteral( "jar2" ) );
            bean = (Bean) beans.toArray()[0];
            KProjectTestClass o2 = (KProjectTestClass) bean.create( container.getBeanManager().createCreationalContext( null ) );
            assertNotNull( o2 );           
            testEntry(o2, "jar2");
           
            beans = container.getBeanManager().getBeans( KProjectTestClass.class, new KPTestLiteral( "jar3" ) );
            bean = (Bean) beans.toArray()[0];
            KProjectTestClass o3 = (KProjectTestClass) bean.create( container.getBeanManager().createCreationalContext( null ) );
            assertNotNull( o3 );           
            testEntry(o3, "jar3");

            beans = container.getBeanManager().getBeans( KProjectTestClass.class, new KPTestLiteral( "fol4" ) );
            bean = (Bean) beans.toArray()[0];
            KProjectTestClass o4 = (KProjectTestClass) bean.create( container.getBeanManager().createCreationalContext( null ) );
            assertNotNull( o4 );           
            testEntry(o4, "fol4");
           
            weld.shutdown();
        } finally {
View Full Code Here

Examples of net.sf.minuteProject.loader.mapping.node.Bean

  public static final String DEFAULT_SUPER_CLASS = "DEFAULT_SUPER_CLASS";
  public static final String DEFAULT_SUPER_CLASS_OTHERWISE_SPECIFIED = "DEFAULT_SUPER_CLASS_OTHERWISE_SPECIFIED";

 
  public String getTypeFormObjectVariable (String variable, String objectName, BeanMapping beanMapping) {
    Bean bean = getBean(beanMapping, objectName);
    for (BeanAttribute att : bean.getAttributes()) {
      if (att.getName().equals(variable))
        return getType(att);
    }
    return "NOT TYPE FOUND";
  }
View Full Code Here

Examples of org.activiti.workflow.simple.alfresco.model.beans.Bean

  }
 
  protected void writeWorkflowDeployerBean(OutputStream out, String processId, String processFileName, String contentModelFileName) throws IOException {
    // Create root "beans" element
    Beans beans = new Beans();
    Bean workflowDeployer = new Bean(processId + WORKFLOW_DEPLOYER_NAME_SUFFIX, WORKFLOW_DEPLOYER_PARENT);
    beans.getBeans().add(workflowDeployer);
   
    // Add pointer to model
    BeanProperty modelsProperty = new BeanProperty(PROPERTY_MODELS);
    modelsProperty.addListItem(EXTENSIONS_PATH_PREFIX + contentModelFileName);
    workflowDeployer.getProperties().add(modelsProperty);
   
    // Add pointer to process definition
    BeanProperty workflowProperty = new BeanProperty(PROPERTY_WORKFLOW_DEFINITIONS);
    workflowProperty.addProp(new BeanPropertyProp(PROP_KEY_ENGINE_ID, PROP_ENGINE_ID));
    workflowProperty.addProp(new BeanPropertyProp(PROP_KEY_MIME_TYPE, PROP_MIME_TYPE));
    workflowProperty.addProp(new BeanPropertyProp(PROP_KEY_LOCATION, EXTENSIONS_PATH_PREFIX + processFileName));
    // TODO: set back to false or make configurable
    workflowProperty.addProp(new BeanPropertyProp(PROP_KEY_REDEPLOY, Boolean.TRUE.toString()));
    workflowDeployer.getProperties().add(workflowProperty);
   
    writeBeans(out, beans);
  }
View Full Code Here

Examples of org.apache.aries.blueprint.annotation.Bean

        List<Object> components = tblueprint.getServiceOrReferenceListOrBean();
       
        // try to process classes that have @ReferenceListener or @RegistrationLister first
        // as we want the refl and regl maps populated before processing @Bean annotation.
        for (Class refListener : refListenerClasses) {
            Bean bean = (Bean) refListener.getAnnotation(Bean.class);
                      
            // register the treference with its id
            TreferenceListener tref = generateTrefListener(refListener);
           
            if (bean.id().length() > 0) {
                reflMap.put(bean.id(), tref);
            } else {
                throw new BlueprintAnnotationException("Unable to find the id for the @ReferenceListener annotated class " + refListener.getName());
            }
        }
       
       
        for (Class regListener : regListenerClasses) {
            Bean bean = (Bean) regListener.getAnnotation(Bean.class);
           
            // register the tregistrationListener with its id
            TregistrationListener tref = generateTregListener(regListener);
           
            if (bean.id().length() > 0) {
                reglMap.put(bean.id(), tref);
            } else {
                throw new BlueprintAnnotationException("Unable to find the id for the @RegistrationListener annotated class " + regListener.getName());
            }  
        }
       
        for (Class clazz : beanClasses) {
            // @Bean annotation detected
            Bean bean = (Bean)clazz.getAnnotation(Bean.class);
            Tbean tbean = new Tbean();
           
            // process depends-on property
            String[] dependsOn = bean.dependsOn();
            if (!containsValid(dependsOn)) {
                tbean.setDependsOn(null);
            } else {
                List<String> dons = Arrays.asList(dependsOn);
                tbean.setDependsOn(dons);
            }
           
            // process id property
            String id = bean.id();
            if (id.length() > 0) {
                tbean.setId(id);
            } else {
                // should we auto generate an id, based on the class name?
                tbean.setId(clazz.getSimpleName());
            }

            // process the clazz property
            tbean.setClazz(clazz.getName());
           
            // process activation
            String activation = bean.activation();
            if (activation.length() > 0) {
                if (activation.equalsIgnoreCase("eager") || activation.equalsIgnoreCase("lazy")) {
                    tbean.setActivation(bean.activation());
                } else {
                    throw new BlueprintAnnotationException("Invalid bean activation value " + activation + " for " + clazz.getName());
                }
            }
           
            // process description
            if (bean.description().length() > 0) {
                Tdescription desp = new Tdescription();
                desp.getContent().add(bean.description());
                tbean.setDescription(desp);
            }
           
            // process scope
            String scope = bean.scope();
            if (scope.length() > 0) {
                if (scope.equalsIgnoreCase("singleton") || scope.equalsIgnoreCase("prototype")) {
                    tbean.setScope(scope);
                } else {
                    throw new BlueprintAnnotationException("Invalid bean scope value " + scope + " for " + clazz.getName());
                }
            }
           
            // process factory ref
            String factoryRef = bean.factoryRef();
            if (factoryRef.length() > 0) {
                tbean.setFactoryRef(factoryRef);
            }
           
            // process factory method
            String factoryMethod = bean.factoryMethod();
            if (factoryMethod.length() > 0) {
                tbean.setFactoryMethod(factoryMethod);
            }
           

            List<Object> props = tbean.getArgumentOrPropertyOrAny();

            // process args
            Arg[] args = bean.args();
           
            if (args.length > 0) {
                for (int i = 0; i < args.length; i++) {
                    Targument targ = createTargument(args[i]);
                    if (targ != null) {
View Full Code Here

Examples of org.apache.felix.ipojo.runtime.core.components.Bean

    Instance complex1(BundleContext bc) throws FileNotFoundException {

        File file = bc.getBundle().getDataFile("file1.txt");
        write(file, "I'm file 1");

        Bean bean = new Bean();
        bean.setMessage("I'm 1");
        bean.setCount(1);

        return instance().of(MyComplexComponent.class)
                .with("file").setto(file)
                .with("bean").setto(bean)
                .with("map").setto(map(pair("a", "b"), pair("c", "d")));
View Full Code Here

Examples of org.apache.felix.ipojo.runtime.core.components.Bean

    Instance complex2(BundleContext bc) throws FileNotFoundException {

        File file = bc.getBundle().getDataFile("file2.txt");
        write(file, "I'm file 2");

        Bean bean = new Bean();
        bean.setMessage("I'm 2");
        bean.setCount(2);

        return instance().of(MyComplexComponent.class)
                .with("file").setto(file)
                .with("bean").setto(bean)
                .with("map").setto(map(pair("a", "b2"), pair("c", "d2")));
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.