Package org.apache.tuscany.sca.runtime

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


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

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


     * Choose the physical binding for service-side remotable binding.sca
     * @param endpoint
     * @return
     */
    protected QName chooseBinding(RuntimeEndpoint endpoint) {
        DomainRegistry domainRegistry = endpoint.getCompositeContext().getEndpointRegistry();
        boolean distributed = alwaysDistributed || domainRegistry.isDistributed();
        InterfaceContract interfaceContract = endpoint.getService().getInterfaceContract();
        if(interfaceContract != null
           && interfaceContract.getInterface() != null
           && interfaceContract.getInterface().isRemotable()
           && distributed
View Full Code Here

     * Choose the physical binding for reference-side remotable binding.sca
     * @param endpointReference
     * @return
     */
    protected QName chooseBinding(RuntimeEndpointReference endpointReference) {
        DomainRegistry domainRegistry = endpointReference.getCompositeContext().getEndpointRegistry();
        boolean distributed = alwaysDistributed || domainRegistry.isDistributed();
        if(endpointReference.getTargetEndpoint().isRemote()) {
            RuntimeComponentReference ref = (RuntimeComponentReference)endpointReference.getReference();
            if(ref.getInterfaceContract() != null && !ref.getInterfaceContract().getInterface().isRemotable()) {
                throw new ServiceRuntimeException("Reference interface not remotable for component: "
                        + endpointReference.getComponent().getName()
View Full Code Here

     */
    public static Node runComposite(URI domainURI, String compositeURI, String contributionURL, String... dependentContributionURLs) {
        try {
            TuscanyRuntime runtime = newInstance();
            String domain = domainURI == null ? DEFAUL_DOMAIN_NAME : domainURI.toString();
            DomainRegistry domainRegistry = runtime.domainRegistryFactory.getEndpointRegistry(domain, null);
            NodeImpl node = new NodeImpl(runtime.deployer, runtime.compositeActivator, domainRegistry, runtime.extensionPointRegistry, runtime);

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

     */
    public Node createNode(String domainURI) {
        if (domainURI == null){
            domainURI = DEFAUL_DOMAIN_NAME;
        }
        DomainRegistry domainRegistry = domainRegistryFactory.getEndpointRegistry(domainURI, null);
        return new NodeImpl(deployer, compositeActivator, domainRegistry, extensionPointRegistry, null);
    }
View Full Code Here

            domainProps.load(new FileInputStream(propsFile));
        }
        String domainName = domainProps.getProperty("domainName", directory.getName());
        String domainURI = domainProps.getProperty("domainURI", domainName);

        DomainRegistry domainRegistry = domainRegistryFactory.getEndpointRegistry(domainURI, domainName);
        Node node = new NodeImpl(deployer, compositeActivator, domainRegistry, extensionPointRegistry, null);

        List<String> installed = new ArrayList<String>();
        for (File f : directory.listFiles()) {
            if (f.getName().endsWith(".jar") || f.getName().endsWith(".zip") || (f.isDirectory() && !f.getName().startsWith("."))) {
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

            UtilityExtensionPoint utilities = nodeFactory.registry.getExtensionPoint(UtilityExtensionPoint.class);
            this.compositeActivator = utilities.getUtility(CompositeActivator.class);

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

            this.compositeContext =
                new CompositeContext(nodeFactory.registry, domainRegistry, domainComposite,
                                     configuration.getDomainURI(), configuration.getURI(), nodeFactory
                                         .getDeployer().getSystemDefinitions());
            // Pass down the context attributes
            compositeContext.getAttributes().putAll(configuration.getAttributes());
           
            // Add endpoint descriptions from the node configuration if the domain registry is local
            if (!domainRegistry.isDistributed()) {
                for (Endpoint e : configuration.getEndpointDescriptions()) {
                    domainRegistry.addEndpoint(e);
                }
            }
            // Activate the composite
            compositeActivator.activate(compositeContext, domainComposite);
View Full Code Here

                compositeActivator.deactivate(domainComposite);

            } // end if
           
            // Remove the external endpoint descriptions from node.xml
            DomainRegistry domainRegistry = compositeContext.getEndpointRegistry();
            if (!domainRegistry.isDistributed()) {
                for (Endpoint e : configuration.getEndpointDescriptions()) {
                    domainRegistry.removeEndpoint(e);
                }
            }

            nodeFactory.removeNode(configuration);
/*
 
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

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.