Package org.springframework.context.annotation

Examples of org.springframework.context.annotation.ScannedGenericBeanDefinition


                }
            }
        }
        for (String rebuilder:REBUILDERS){
            try{
                ScannedGenericBeanDefinition beanDefinition = Server.getScannedBeanDefinition(rebuilder);
                beanDefinition.setAutowireCandidate(true);
                beanDefinition.setAutowireMode(AbstractBeanDefinition.AUTOWIRE_BY_NAME);
                beanDefinition.setAttribute("id", rebuilder);
                beanDefinition.setAttribute("name", rebuilder);
                beanDefinition.setInitMethodName("init");
                beanDefinition.setScope(BeanDefinition.SCOPE_SINGLETON);
                beanDefinition.setDependencyCheck(AbstractBeanDefinition.DEPENDENCY_CHECK_NONE);
                registerBeanDefinition(rebuilder, beanDefinition);
            }
            catch (IOException e){
                throw new ServerInitializationException(e.toString(),e);
            }
View Full Code Here


            loadSpringModules();

            // Default definition for ModelBasedTripleGenerator
            if (!knownBeanDefinition(ModelBasedTripleGenerator.class.getName())){
                ScannedGenericBeanDefinition tripleGen = getScannedBeanDefinition(ModelBasedTripleGenerator.class.getName());
                tripleGen.setScope(AbstractBeanDefinition.SCOPE_PROTOTYPE);
                registerBeanDefinition(ModelBasedTripleGenerator.class.getName(), tripleGen);
            }

            logger.info("Server home is " + m_serverDir.toString());
            if (s_serverProfile == null) {
View Full Code Here

        GenericApplicationContext appContext = new GenericApplicationContext();
        appContext.refresh(); // init event multicaster to avoid synch issue
        appContext.registerBeanDefinition(MODULE_CONSTRUCTOR_PARAM2_CLASS, getServerBeanDefinition());
        appContext.getBeanFactory().registerSingleton(MODULE_CONSTRUCTOR_PARAM2_CLASS, this);
        appContext.registerBeanDefinition(ServerConfiguration.class.getName(), getServerConfigurationBeanDefinition());
        ScannedGenericBeanDefinition moduleDef = getScannedBeanDefinition(Module.class.getName());
        moduleDef.setAbstract(true);
        moduleDef.setInitMethodName("initModule");
        moduleDef.setDestroyMethodName("shutdownModule");
        appContext.registerBeanDefinition(Module.class.getName(), moduleDef);
        return appContext;
    }
View Full Code Here

    }

    protected static ScannedGenericBeanDefinition getScannedBeanDefinition(String className)
        throws IOException {
        MetadataReader reader = s_readerFactory.getMetadataReader(className);
        ScannedGenericBeanDefinition beanDefinition = new ScannedGenericBeanDefinition(reader);
        return beanDefinition;
    }
View Full Code Here

     * @param role
     * @return
     */
    protected static GenericBeanDefinition createModuleBeanDefinition(String className, Map<String,String> params, String role)
        throws IOException {
        ScannedGenericBeanDefinition result = getScannedBeanDefinition(className);
        result.setParentName(Module.class.getName());
        result.setScope(BeanDefinition.SCOPE_SINGLETON);
        result.setAttribute("id", role);
        result.setAttribute("name", role);
        result.setAttribute("init-method", "initModule");
        result.setEnforceInitMethod(true);
        result.setAttribute("destroy-method", "shutdownModule");
        result.setEnforceDestroyMethod(true);

        ConstructorArgumentValues cArgs = new ConstructorArgumentValues();
        cArgs.addIndexedArgumentValue(0, params,MODULE_CONSTRUCTOR_PARAM1_CLASS);
        // one server bean in context
        BeanReference serverRef = new RuntimeBeanReference(MODULE_CONSTRUCTOR_PARAM2_CLASS);
        cArgs.addIndexedArgumentValue(1, serverRef);
        cArgs.addIndexedArgumentValue(2, role,MODULE_CONSTRUCTOR_PARAM3_CLASS);
        result.setConstructorArgumentValues(cArgs);
        return result;
    }
