Package org.apache.tuscany.sca.core.invocation

Examples of org.apache.tuscany.sca.core.invocation.CallableReferenceObjectFactory


                            Type callableRefType = JavaIntrospectionHelper.getParameterType(element.getGenericType());
                            // Type businessType = JavaIntrospectionHelper.getParameterType(callableRefType);
                            Class<?> businessInterface =
                                JavaIntrospectionHelper.getBusinessInterface(baseType, callableRefType);
                            factory =
                                new CallableReferenceObjectFactory(businessInterface, component,
                                                                   (RuntimeComponentReference)wireList.get(i)
                                                                       .getSource().getContract(), wireList.get(i)
                                                                       .getSource().getBinding());
                        } else {
                            factory = createObjectFactory(baseType, wireList.get(i));
                        }
                        factories.add(factory);
                    }
                    instanceFactoryProvider.setObjectFactories(element, factories);
                    JavaConstructorImpl constructor = instanceFactoryProvider.getImplementation().getConstructor();
                    for(JavaElementImpl p: constructor.getParameters()){
                        if(element.getName().equals(p.getName())) {
                            instanceFactoryProvider.setObjectFactories(p, factories);
                        }
                    }
                } else {
                    if (wireList == null && ref.getMultiplicity() == Multiplicity.ONE_ONE) {
                        throw new IllegalStateException("Required reference is missing: " + ref.getName());
                    }
                    if (wireList != null && !wireList.isEmpty()) {
                        ObjectFactory<?> factory = null;
                        if (CallableReference.class.isAssignableFrom(element.getType())) {
                            Class<?> businessInterface =
                                JavaIntrospectionHelper.getBusinessInterface(element.getType(), element
                                    .getGenericType());
                            factory =
                                new CallableReferenceObjectFactory(businessInterface, component,
                                                                   (RuntimeComponentReference)componentReference, null);
                        } else {
                            factory = createObjectFactory(element.getType(), wireList.get(0));
                        }
                        instanceFactoryProvider.setObjectFactory(element, factory);
View Full Code Here


                            Type callableRefType = JavaIntrospectionHelper.getParameterType(element.getGenericType());
                            // Type businessType = JavaIntrospectionHelper.getParameterType(callableRefType);
                            Class<?> businessInterface =
                                JavaIntrospectionHelper.getBusinessInterface(baseType, callableRefType);
                            factory =
                                new CallableReferenceObjectFactory(businessInterface, component,
                                                                   (RuntimeComponentReference)wireList.get(i)
                                                                       .getSource().getContract(), wireList.get(i)
                                                                       .getSource().getBinding());
                        } else {
                            factory = createObjectFactory(baseType, wireList.get(i));
                        }
                        factories.add(factory);
                    }
                    instanceFactoryProvider.setObjectFactories(element, factories);
                    JavaConstructorImpl<?> constructor = instanceFactoryProvider.getImplementation().getConstructor();
                    for(JavaElementImpl p: constructor.getParameters()){
                        if(element.getName().equals(p.getName())) {
                            instanceFactoryProvider.setObjectFactories(p, factories);
                        }
                    }
                } else {
                    if (wireList == null && ref.getMultiplicity() == Multiplicity.ONE_ONE) {
                        throw new IllegalStateException("Required reference is missing: " + ref.getName());
                    }
                    if (wireList != null && !wireList.isEmpty()) {
                        ObjectFactory<?> factory = null;
                        if (CallableReference.class.isAssignableFrom(element.getType())) {
                            Class<?> businessInterface =
                                JavaIntrospectionHelper.getBusinessInterface(element.getType(), element
                                    .getGenericType());
                            factory =
                                new CallableReferenceObjectFactory(businessInterface, component,
                                                                   (RuntimeComponentReference)componentReference, null);
                        } else {
                            factory = createObjectFactory(element.getType(), wireList.get(0));
                        }
                        instanceFactoryProvider.setObjectFactory(element, factory);
View Full Code Here

                            Type callableRefType = JavaIntrospectionHelper.getParameterType(element.getGenericType());
                            // Type businessType = JavaIntrospectionHelper.getParameterType(callableRefType);
                            Class<?> businessInterface =
                                JavaIntrospectionHelper.getBusinessInterface(baseType, callableRefType);
                            factory =
                                new CallableReferenceObjectFactory(businessInterface, component,
                                                                   (RuntimeComponentReference)wireList.get(i)
                                                                       .getSource().getContract(), wireList.get(i)
                                                                       .getSource().getBinding());
                        } else {
                            factory = createObjectFactory(baseType, wireList.get(i));
                        }
                        factories.add(factory);
                    }
                    instanceFactoryProvider.setObjectFactories(element, factories);
                    JavaConstructorImpl<?> constructor = instanceFactoryProvider.getImplementation().getConstructor();
                    for(JavaElementImpl p: constructor.getParameters()){
                        if(element.getName().equals(p.getName())) {
                            instanceFactoryProvider.setObjectFactories(p, factories);
                        }
                    }
                } else {
                    if (wireList == null && ref.getMultiplicity() == Multiplicity.ONE_ONE) {
                        throw new IllegalStateException("Required reference is missing: " + ref.getName());
                    }
                    if (wireList != null && !wireList.isEmpty()) {
                        ObjectFactory<?> factory = null;
                        if (CallableReference.class.isAssignableFrom(element.getType())) {
                            Class<?> businessInterface =
                                JavaIntrospectionHelper.getBusinessInterface(element.getType(), element
                                    .getGenericType());
                            factory =
                                new CallableReferenceObjectFactory(businessInterface, component,
                                                                   (RuntimeComponentReference)componentReference, null);
                        } else {
                            factory = createObjectFactory(element.getType(), wireList.get(0));
                        }
                        instanceFactoryProvider.setObjectFactory(element, factory);
View Full Code Here

                        if (ServiceReference.class.isAssignableFrom(baseType)) {
                            Type callableRefType = JavaIntrospectionHelper.getParameterType(element.getGenericType());
                            // Type businessType = JavaIntrospectionHelper.getParameterType(callableRefType);
                            Class<?> businessInterface =
                                JavaIntrospectionHelper.getBusinessInterface(baseType, callableRefType);
                            factory = new CallableReferenceObjectFactory(businessInterface, (RuntimeEndpointReference) wireList.get(i));
                        } else {
                            factory = createObjectFactory(baseType, wireList.get(i));
                        }
                        factories.add(factory);
                    }
                    instanceFactoryProvider.setObjectFactories(element, factories);
                    JavaConstructorImpl<?> constructor = instanceFactoryProvider.getImplementation().getConstructor();
                    for(JavaElementImpl p: constructor.getParameters()){
                        if(element.getName().equals(p.getName())) {
                            instanceFactoryProvider.setObjectFactories(p, factories);
                        }
                    }
                } else {
                    if (wireList == null && ref.getMultiplicity() == Multiplicity.ONE_ONE) {
                        throw new IllegalStateException("Required reference is missing: " + ref.getName());
                    }
                    if (wireList != null && !wireList.isEmpty()) {
                        ObjectFactory<?> factory = null;
                        if (ServiceReference.class.isAssignableFrom(element.getType())) {
                            Class<?> businessInterface =
                                JavaIntrospectionHelper.getBusinessInterface(element.getType(), element
                                    .getGenericType());
                            factory =
                                new CallableReferenceObjectFactory(businessInterface, (RuntimeEndpointReference) wireList.get(0));
                        } else {
                            factory = createObjectFactory(element.getType(), wireList.get(0));
                        }
                        instanceFactoryProvider.setObjectFactory(element, factory);
                        JavaConstructorImpl<?> constructor = instanceFactoryProvider.getImplementation().getConstructor();
View Full Code Here

                            Type callableRefType = JavaIntrospectionHelper.getParameterType(element.getGenericType());
                            // Type businessType = JavaIntrospectionHelper.getParameterType(callableRefType);
                            Class<?> businessInterface =
                                JavaIntrospectionHelper.getBusinessInterface(baseType, callableRefType);
                            factory =
                                new CallableReferenceObjectFactory(businessInterface, component,
                                                                   (RuntimeComponentReference)wireList.get(i)
                                                                       .getSource().getContract(), wireList.get(i)
                                                                       .getSource().getBinding());
                        } else {
                            factory = createObjectFactory(baseType, wireList.get(i));
                        }
                        factories.add(factory);
                    }
                    instanceFactoryProvider.setObjectFactories(element, factories);
                    JavaConstructorImpl constructor = instanceFactoryProvider.getImplementation().getConstructor();
                    for(JavaElementImpl p: constructor.getParameters()){
                        if(element.getName().equals(p.getName())) {
                            instanceFactoryProvider.setObjectFactories(p, factories);
                        }
                    }
                } else {
                    if (wireList == null && ref.getMultiplicity() == Multiplicity.ONE_ONE) {
                        throw new IllegalStateException("Required reference is missing: " + ref.getName());
                    }
                    if (wireList != null && !wireList.isEmpty()) {
                        ObjectFactory<?> factory = null;
                        if (CallableReference.class.isAssignableFrom(element.getType())) {
                            Class<?> businessInterface =
                                JavaIntrospectionHelper.getBusinessInterface(element.getType(), element
                                    .getGenericType());
                            factory =
                                new CallableReferenceObjectFactory(businessInterface, component,
                                                                   (RuntimeComponentReference)componentReference, null);
                        } else {
                            factory = createObjectFactory(element.getType(), wireList.get(0));
                        }
                        instanceFactoryProvider.setObjectFactory(element, factory);
View Full Code Here

                            Type callableRefType = JavaIntrospectionHelper.getParameterType(element.getGenericType());
                            // Type businessType = JavaIntrospectionHelper.getParameterType(callableRefType);
                            Class<?> businessInterface =
                                JavaIntrospectionHelper.getBusinessInterface(baseType, callableRefType);
                            factory =
                                new CallableReferenceObjectFactory(businessInterface, component,
                                                                   (RuntimeComponentReference)wireList.get(i)
                                                                       .getSource().getContract(), wireList.get(i)
                                                                       .getSource().getBinding());
                        } else {
                            factory = createObjectFactory(baseType, wireList.get(i));
                        }
                        factories.add(factory);
                    }
                    instanceFactoryProvider.setObjectFactories(element, factories);
                    JavaConstructorImpl constructor = instanceFactoryProvider.getImplementation().getConstructor();
                    for(JavaElementImpl p: constructor.getParameters()){
                        if(element.getName().equals(p.getName())) {
                            instanceFactoryProvider.setObjectFactories(p, factories);
                        }
                    }
                } else {
                    if (wireList == null && ref.getMultiplicity() == Multiplicity.ONE_ONE) {
                        throw new IllegalStateException("Required reference is missing: " + ref.getName());
                    }
                    if (wireList != null && !wireList.isEmpty()) {
                        ObjectFactory<?> factory = null;
                        if (CallableReference.class.isAssignableFrom(element.getType())) {
                            Class<?> businessInterface =
                                JavaIntrospectionHelper.getBusinessInterface(element.getType(), element
                                    .getGenericType());
                            factory =
                                new CallableReferenceObjectFactory(businessInterface, component,
                                                                   (RuntimeComponentReference)componentReference, null);
                        } else {
                            factory = createObjectFactory(element.getType(), wireList.get(0));
                        }
                        instanceFactoryProvider.setObjectFactory(element, factory);
View Full Code Here

                            Type callableRefType = JavaIntrospectionHelper.getParameterType(element.getGenericType());
                            // Type businessType = JavaIntrospectionHelper.getParameterType(callableRefType);
                            Class<?> businessInterface =
                                JavaIntrospectionHelper.getBusinessInterface(baseType, callableRefType);
                            factory =
                                new CallableReferenceObjectFactory(businessInterface, component,
                                                                   (RuntimeComponentReference)wireList.get(i)
                                                                       .getSource().getContract(), wireList.get(i)
                                                                       .getSource().getBinding());
                        } else {
                            factory = createObjectFactory(baseType, wireList.get(i));
                        }
                        factories.add(factory);
                    }
                    instanceFactoryProvider.setObjectFactories(element, factories);
                    JavaConstructorImpl constructor = instanceFactoryProvider.getImplementation().getConstructor();
                    for(JavaElementImpl p: constructor.getParameters()){
                        if(element.getName().equals(p.getName())) {
                            instanceFactoryProvider.setObjectFactories(p, factories);
                        }
                    }
                } else {
                    if (wireList == null && ref.getMultiplicity() == Multiplicity.ONE_ONE) {
                        throw new IllegalStateException("Required reference is missing: " + ref.getName());
                    }
                    if (wireList != null && !wireList.isEmpty()) {
                        ObjectFactory<?> factory = null;
                        if (CallableReference.class.isAssignableFrom(element.getType())) {
                            Class<?> businessInterface =
                                JavaIntrospectionHelper.getBusinessInterface(element.getType(), element
                                    .getGenericType());
                            factory =
                                new CallableReferenceObjectFactory(businessInterface, component,
                                                                   (RuntimeComponentReference)componentReference, null);
                        } else {
                            factory = createObjectFactory(element.getType(), wireList.get(0));
                        }
                        instanceFactoryProvider.setObjectFactory(element, factory);
View Full Code Here

                        if (ServiceReference.class.isAssignableFrom(baseType)) {
                            Type callableRefType = JavaIntrospectionHelper.getParameterType(element.getGenericType());
                            // Type businessType = JavaIntrospectionHelper.getParameterType(callableRefType);
                            Class<?> businessInterface =
                                JavaIntrospectionHelper.getBusinessInterface(baseType, callableRefType);
                            factory = new CallableReferenceObjectFactory(businessInterface, (RuntimeEndpointReference) wireList.get(i));
                        } else {
                            factory = createObjectFactory(baseType, wireList.get(i));
                        }
                        factories.add(factory);
                    }
                    instanceFactoryProvider.setObjectFactories(element, factories);
                    JavaConstructorImpl<?> constructor = instanceFactoryProvider.getImplementation().getConstructor();
                    for(JavaElementImpl p: constructor.getParameters()){
                        if(element.getName().equals(p.getName())) {
                            instanceFactoryProvider.setObjectFactories(p, factories);
                        }
                    }
                } else {
                    if (wireList == null && ref.getMultiplicity() == Multiplicity.ONE_ONE) {
                        throw new IllegalStateException("Required reference is missing: " + ref.getName());
                    }
                    if (wireList != null && !wireList.isEmpty()) {
                        ObjectFactory<?> factory = null;
                        if (ServiceReference.class.isAssignableFrom(element.getType())) {
                            Class<?> businessInterface =
                                JavaIntrospectionHelper.getBusinessInterface(element.getType(), element
                                    .getGenericType());
                            factory =
                                new CallableReferenceObjectFactory(businessInterface, (RuntimeEndpointReference) wireList.get(0));
                        } else {
                            factory = createObjectFactory(element.getType(), wireList.get(0));
                        }
                        instanceFactoryProvider.setObjectFactory(element, factory);
                        JavaConstructorImpl<?> constructor = instanceFactoryProvider.getImplementation().getConstructor();
View Full Code Here

                            Type callableRefType = JavaIntrospectionHelper.getParameterType(element.getGenericType());
                            // Type businessType = JavaIntrospectionHelper.getParameterType(callableRefType);
                            Class<?> businessInterface =
                                JavaIntrospectionHelper.getBusinessInterface(baseType, callableRefType);
                            factory =
                                new CallableReferenceObjectFactory(businessInterface, component,
                                                                   (RuntimeComponentReference)wireList.get(i)
                                                                       .getSource().getContract(), wireList.get(i)
                                                                       .getSource().getBinding());
                        } else {
                            factory = createObjectFactory(baseType, wireList.get(i));
                        }
                        factories.add(factory);
                    }
                    instanceFactoryProvider.setObjectFactories(element, factories);
                    JavaConstructorImpl constructor = instanceFactoryProvider.getImplementation().getConstructor();
                    for(JavaElementImpl p: constructor.getParameters()){
                        if(element.getName().equals(p.getName())) {
                            instanceFactoryProvider.setObjectFactories(p, factories);
                        }
                    }
                } else {
                    if (wireList == null && ref.getMultiplicity() == Multiplicity.ONE_ONE) {
                        throw new IllegalStateException("Required reference is missing: " + ref.getName());
                    }
                    if (wireList != null && !wireList.isEmpty()) {
                        ObjectFactory<?> factory = null;
                        if (CallableReference.class.isAssignableFrom(element.getType())) {
                            Class<?> businessInterface =
                                JavaIntrospectionHelper.getBusinessInterface(element.getType(), element
                                    .getGenericType());
                            factory =
                                new CallableReferenceObjectFactory(businessInterface, component,
                                                                   (RuntimeComponentReference)componentReference, null);
                        } else {
                            factory = createObjectFactory(element.getType(), wireList.get(0));
                        }
                        instanceFactoryProvider.setObjectFactory(element, factory);
View Full Code Here

                        ObjectFactory<?> factory = null;
                        if(CallableReference.class.isAssignableFrom(baseType)) {
                            Type callableRefType = JavaIntrospectionHelper.getParameterType(element.getGenericType());
                            Type businessType = JavaIntrospectionHelper.getParameterType(callableRefType);
                            Class<?> businessInterface = JavaIntrospectionHelper.getBusinessInterface(baseType, businessType);
                            factory = new CallableReferenceObjectFactory(businessInterface, component, (RuntimeComponentReference) componentReference);
                        } else {
                            factory = createWireFactory(baseType, wireList.get(i));
                        }
                        factories.add(factory);
                    }
                    instanceFactoryProvider.setObjectFactories(element, factories);
                } else {
                    if (wireList == null && ref.getMultiplicity() == Multiplicity.ONE_ONE) {
                        throw new IllegalStateException("Required reference is missing: " + ref.getName());
                    }
                    if (wireList != null && !wireList.isEmpty()) {
                        ObjectFactory<?> factory = null;
                        if (CallableReference.class.isAssignableFrom(element.getType())) {
                            Class<?> businessInterface =
                                JavaIntrospectionHelper.getBusinessInterface(element.getType(), element.getGenericType());
                            factory =
                                new CallableReferenceObjectFactory(businessInterface, component,
                                                                   (RuntimeComponentReference)componentReference);
                        } else {
                            factory = createWireFactory(element.getType(), wireList.get(0));
                        }
                        instanceFactoryProvider.setObjectFactory(element, factory);
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.core.invocation.CallableReferenceObjectFactory

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.