Package org.apache.tuscany.sca.runtime

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


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


        } // end if
       
        // if there was no domainName to match, simply return the first DomainRegistry if there is one...
       
        if (domainRegistryFactory.getEndpointRegistries().size() > 0){
            DomainRegistry domainRegistry = (DomainRegistry) domainRegistryFactory.getEndpointRegistries().toArray()[0];
            return domainRegistry;
        } else {
            return null;
        }
       
View Full Code Here

    // Get the DomainRegistry
        DomainRegistryFactory domainRegistryFactory = ExtensibleDomainRegistryFactory.getInstance(registry);
        if( domainRegistryFactory == null ) return null;
       
        // TODO: For the moment, just use the first (and only!) DomainRegistry...
        DomainRegistry domainRegistry = (DomainRegistry) domainRegistryFactory.getEndpointRegistries().toArray()[0];
        if( domainRegistry == null ) return null;
       
        for( EndpointReference epReference : domainRegistry.getEndpointReferences() ) {
          // TODO: For the present, simply return the first matching endpointReference
          if( epReference.getURI().equals(epr.getURI()) ) {
              return (RuntimeEndpointReferenceImpl) epReference;
          } // end if
        } // end for
View Full Code Here

    public LocalDomainRegistryFactory(ExtensionPointRegistry registry) {
        super(registry);
    }

    protected DomainRegistry createEndpointRegistry(String endpointRegistryURI, String domainURI) {
        DomainRegistry domainRegistry =
            new DomainRegistryImpl(registry, endpointRegistryURI, domainURI);
        return domainRegistry;
    }
View Full Code Here

     
      // Store the new callback EPR into the Endpoint
      this.getCallbackEndpointReferences().add(asyncEPR);
     
      // Also store the callback EPR into the DomainRegistry
      DomainRegistry epReg = getEndpointRegistry( registry );
      if( epReg != null ) epReg.addEndpointReference(asyncEPR);
    } // end method createAsyncServerCallback
View Full Code Here

     * @param registry - the main extension point Registry
     * @return the corresponding Endpoint from the DomainRegistry, or null if no match can be found
     */
    private RuntimeEndpointImpl findActualEP(RuntimeEndpointImpl ep,
      ExtensionPointRegistry registry) {
    DomainRegistry domainRegistry = getEndpointRegistry( registry );
       
        if( domainRegistry == null ) return null;
       
        for( Endpoint endpoint : domainRegistry.findEndpoint(ep.getURI()) ) {
          // TODO: For the present, simply return the first matching endpoint
          return (RuntimeEndpointImpl) endpoint;
        } // end for
       
    return null;
View Full Code Here

        DomainRegistryFactory domainRegistryFactory = ExtensibleDomainRegistryFactory.getInstance(registry);
       
        if( domainRegistryFactory == null ) return null;
       
        // TODO: For the moment, just use the first (and only!) DomainRegistry...
        DomainRegistry domainRegistry = (DomainRegistry) domainRegistryFactory.getEndpointRegistries().toArray()[0];
     
      return domainRegistry;
    } // end method
View Full Code Here

                    this.compositeActivator = utilities.getUtility(CompositeActivator.class);

                    domainComposite = nodeFactory.configureNode(configuration, contributions, context);

                    DomainRegistryFactory domainRegistryFactory = ExtensibleDomainRegistryFactory.getInstance(nodeFactory.registry);
                    DomainRegistry domainRegistry =
                        domainRegistryFactory.getEndpointRegistry(configuration.getDomainRegistryURI(), configuration.getDomainURI());

                    this.compositeContext =
                        new CompositeContext(nodeFactory.registry,
                                             domainRegistry,
View Full Code Here

    // The following operations gives references a chance to bind to
    // services at deployment time.
   
    private void buildTimeReferenceBind(Composite domainComposite, BuilderContext context){
        // create temporary local registry for all available local endpoints
        DomainRegistry domainRegistry = new LocalEndpointRegistry(registry);
       
        // populate the registry with all the endpoints that are present in the model
        populateLocalRegistry(domainComposite, domainRegistry, context);       
       
        // match all local services against the endpoint references
View Full Code Here

    boolean services() throws IOException {
        if (getNode() == null) {
            return true;
        }
        DomainRegistry reg = ((NodeImpl)getNode()).getEndpointRegistry();
        for (Endpoint endpoint : reg.getEndpoints()) {
            out.println(endpoint.getComponent().getURI() + "/" + endpoint.getService().getName());
            for (Binding b : endpoint.getService().getBindings()) {
                if (!SCABinding.TYPE.equals(b.getType())) {
                    out.println("    " + b.getType().getLocalPart() + " " + b.getURI());
                }
View Full Code Here

TOP

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

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.