Package org.jboss.as.pojo.descriptor

Examples of org.jboss.as.pojo.descriptor.FactoryConfig


        if (ctorConfig != null) {
            parameters = ctorConfig.getParameters();
            types = Configurator.getTypes(parameters);

            String factoryClass = ctorConfig.getFactoryClass();
            FactoryConfig factory = ctorConfig.getFactory();
            if (factoryClass != null || factory != null) {
                String factoryMethod = ctorConfig.getFactoryMethod();
                if (factoryMethod == null)
                    throw PojoMessages.MESSAGES.missingFactoryMethod(beanConfig);

                if (factoryClass != null) {
                    // static factory
                    Class<?> factoryClazz = Class.forName(factoryClass, false, module.getClassLoader());
                    Method method = Configurator.findMethod(index, factoryClazz, factoryMethod, types, true, true, true);
                    MethodJoinpoint mj = new MethodJoinpoint(method);
                    mj.setTarget(new ImmediateValue<Object>(null)); // null, since this is static call
                    mj.setParameters(parameters);
                    instantiateJoinpoint = mj;
                } else if (factory != null) {
                    ReflectionJoinpoint rj = new ReflectionJoinpoint(factory.getBeanInfo(), factoryMethod, types);
                    // null type is ok, as this should be plain injection
                    rj.setTarget(new ImmediateValue<Object>(factory.getValue(null)));
                    rj.setParameters(parameters);
                    instantiateJoinpoint = rj;
                }
            }
        }
View Full Code Here


        if (ctorConfig != null) {
            parameters = ctorConfig.getParameters();
            types = Configurator.getTypes(parameters);

            String factoryClass = ctorConfig.getFactoryClass();
            FactoryConfig factory = ctorConfig.getFactory();
            if (factoryClass != null || factory != null) {
                String factoryMethod = ctorConfig.getFactoryMethod();
                if (factoryMethod == null)
                    throw PojoLogger.ROOT_LOGGER.missingFactoryMethod(beanConfig);

                if (factoryClass != null) {
                    // static factory
                    Class<?> factoryClazz = Class.forName(factoryClass, false, module.getClassLoader());
                    Method method = Configurator.findMethod(index, factoryClazz, factoryMethod, types, true, true, true);
                    MethodJoinpoint mj = new MethodJoinpoint(method);
                    mj.setTarget(new ImmediateValue<Object>(null)); // null, since this is static call
                    mj.setParameters(parameters);
                    instantiateJoinpoint = mj;
                } else if (factory != null) {
                    ReflectionJoinpoint rj = new ReflectionJoinpoint(factory.getBeanInfo(), factoryMethod, types);
                    // null type is ok, as this should be plain injection
                    rj.setTarget(new ImmediateValue<Object>(factory.getValue(null)));
                    rj.setParameters(parameters);
                    instantiateJoinpoint = rj;
                }
            }
        }
View Full Code Here

        if (ctorConfig != null) {
            parameters = ctorConfig.getParameters();
            types = Configurator.getTypes(parameters);

            String factoryClass = ctorConfig.getFactoryClass();
            FactoryConfig factory = ctorConfig.getFactory();
            if (factoryClass != null || factory != null) {
                String factoryMethod = ctorConfig.getFactoryMethod();
                if (factoryMethod == null)
                    throw new StartException("Missing factory method in ctor configuration: " + beanConfig);

                if (factoryClass != null) {
                    // static factory
                    Class<?> factoryClazz = Class.forName(factoryClass, false, module.getClassLoader());
                    Method method = Configurator.findMethod(index, factoryClazz, factoryMethod, types, true, true, true);
                    MethodJoinpoint mj = new MethodJoinpoint(method);
                    mj.setTarget(new ImmediateValue<Object>(null)); // null, since this is static call
                    mj.setParameters(parameters);
                    instantiateJoinpoint = mj;
                } else if (factory != null) {
                    ReflectionJoinpoint rj = new ReflectionJoinpoint(factory.getBeanInfo(), factoryMethod, types);
                    // null type is ok, as this should be plain injection
                    rj.setTarget(new ImmediateValue<Object>(factory.getValue(null)));
                    rj.setParameters(parameters);
                    instantiateJoinpoint = rj;
                }
            }
        }
View Full Code Here

            if (ctorConfig != null) {
                parameters = ctorConfig.getParameters();
                types = Configurator.getTypes(parameters);

                String factoryClass = ctorConfig.getFactoryClass();
                FactoryConfig factory = ctorConfig.getFactory();
                if (factoryClass != null || factory != null) {
                    String factoryMethod = ctorConfig.getFactoryMethod();
                    if (factoryMethod == null)
                        throw new StartException("Missing factory method in ctor configuration: " + getBeanConfig());

                    if (factoryClass != null) {
                        // static factory
                        Class<?> factoryClazz = Class.forName(factoryClass, false, getModule().getClassLoader());
                        Method method = Configurator.findMethod(getIndex(), factoryClazz, factoryMethod, types, true, true, true);
                        MethodJoinpoint mj = new MethodJoinpoint(method);
                        mj.setTarget(new ImmediateValue<Object>(null)); // null, since this is static call
                        mj.setParameters(parameters);
                        instantiateJoinpoint = mj;
                    } else if (factory != null) {
                        ReflectionJoinpoint rj = new ReflectionJoinpoint(factory.getBeanInfo(), factoryMethod, types);
                        // null type is ok, as this should be plain injection
                        rj.setTarget(new ImmediateValue<Object>(factory.getValue(null)));
                        rj.setParameters(parameters);
                        instantiateJoinpoint = rj;
                    }
                }
            }
View Full Code Here

TOP

Related Classes of org.jboss.as.pojo.descriptor.FactoryConfig

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.