Package org.apache.tuscany.sca.contribution.service

Examples of org.apache.tuscany.sca.contribution.service.ContributionResolveException


            new SpringXMLComponentTypeLoader(assemblyFactory, javaFactory, policyFactory);
        try {
            // Load the Spring Implementation information from its application context file...
            springLoader.load(springImplementation);
        } catch (ContributionReadException e) {
          ContributionResolveException ce = new ContributionResolveException(e);
          error("ContributionResolveException", resolver, ce);
            throw ce;
        }

        ComponentType ct = springImplementation.getComponentType();
View Full Code Here


          callPT = partnerRolePT;
        } // end if
        // No interfaces mean an error - throw an exception
        if( callPT == null && callbackPT == null ) {
          error("MyRolePartnerRoleNull", theInterfaces);
          throw new ContributionResolveException("Error: myRole and partnerRole port types are both null");
        } // end if
       
        // Set the name of the reference to the supplied name and the multiplicity of the reference
        // to 1..1
        // TODO: support other multiplicities
        reference.setName(name);
        reference.setMultiplicity(Multiplicity.ONE_ONE);
       
        if ( callPT != null ) {
            // Set the call interface and, if present, the callback interface
            WSDLInterface callInterface = null;
            for( WSDLInterface anInterface : theInterfaces ) {
              if( anInterface.getPortType().getQName().equals(callPT.getQName())) callInterface = anInterface;
            } // end for
            // Throw an exception if no interface is found
            if( callInterface == null ) {
              error("NoInterfaceForPortType", theInterfaces, callPT.getQName().toString());
              throw new ContributionResolveException("Interface not found for port type " +
                  callPT.getQName().toString() );
            } else
                reference.getInterfaceContract().setInterface(callInterface);
        }
        // There is a callback if the partner role is not null and if the partner role port type
        // is not the same as the port type for my role
        if ( callbackPT != null ) {
            WSDLInterface callbackInterface = null;
            for( WSDLInterface anInterface : theInterfaces ) {
              if( anInterface.getPortType().getQName().equals(callbackPT.getQName())) callbackInterface = anInterface;
            } // end for
            // Throw an exception if no interface is found
            if( callbackInterface == null ) {
              error("NoInterfaceForPortType", theInterfaces, callbackPT.getQName().toString());
              throw new ContributionResolveException("Interface not found for port type " +
                  callbackPT.getQName().toString() );
            } else
                reference.getInterfaceContract().setCallbackInterface(callbackInterface);
        } // end if
     
View Full Code Here

          callPT = partnerRolePT;
        } // end if
        // No interfaces mean an error - throw an exception
        if( callPT == null && callbackPT == null ) {
          error("MyRolePartnerRoleNull", theInterfaces);
          throw new ContributionResolveException("Error: myRole and partnerRole port types are both null");
        } // end if

        if ( callPT != null ) {
            // Set the call interface and, if present, the callback interface
            WSDLInterface callInterface = null;
            for( WSDLInterface anInterface : theInterfaces ) {
              if( anInterface.getPortType().getQName().equals(callPT.getQName())) callInterface = anInterface;
            } // end for
            // Throw an exception if no interface is found
            if( callInterface == null ) {
              error("NoInterfaceForPortType", theInterfaces, callPT.getQName().toString());
              throw new ContributionResolveException("Interface not found for port type " +
                  callPT.getQName().toString() );
            } else
                service.getInterfaceContract().setInterface(callInterface);
        } // end if
       
        // There is a callback if the partner role is not null and if the partner role port type
        // is not the same as the port type for my role
        if ( callbackPT != null ) {
            WSDLInterface callbackInterface = null;
            for( WSDLInterface anInterface : theInterfaces ) {
              if( anInterface.getPortType().getQName().equals(callbackPT.getQName())) callbackInterface = anInterface;
            } // end for
            // Throw an exception if no interface is found
            if( callbackInterface == null ) {
              error("NoInterfaceForPortType", theInterfaces, callbackPT.getQName().toString());
              throw new ContributionResolveException("Interface not found for port type " +
                  callbackPT.getQName().toString() );
            } else
                service.getInterfaceContract().setCallbackInterface(callbackInterface);
        } // end if
     
