Package org.oasisopen.sca

Examples of org.oasisopen.sca.NoSuchServiceException


    public <T> T getService(Class<T> interfaze, String serviceURI) throws NoSuchServiceException {

        List<Endpoint> endpoints = endpointRegistry.findEndpoint(serviceURI);
        if (endpoints.size() < 1) {
            throw new NoSuchServiceException(serviceURI);
        }

        String serviceName = null;
        if (serviceURI.contains("/")) {
            int i = serviceURI.indexOf("/");
View Full Code Here


        }
       
        // assume that if a local node with the looked for domain name is found then that will 
        // know about all services in the domain so if the service isn't found then it doesn't exist
        if (foundDomain) {
            throw new NoSuchServiceException(serviceName);
        }
       
        InvocationHandler handler = new SCAClientHandler(getDomainURI().toString(), serviceName, serviceInterface);
        return (T)Proxy.newProxyInstance(serviceInterface.getClassLoader(), new Class[]{serviceInterface}, handler);
    }
View Full Code Here

       
        // The service is a component in a local runtime
        if (!remoteClient) {
            List<Endpoint> endpoints = domainRegistry.findEndpoint(serviceURI);
            if (endpoints.size() < 1) {
                throw new NoSuchServiceException(serviceURI);
            }
            Endpoint ep = endpoints.get(0);
            if (((RuntimeComponent)ep.getComponent()).getComponentContext() != null) {
                return ((RuntimeComponent)ep.getComponent()).getServiceReference(serviceInterface, serviceName).getService();
            }
View Full Code Here

            CompositeContext compositeContext = new CompositeContext(extensionsRegistry, domainRegistry, null, domainURI, null, null);

            List<Endpoint> eps = domainRegistry.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?
            
            if (serviceInterface == null) {
                try {
View Full Code Here

            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?
          
            RuntimeEndpointReference epr;
            try {
View Full Code Here

        }
       
        // assume that if a local node with the looked for domain name is found then that will 
        // know about all services in the domain so if the service isn't found then it doesn't exist
        if (foundDomain) {
            throw new NoSuchServiceException(serviceName);
        }
       
        InvocationHandler handler = new SCAClientHandler(getDomainURI().toString(), serviceName, serviceInterface);
        return (T)Proxy.newProxyInstance(serviceInterface.getClassLoader(), new Class[]{serviceInterface}, handler);
    }
View Full Code Here

    }

    public String call() throws Exception {
        RuntimeEndpoint endpoint = EndpointStash.getEndpoint(serviceURI);
        if (endpoint == null) {
            throw new NoSuchServiceException(serviceURI);
        }
        Operation operation = getRequestOperation(endpoint);
        DOMHelper domHelper = DOMHelper.getInstance(endpoint.getCompositeContext().getExtensionPointRegistry());
        Object[] args = getRequestArgs(domHelper);
        String responseXML;
View Full Code Here

            // TUSCANY-3590 - convert NoSuchDomainException to NoSuchService exception while
            //                we findout why this interface has changed
            try {
                handler = new RemoteServiceInvocationHandler(extensionPointRegistry, domainRegistry, getDomainURI().toString(), serviceURI, serviceInterface);
            } catch (NoSuchDomainException ex){
                throw new NoSuchServiceException(ex);
            }
        }
        if (serviceInterface == null) {
            serviceInterface = (Class<T>)((RemoteServiceInvocationHandler)handler).serviceInterface;
        }
View Full Code Here

    @Override
    public Endpoint findEndpoint(DomainRegistry domainRegistry, String serviceName) throws NoSuchServiceException {
        List<Endpoint> eps = domainRegistry.findEndpoint(serviceName);
        if (eps == null || eps.size() < 1) {
            throw new NoSuchServiceException(serviceName);
        }
       
        // remove any callback services from the array as we aren't
        // expecting SCA clients to connect to callback service
        Iterator<Endpoint> iterator = eps.iterator();
        while (iterator.hasNext()){
            Endpoint ep = iterator.next();
            if (ep.getService().isForCallback()){
                iterator.remove();
            }
        }

        // If lookup is by component name only and there are multiple matches, verify all matches
        // are from the same service.  Otherwise it is ambiguous which service the client wants.
        if (serviceName.indexOf('/') == -1 && eps.size() > 1) {
            ComponentService firstService = eps.get(0).getService();
            for (int i=1; i<eps.size(); i++) {
                if (firstService != eps.get(i).getService())
                    throw new ServiceRuntimeException("More than one service is declared on component " + serviceName
                    + ". Service name is required to get the service.");
            }
        }

        // If there is an Endpoint using the SCA binding use that
        for (Endpoint ep : eps) {
            if (SCABinding.TYPE.equals(ep.getBinding().getType())) {
                return ep;
            }
        }
       
        if (onlySCABinding) {
            throw new NoSuchServiceException(serviceName + " not found using binding.sca");
        }

        // There either is a single matching endpoint, or there are multiple endpoints (bindings)
        // under a single service. Just choose the first one
        return eps.get(0);
View Full Code Here

   
    public static <T> T getService(Class<T> interfaze, String serviceURI, DomainRegistry domainRegistry, ExtensionPointRegistry extensionPointRegistry, Deployer deployer) throws NoSuchServiceException {

        List<Endpoint> endpoints = domainRegistry.findEndpoint(serviceURI);
        if (endpoints.size() < 1) {
            throw new NoSuchServiceException(serviceURI);
        }

        String serviceName = null;
        if (serviceURI.contains("/")) {
            int i = serviceURI.indexOf("/");
View Full Code Here

TOP

Related Classes of org.oasisopen.sca.NoSuchServiceException

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.