Examples of NoSuchServiceException


Examples of org.oasisopen.sca.NoSuchServiceException

            // 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

Examples of org.oasisopen.sca.NoSuchServiceException

    @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

Examples of org.oasisopen.sca.NoSuchServiceException

   
    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

Examples of org.oasisopen.sca.NoSuchServiceException

            } catch(ServiceUnavailableException e) {
                // Ingore and continue
            }
        }

        throw new NoSuchServiceException(serviceName);
    }
View Full Code Here

Examples of org.oasisopen.sca.NoSuchServiceException

            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

Examples of org.oasisopen.sca.NoSuchServiceException

        }
       
        // 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

Examples of org.oasisopen.sca.NoSuchServiceException

    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {

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

        String uri = endpoints.get(0).getBinding().getURI();
//        RMIBindingInvoker invoker = new RMIBindingInvoker(rmiHost, uri, method);
//
View Full Code Here

Examples of org.oasisopen.sca.NoSuchServiceException

    @Override
    public <T> T getService(Class<T> serviceInterface, String serviceName) throws NoSuchServiceException, NoSuchDomainException {
       
        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

Examples of org.qi4j.api.service.NoSuchServiceException

            }
        }

        if( serviceReference == null )
        {
            throw new NoSuchServiceException( RAW_CLASS.map( serviceType ).getName(), moduleInstance.name() );
        }

        return (ServiceReference<T>) serviceReference;
    }
View Full Code Here

Examples of org.qi4j.api.service.NoSuchServiceException

        if( identity == null )
        {
            IdentityGenerator idGen = model.module().identityGenerator();
            if( idGen == null )
            {
                throw new NoSuchServiceException( IdentityGenerator.class.getName(), model.module().name() );
            }
            identity = idGen.generate( first( model.model().types() ) );
        }
        EntityBuilder<T> builder;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.