Package com.elevenware.redcorn.beans

Examples of com.elevenware.redcorn.beans.BeanDefinition


    @Override
    public <T> T get(Class<T> clazz) {
        checkStarted();
        hydrateNewBeans();
        BeanDefinition definition = context.get(clazz.getCanonicalName());
        if(definition != null) {
            return (T) definition.getPayload();
        }
        for(BeanDefinition bean: context.values()) {
            Class superType = bean.getType();
            if(clazz.isAssignableFrom(superType)) {
                return (T) bean.getPayload();
View Full Code Here


    @Override
    public <T> T get(String id) {
        checkStarted();
        hydrateNewBeans();
        BeanDefinition defintion = context.get(id);
        if(defintion == null) {
            return null;
        }
        return (T) context.get(id).getPayload();
    }
View Full Code Here

        this.context.put(definition.getName(), definition);
    }

    @Override
    public BeanDefinition register(String name, Class clazz) {
        BeanDefinition definition = new DefaultBeanDefinition(clazz, name);
        registeredTypes.add(definition);
        log.trace("Registered bean defintion for " + clazz);

        return definition;
    }
View Full Code Here

    }

    @Override
    public RedcornContainer createChild(String name) {
//        BeanDefinition containerDef = new DefaultBeanDefinition(ConstructorInjectionIocContainer.class, name);
        BeanDefinition containerDef = this.register(name, ConstructorInjectionRedcornContainer.class);
        containerDef.instantiate();
        RedcornContainer child = (RedcornContainer) containerDef.getPayload();
        for(BeanDefinition bean: this.context.values()) {
            child.addDefinition(bean);
        }
        containerDef.markResolved();
        this.context.put(name, containerDef);
        child.start();
        return child;
    }
View Full Code Here

        return child;
    }

    @Override
    public BeanDefinition registerFactory(String name, String factoryMethod, Class factoryClass) {
        BeanDefinition definition = new FactoryBeanDefinition(name, factoryMethod, factoryClass);
        registeredTypes.add(definition);
        return definition;
    }
View Full Code Here

TOP

Related Classes of com.elevenware.redcorn.beans.BeanDefinition

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.