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

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


       
        for (Component component : composite.getComponents()) {
          for (ComponentProperty prop : component.getProperties()) {
            String file = prop.getFile();
             if (file != null) {
              ResourceReference resourceRef = new ResourceReference(file);
              resourceRef = resolver.resolveModel(ResourceReference.class, resourceRef);

              try {
                  if (!resourceRef.isUnresolved()) {
              prop.setFile(resourceRef.getResource().toURI().toString());
           
                  }
              } catch (URISyntaxException e) {
                    throw new IllegalArgumentException(e);
                  }
View Full Code Here


        } catch (Exception e) {
        }
    }

    public void addModel(Object resolved) {
        ResourceReference resourceRef = (ResourceReference)resolved;
        map.put(resourceRef.getResourceName(), resourceRef);
    }
View Full Code Here

            resourceURL = classLoader.get().getResource(resourceName);
        }

        if (resourceURL != null) {
            // Store a new ResourceReference wrappering the resource
            ResourceReference resourceReference = new ResourceReference(resourceName, resourceURL);
            map.put(resourceName, resourceReference);

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

     * introspector
     */
    public void resolve(XQueryImplementation xqueryImplementation, ModelResolver resolver)
        throws ContributionResolveException {
     
      ResourceReference resourceRef = new ResourceReference(xqueryImplementation.getLocation());
      resourceRef = resolver.resolveModel(ResourceReference.class, resourceRef);
      if (resourceRef.isUnresolved()) {
            throw new ContributionResolveException("Could not locate file: " + xqueryImplementation.getLocation());
        }
      xqueryImplementation.setLocationURL(resourceRef.getResource());

        XQueryIntrospector introspector = new XQueryIntrospector(assemblyFactory, javaFactory);

        boolean success = introspector.introspect(xqueryImplementation, resolver);

View Full Code Here

    private void importWSDL(ImportSDO importSDO, ModelResolver resolver) throws ContributionResolveException {
        String location = importSDO.getSchemaLocation();
        if (location != null) {
            try {
                URL wsdlURL = null;
                ResourceReference reference = new ResourceReference(location);
                ResourceReference resolved = resolver.resolveModel(ResourceReference.class, reference);
                if (resolved == null || resolved.isUnresolved()) {
                    ContributionResolveException loaderException =
                        new ContributionResolveException("Fail to resolve location: " + location);
                    throw loaderException;
                }

                wsdlURL = resolved.getResource();
                InputStream xsdInputStream = wsdlURL.openStream();
                try {
                    XSDHelper xsdHelper = importSDO.getHelperContext().getXSDHelper();
                    xsdHelper.define(xsdInputStream, wsdlURL.toExternalForm());
                } finally {
View Full Code Here

    public OSGiResourceReferenceModelResolver(Contribution contribution, ModelFactoryExtensionPoint modelFactories) {
        this.contribution = contribution;
    }

    public void addModel(Object resolved) {
        ResourceReference resourceRef = (ResourceReference)resolved;
        map.put(resourceRef.getResourceName(), resourceRef);
    }
View Full Code Here

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

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

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

            }
        }

        if (resourceURL != null) {      
            // Store a new ResourceReference wrappering the resource
          ResourceReference resourceReference = new ResourceReference(resourceName, resourceURL);
            map.put(resourceName, resourceReference);

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

    }
   
    public void resolve(ModelResolver resolver) {
     
      if (scriptName != null) {
          ResourceReference resourceRef = new ResourceReference(scriptName);
          resourceRef = resolver.resolveModel(ResourceReference.class, resourceRef);
          if (!resourceRef.isUnresolved())
            scriptURL = resourceRef.getResource();
      }
    }
View Full Code Here

TOP

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

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.