View Full Code Here

     * @throws IOException
     */
    protected static GenericBeanDefinition getTriplestoreConnectorBeanDefinition(DatastoreConfiguration tsDC)
        throws IOException {
        String tsConnector = tsDC.getParameter("connectorClassName",Parameter.class).getValue();
        ScannedGenericBeanDefinition beanDefinition = getScannedBeanDefinition(tsConnector);
        beanDefinition.setAutowireCandidate(true);

        Iterator<Parameter> it;
        Parameter p;

        Map<String, String> tsTC = new HashMap<String, String>();
        it = tsDC.getParameters(Parameter.class).iterator();
        while (it.hasNext()) {
            p = it.next();
            tsTC.put(p.getName(), p.getValue(p.getIsFilePath()));
        }
        MutablePropertyValues propertyValues = new MutablePropertyValues();
        propertyValues.addPropertyValue("configuration", tsTC);
        beanDefinition.setPropertyValues(propertyValues);
        return beanDefinition;
    }
View Full Code Here

    public BeanDefinition resolveBeanDefinition(byte[] bytes) throws IOException {
        Resource resource = new ByteArrayResource(bytes);
        resetCachingMetadataReaderFactoryCache();
        MetadataReader metadataReader = getMetadataReaderFactory().getMetadataReader(resource);
        if (isCandidateComponent(metadataReader)) {
            ScannedGenericBeanDefinition sbd = new ScannedGenericBeanDefinition(metadataReader);
            sbd.setResource(resource);
            sbd.setSource(resource);
            if (isCandidateComponent(sbd)) {
                LOGGER.debug("Identified candidate component class '{}'", metadataReader.getClassMetadata().getClassName());
                return sbd;
            } else {
                LOGGER.debug("Ignored because not a concrete top-level class '{}'", metadataReader.getClassMetadata().getClassName());
View Full Code Here

        String cacheProviderName = getCacheProviderName(beanFactory);
        if (cacheProviderName != null) {
            RuntimeBeanReference beanRef = new RuntimeBeanReference(cacheProviderName);
            propertyValues.addPropertyValue("cacheProvider", beanRef);
        }
        ScannedGenericBeanDefinition scannedBeanDefinition = (ScannedGenericBeanDefinition) beanDefinition;
        scannedBeanDefinition.setPropertyValues(propertyValues);
        scannedBeanDefinition.setBeanClass(JadeFactoryBean.class);

        DefaultListableBeanFactory defaultBeanFactory = (DefaultListableBeanFactory) beanFactory;
        defaultBeanFactory.registerBeanDefinition(daoClassName, beanDefinition);

        if (logger.isDebugEnabled()) {
View Full Code Here

    FunctionExecutionComponentProvider provider = new FunctionExecutionComponentProvider(includeFilters,
        AnnotationFunctionExecutionConfigurationSource.getFunctionExecutionAnnotationTypes());
    Set<BeanDefinition> candidates = provider.findCandidateComponents(this.getClass().getPackage().getName()
        + ".one");

    ScannedGenericBeanDefinition bd = null;

    for (BeanDefinition candidate : candidates) {
      if (candidate.getBeanClassName().equals(TestFunctionExecution.class.getName())) {
        bd = (ScannedGenericBeanDefinition) candidate;
      }
View Full Code Here

        String statementWrapperProvider = getStatementWrapperProvider(beanFactory);
        if (statementWrapperProvider != null) {
            RuntimeBeanReference beanRef = new RuntimeBeanReference(statementWrapperProvider);
            propertyValues.addPropertyValue("statementWrapperProvider", beanRef);
        }
        ScannedGenericBeanDefinition scannedBeanDefinition = (ScannedGenericBeanDefinition) beanDefinition;
        scannedBeanDefinition.setPropertyValues(propertyValues);
        scannedBeanDefinition.setBeanClass(JadeFactoryBean.class);

        DefaultListableBeanFactory defaultBeanFactory = (DefaultListableBeanFactory) beanFactory;
        defaultBeanFactory.registerBeanDefinition(daoClassName, beanDefinition);

        if (logger.isDebugEnabled()) {
View Full Code Here

TOP

Related Classes of org.springframework.context.annotation.ScannedGenericBeanDefinition

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.