Package org.apache.tuscany.sca.implementation.java

Examples of org.apache.tuscany.sca.implementation.java.JavaResourceImpl


        //setUpPolicyHandlers();
    }

    void addResourceFactory(String name, ObjectFactory<?> factory) {
        JavaResourceImpl resource = instanceFactoryProvider.getImplementation().getResources().get(name);

        if (resource != null && !(resource.getElement().getAnchor() instanceof Constructor)) {
            instanceFactoryProvider.getInjectionSites().add(resource.getElement());
        }

        instanceFactoryProvider.setObjectFactory(resource.getElement(), factory);
    }
View Full Code Here


        //setUpPolicyHandlers();
    }

    void addResourceFactory(String name, ObjectFactory<?> factory) {
        JavaResourceImpl resource = instanceFactoryProvider.getImplementation().getResources().get(name);

        if (resource != null && !(resource.getElement().getAnchor() instanceof Constructor)) {
            instanceFactoryProvider.getInjectionSites().add(resource.getElement());
        }

        instanceFactoryProvider.setObjectFactory(resource.getElement(), factory);
    }
View Full Code Here

        this.instanceFactory = instanceFactoryProvider.createFactory();

    }

    void addResourceFactory(String name, ObjectFactory<?> factory) {
        JavaResourceImpl resource = instanceFactoryProvider.getImplementation().getResources().get(name);

        if (resource != null && !(resource.getElement().getAnchor() instanceof Constructor)) {
            instanceFactoryProvider.getInjectionSites().add(resource.getElement());
        }

        instanceFactoryProvider.setObjectFactory(resource.getElement(), factory);
    }
View Full Code Here

        String name = JavaIntrospectionHelper.toPropertyName(method.getName());
        if (ComponentContext.class.equals(paramType) || RequestContext.class.equals(paramType)) {
            JavaElementImpl element = new JavaElementImpl(method, 0);
            element.setName(name);
            element.setClassifer(org.apache.tuscany.sca.implementation.java.introspect.impl.Resource.class);
            JavaResourceImpl resource = new JavaResourceImpl(element);
            type.getResources().put(resource.getName(), resource);
        } else {
            throw new UnknownContextTypeException(paramType.getName());
        }
    }
View Full Code Here

        }
        Class<?> paramType = field.getType();
        if (ComponentContext.class.equals(paramType) || RequestContext.class.equals(paramType)) {
            JavaElementImpl element = new JavaElementImpl(field);
            element.setClassifer(Resource.class);
            JavaResourceImpl resource = new JavaResourceImpl(element);
            type.getResources().put(resource.getName(), resource);
        } else {
            throw new UnknownContextTypeException(paramType.getName());
        }
    }
View Full Code Here

        if (type.getResources().get(name) != null) {
            throw new DuplicateResourceException(name);
        }

        String mappedName = annotation.mappedName();
        JavaResourceImpl resource = createResource(name, new JavaElementImpl(method, 0));
        resource.setOptional(annotation.optional());
        if (mappedName.length() > 0) {
            resource.setMappedName(mappedName);
        }
        type.getResources().put(resource.getName(), resource);
    }
View Full Code Here

            throw new DuplicateResourceException(name);
        }

        String mappedName = annotation.mappedName();

        JavaResourceImpl resource = createResource(name, new JavaElementImpl(field));
        resource.setOptional(annotation.optional());
        if (mappedName.length() > 0) {
            resource.setMappedName(mappedName);
        }
        type.getResources().put(resource.getName(), resource);
    }
View Full Code Here

                throw new DuplicateResourceException(name);
            }

            String mappedName = resourceAnnotation.mappedName();

            JavaResourceImpl resource = createResource(name, parameter);
            resource.setOptional(resourceAnnotation.optional());
            if (mappedName.length() > 0) {
                resource.setMappedName(mappedName);
            }
            type.getResources().put(resource.getName(), resource);
        }
    }
View Full Code Here

     * @return
     */
    private static JavaResourceImpl createResource(String name, JavaElementImpl element) {
        element.setClassifer(org.apache.tuscany.sca.implementation.java.introspect.impl.Resource.class);
        element.setName(name);
        return new JavaResourceImpl(element);
    }
View Full Code Here

        String name = JavaIntrospectionHelper.toPropertyName(method.getName());
        if (ComponentContext.class.isAssignableFrom(paramType) || RequestContext.class.equals(paramType)) {
            JavaElementImpl element = new JavaElementImpl(method, 0);
            element.setName(name);
            element.setClassifer(org.apache.tuscany.sca.implementation.java.introspect.impl.Resource.class);
            JavaResourceImpl resource = new JavaResourceImpl(element);
            type.getResources().put(resource.getName(), resource);
        } else {
            throw new UnknownContextTypeException(paramType.getName());
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.implementation.java.JavaResourceImpl

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.