View Full Code Here

              try {
                    Class<?> factoryClass = resolved.getJavaClass();
                    register(factoryClass, importSDO.getHelperContext());
                    importSDO.setUnresolved(false);
                } catch (Exception e) {
                  ContributionResolveException ce = new ContributionResolveException(e);
                  error("ContributionResolveException", resolver, ce);
                    //throw ce;
                }               
            } else {
              error("FailToResolveClass", resolver, factoryName);
View Full Code Here

                     error("FailToResolveLocation", resolver, location);
                    //ContributionResolveException loaderException = new ContributionResolveException("Fail to resolve location: " + location);
                    //throw loaderException;
                }               
            } catch (IOException e) {
              ContributionResolveException ce = new ContributionResolveException(e);
              error("ContributionResolveException", resolver, ce);
                //throw ce;
            }           
        }
    }
View Full Code Here

                            wsdlDefinition.setDefinition(portType.getDefinition());
                            wsdlInterface = wsdlFactory.createWSDLInterface(portType.getElement(), wsdlDefinition, resolver);
                            wsdlInterface.setWsdlDefinition(wsdlDefinition);
                            resolver.addModel(wsdlInterface);
                        } catch (InvalidInterfaceException e) {
                          ContributionResolveException ce = new ContributionResolveException(e);
                          error("ContributionResolveException", wsdlFactory, ce);
                            //throw ce;
                        }                       
                    }
                    else {
View Full Code Here

                                imp.setDefinition(resolved.getDefinition());
                                if (!model.getImportedDefinitions().contains(resolved)) {
                                    model.getImportedDefinitions().add(resolved);
                                }
                            } catch (Exception e) {
                              ContributionResolveException ce = new ContributionResolveException(e);
                              error("ContributionResolveException", resolver, ce);
                                //throw ce;
                            }
                        } else {
                            if (location.startsWith("/")) {
                                // This is a relative URI against a contribution
                                location = location.substring(1);
                                // TODO: Need to resolve it against the contribution
                            } else {
                                // This is a relative URI against the WSDL document
                                URI baseURI = URI.create(model.getDefinition().getDocumentBaseURI());
                                URI locationURI = baseURI.resolve(location);
                                WSDLDefinition resolved;
                                try {
                                    resolved = read(null, locationURI, locationURI.toURL());
                                    imp.setDefinition(resolved.getDefinition());
                                    if (!model.getImportedDefinitions().contains(resolved)) {
                                        model.getImportedDefinitions().add(resolved);
                                    }
                                } catch (Exception e) {
                                  ContributionResolveException ce = new ContributionResolveException(e);
                                  error("ContributionResolveException", resolver, ce);
                                    //throw ce;
                                }
                            }
                        }
View Full Code Here

                break;
              } // end if
            } // end for
            if( count == 0 ) {
                error("PartnerLinkTypeNoRoles", theElement, pLinkElement.getName());
                throw new ContributionResolveException( "partnerLinkType " +
                    pLinkElement.getName() +" has no Roles defined" );
            } else                                        
                thePLinks.add( pLinkElement );
          } // end if
         
View Full Code Here

                        theWSDL.setDefinition( wsdlPortType.getDefinition() );
                        wsdlInterface = WSDLfactory.createWSDLInterface(wsdlPortType.getElement(),
                            theWSDL, resolver);
                        wsdlInterface.setWsdlDefinition(theWSDL);
                    } catch (InvalidInterfaceException e) {
                      ContributionResolveException ce = new ContributionResolveException(e);
                      error("ContributionResolveException", resolver, ce);
                        throw ce;
                    } // end try
                    resolver.addModel(wsdlInterface);
                    theInterfaces.add(wsdlInterface);
View Full Code Here

                      new WidgetImplementationIntrospector(assemblyFactory, implementation);
                    widgetIntrospector.introspectImplementation();
                   
                    implementation.setUnresolved(false);
                } catch (IOException e) {
                  ContributionResolveException ce = new ContributionResolveException(e);
                  error("ContributionResolveException", resolver, ce);
                    //throw ce;
                }
            } else {
                error("CouldNotResolveLocation", resolver, implementation.getLocation());
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.contribution.service.ContributionResolveException

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.