Package org.apache.tuscany.sca.contribution.resolver

Examples of org.apache.tuscany.sca.contribution.resolver.ClassReference


    public OSGiClassReferenceModelResolver(Contribution contribution, ExtensionPointRegistry registry) {
        this.contribution = contribution;
    }

    public void addModel(Object resolved) {
        ClassReference clazz = (ClassReference)resolved;
        map.put(clazz.getClassName(), clazz);
    }
View Full Code Here


     * Handle artifact resolution when the specific class reference is imported from another contribution
     * @param unresolved
     * @return
     */
    private ClassReference resolveImportedModel(ClassReference unresolved) {
        ClassReference resolved = unresolved;

        if (this.contribution != null) {
            for (Import import_ : this.contribution.getImports()) {

                if (resolved == unresolved && bundle != null) {
View Full Code Here

        }

        if (clazz != null) {
            //if we load the class           
            // Store a new ClassReference wrapping the loaded class
            ClassReference classReference = new ClassReference(clazz);
            map.put(getPackageName(classReference), classReference);

            // Return the resolved ClassReference
            return modelClass.cast(classReference);
        } else {
View Full Code Here

       
    }
   

    private Class getJavaClass(ModelResolver resolver, String className) {
        ClassReference ref = new ClassReference(className);
        ref = resolver.resolveModel(ClassReference.class, ref);
        return ref.getJavaClass();
    }
View Full Code Here

            return modelClass.cast(resolved);
           
        } else if (unresolved instanceof ClassReference) {
           
            // Load a class on demand
            ClassReference classReference = (ClassReference)unresolved;
            Class clazz = null;
            for (Bundle bundle : bundles.values()) {
                try {
                    clazz = bundle.loadClass(classReference.getClassName());
                } catch (ClassNotFoundException e) {
                    continue;
                }
                break;
            }
            if (clazz == null) {

                // Return the unresolved object
                return unresolved;
            }
           
            // Store a new ClassReference wrapping the loaded class
            resolved = new ClassReference(clazz);
            map.put(resolved, resolved);
           
            // Return the resolved ClassReference
            return modelClass.cast(resolved);
               
View Full Code Here

        return xqExpression;
    }
   
    private Class<?> resolveClass(ModelResolver resolver, String className) throws ClassNotFoundException {
        ClassReference classReference = new ClassReference(className);
        classReference = resolver.resolveModel(ClassReference.class, classReference);
        Class<?> javaClass = classReference.getJavaClass();
        if (javaClass == null) {
            throw new ClassNotFoundException(className);
        } else {
            return javaClass;
        }
View Full Code Here

            // Resolve the Java interface
            javaInterface = resolver.resolveModel(JavaInterface.class, javaInterface);
            if (javaInterface.isUnresolved()) {

                // If the Java interface has never been resolved yet, do it now
                ClassReference classReference = new ClassReference(javaInterface.getName());
                classReference = resolver.resolveModel(ClassReference.class, classReference);
                Class javaClass = classReference.getJavaClass();
                if (javaClass == null) {
                    error("ClassNotFoundException", resolver, javaInterface.getName());
                    return javaInterface;
                    //throw new ContributionResolveException(new ClassNotFoundException(javaInterface.getName()));
                }
View Full Code Here

    public OSGiClassReferenceModelResolver(Contribution contribution, ExtensionPointRegistry registry) {
        this.contribution = contribution;
    }

    public void addModel(Object resolved) {
        ClassReference clazz = (ClassReference)resolved;
        map.put(clazz.getClassName(), clazz);
    }
View Full Code Here

     * Handle artifact resolution when the specific class reference is imported from another contribution
     * @param unresolved
     * @return
     */
    private ClassReference resolveImportedModel(ClassReference unresolved) {
        ClassReference resolved = unresolved;

        if (this.contribution != null) {
            for (Import import_ : this.contribution.getImports()) {

                if (resolved == unresolved && bundle != null) {
View Full Code Here

        }

        if (clazz != null) {
            //if we load the class           
            // Store a new ClassReference wrapping the loaded class
            ClassReference classReference = new ClassReference(clazz);
            map.put(getPackageName(classReference), classReference);

            // Return the resolved ClassReference
            return modelClass.cast(classReference);
        } else {
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.contribution.resolver.ClassReference

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.