Package org.apache.tuscany.sca.runtime

Examples of org.apache.tuscany.sca.runtime.EndpointRegistry


        nodeFactory.init();
        nodeFactory.addNode(configuration, this);
        this.proxyFactory = nodeFactory.proxyFactory;
       
        DomainRegistryFactory domainRegistryFactory = ExtensibleDomainRegistryFactory.getInstance(nodeFactory.registry);
        EndpointRegistry endpointRegistry =
            domainRegistryFactory.getEndpointRegistry(configuration.getDomainRegistryURI(), configuration
                .getDomainURI());
       
        UtilityExtensionPoint utilities = nodeFactory.registry.getExtensionPoint(UtilityExtensionPoint.class);
        this.compositeActivator = utilities.getUtility(CompositeActivator.class);
View Full Code Here


        try {
            boolean sharedRuntime = runtime != null;
            if (runtime == null) {
                runtime = newInstance();
            }
            EndpointRegistry endpointRegistry = new EndpointRegistryImpl(runtime.extensionPointRegistry, null, null);
            NodeImpl node = new NodeImpl("default", runtime.deployer, runtime.compositeActivator, endpointRegistry, runtime.extensionPointRegistry, sharedRuntime? null : runtime);

            if (dependentContributionURLs != null) {
                for (int i=dependentContributionURLs.length-1; i>-1; i--) {
                    node.installContribution(null, dependentContributionURLs[i], null, null, false);
View Full Code Here

    public Node createNode(String domainURI) {
        String domainName = "default";
        if (domainURI != null){
            domainName = getDomainName(domainURI);
        }
        EndpointRegistry endpointRegistry = domainRegistryFactory.getEndpointRegistry(domainURI, domainName);
        return new NodeImpl(domainName, deployer, compositeActivator, endpointRegistry, extensionPointRegistry, null);
    }
View Full Code Here

            }
            if (registryURI.startsWith("tuscany:")) {
                registryURI = "tuscanyclient:" + registryURI.substring(8);
            }
           
            EndpointRegistry endpointRegistry;
            try {
                endpointRegistry = domainRegistryFactory.getEndpointRegistry(registryURI, domainURI);
            } catch (Exception e) {
                throw new NoSuchDomainException(domainURI, e);
            }
           
            FactoryExtensionPoint factories = extensionsRegistry.getExtensionPoint(FactoryExtensionPoint.class);
            AssemblyFactory assemblyFactory = factories.getFactory(AssemblyFactory.class);
            JavaInterfaceFactory javaInterfaceFactory = factories.getFactory(JavaInterfaceFactory.class);
            ProxyFactory proxyFactory = new ExtensibleProxyFactory(extensionsRegistry.getExtensionPoint(ProxyFactoryExtensionPoint.class));

            String client = "sca.client." + UUID.randomUUID();
            CompositeContext compositeContext =
                new CompositeContext(extensionsRegistry, endpointRegistry, null, domainURI.toString(), client, nodeFactory.getDeployer().getSystemDefinitions());

            List<Endpoint> eps = endpointRegistry.findEndpoint(serviceName);
            if (eps == null || eps.size() < 1) {
                throw new NoSuchServiceException(serviceName);
            }
            Endpoint endpoint = eps.get(0); // TODO: what should be done with multiple endpoints?
          
View Full Code Here

     * @return a Node with installed contributions
     */
    public static Node newStandaloneNode(String compositeURI, String contributionURL, String... dependentContributionURLs) {
        try {
            NodeFactory nodeFactory = newInstance();
            EndpointRegistry endpointRegistry = new EndpointRegistryImpl(nodeFactory.extensionPointRegistry, null, null);
            NodeImpl node = new NodeImpl("default", nodeFactory.deployer, nodeFactory.compositeActivator, endpointRegistry, nodeFactory.extensionPointRegistry, nodeFactory);

            if (dependentContributionURLs != null) {
                for (int i=dependentContributionURLs.length-1; i>-1; i--) {
                    node.installContribution(null, dependentContributionURLs[i], null, null, false);
View Full Code Here

    public Node createNode(String domainURI) {
        String domainName = "default";
        if (domainURI != null){
            domainName = getDomainName(domainURI);
        }
        EndpointRegistry endpointRegistry = domainRegistryFactory.getEndpointRegistry(domainURI, domainName);
        return new NodeImpl(domainName, deployer, compositeActivator, endpointRegistry, extensionPointRegistry, null);
    }
View Full Code Here

        nodeFactory.init();
        nodeFactory.addNode(configuration, this);
        this.proxyFactory = nodeFactory.proxyFactory;
       
        DomainRegistryFactory domainRegistryFactory = ExtensibleDomainRegistryFactory.getInstance(nodeFactory.registry);
        EndpointRegistry endpointRegistry =
            domainRegistryFactory.getEndpointRegistry(configuration.getDomainRegistryURI(), configuration
                .getDomainURI());
       
        UtilityExtensionPoint utilities = nodeFactory.registry.getExtensionPoint(UtilityExtensionPoint.class);
        this.compositeActivator = utilities.getUtility(CompositeActivator.class);
View Full Code Here

        EndpointReferenceBinder endpointReferenceBinder = registry.getExtensionPoint(EndpointReferenceBinder.class);
        DomainRegistryFactory domainRegistryFactory = ExtensibleDomainRegistryFactory.getInstance(registry);
       
        // create temporary local registry for all available local endpoints
        // TODO - need a better way of getting a local registry
        EndpointRegistry registry = domainRegistryFactory.getEndpointRegistry("vm://tmp", "local");
       
        // populate the registry with all the endpoints that are currently present in the model
        populateLocalRegistry(composite, registry);
       
        // look at all the endpoint references and try to match them to
        // any local endpoints
        for (EndpointReference endpointReference : registry.getEndpointReferences()){
            endpointReferenceBinder.bindBuildTime(registry, endpointReference);
        }
       
        // remove the local registry
        domainRegistryFactory.getEndpointRegistries().remove(registry);
View Full Code Here

   * @return - the EndpointRegistry containing the Endpoint with the supplied URI - null if no
   *           such EndpointRegistry can be found
   */
  private EndpointRegistry getEndpointRegistry(String uri) {
    ExtensionPointRegistry registry   = null;
    EndpointRegistry endpointRegistry = null;
   
    CompositeContext context = CompositeContext.getCurrentCompositeContext();
    if( context == null && requestEndpoint != null ) context = requestEndpoint.getCompositeContext();
    if( context != null ) {
      registry = context.getExtensionPointRegistry();
      endpointRegistry = getEndpointRegistry( registry );
      if( endpointRegistry != null ) {
        this.registry = registry;
        return endpointRegistry;
      } // end if
    } // end if
   
    // Deal with the case where there is no context available
      for( NodeFactory factory : NodeFactory.getNodeFactories() ) {
        registry = factory.getExtensionPointRegistry();
        if( registry != null ) {
          // Find the actual Endpoint in the EndpointRegistry
            endpointRegistry = getEndpointRegistry( registry );
               
                if( endpointRegistry != null ) {
                    for( Endpoint endpoint : endpointRegistry.findEndpoint(uri) ) {
                      // TODO: For the present, simply return the first registry with a matching endpoint
                      this.registry = registry;
                      return endpointRegistry;
                    } // end for
                } // end if
View Full Code Here

            if( domainURI.equals( endpointRegistry.getDomainURI() ) ) return endpointRegistry;
          } // end for
        } // end if
       
        // if there was no domainName to match, simply return the first EndpointRegistry...
        EndpointRegistry endpointRegistry = (EndpointRegistry) domainRegistryFactory.getEndpointRegistries().toArray()[0];
       
     
      return endpointRegistry;
    } // end method
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.runtime.EndpointRegistry

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.