Examples of ServiceRegistryEntry


Examples of org.impalaframework.service.ServiceRegistryEntry

        emptyList.add(ref2);
        expect(serviceRegistry.getServices(filter, null, false)).andReturn(emptyList);
       
        replay(serviceRegistry);
       
        final ServiceRegistryEntry reference = this.targetSource.getServiceRegistryReference();
        assertNotNull(reference);
        assertSame(ref1, reference);
       
        verify(serviceRegistry);       
    }
View Full Code Here

Examples of org.impalaframework.service.ServiceRegistryEntry

        emptyList.add(ref1);
        expect(serviceRegistry.getServices(filter, null, false)).andReturn(emptyList);
       
        replay(serviceRegistry);
       
        final ServiceRegistryEntry serviceRegistryReference = this.targetSource.getServiceRegistryReference();
        assertNull(serviceRegistryReference);
       
        verify(serviceRegistry);       
    }
View Full Code Here

Examples of org.impalaframework.service.ServiceRegistryEntry

        }
       
        //we have new list so can use it outside synchronised block
        Iterator<ServiceRegistryEntry> iterator = list.iterator();
        while (iterator.hasNext()) {
            ServiceRegistryEntry serviceRegistryEntry = iterator.next();
           
            boolean removed = remove(serviceRegistryEntry);
            if (!removed) {
                //filter out the entries that weren't actually removed
                iterator.remove();
View Full Code Here

Examples of org.impalaframework.service.ServiceRegistryEntry

                }
            }
           
        } else {
            for (int i = 0; i < references.size(); i++) {
                final ServiceRegistryEntry ref = getMatchingReference(references, supportedTypes, i);
                if (ref != null) {
                    return ref;
                }
            }
        }
View Full Code Here

Examples of org.impalaframework.service.ServiceRegistryEntry

        if (exportTypesOnly) {
            //filter only export types
            filterReferenceByExportTypes(references, supportedTypes);
        } else {
            for (Iterator<ServiceRegistryEntry> iterator = references.iterator(); iterator.hasNext();) {
                ServiceRegistryEntry serviceReference = iterator.next();
                if (!classChecker.matchesTypes(serviceReference, supportedTypes)) {
                    iterator.remove();
                }
            }
        }
View Full Code Here

Examples of org.impalaframework.service.ServiceRegistryEntry

            //filter only export types
            filterReferenceByExportTypes(values, types);
               
            //check each entry against filter
            for (Iterator<ServiceRegistryEntry> iterator = values.iterator(); iterator.hasNext();) {
                ServiceRegistryEntry serviceReference = iterator.next();
              
                if (!filter.matches(serviceReference)) {
                    iterator.remove();
                }
            }
           
            return serviceReferenceSorter.sort(values, true);
        } else {
       
            //Create new list of services for concurrency protection
            final List<ServiceRegistryEntry> values;
           
            try {
                registryReadLock.lock();
                values = new LinkedList<ServiceRegistryEntry>(this.services);
            } finally {
                registryReadLock.unlock();
            }
           
            for (Iterator<ServiceRegistryEntry> iterator = values.iterator(); iterator.hasNext();) {
                ServiceRegistryEntry serviceReference = iterator.next();
              
                if (!(classChecker.matchesTypes(serviceReference, types) && filter.matches(serviceReference))) {
                    iterator.remove();
                }
            }
View Full Code Here

Examples of org.impalaframework.service.ServiceRegistryEntry

    private void filterReferenceByExportTypes(final List<ServiceRegistryEntry> values, Class<?>[] types) {
       
        Iterator<ServiceRegistryEntry> iterator = values.iterator();
        while (iterator.hasNext()) {
           
            ServiceRegistryEntry serviceReference = iterator.next();
           
            //note start index is 1 because we've already checked first type
            boolean isPresent = isPresentInExportTypes(serviceReference, types, 1);
            if (!isPresent) {
                iterator.remove();
View Full Code Here

Examples of org.impalaframework.service.ServiceRegistryEntry

    private ServiceRegistryEntry getMatchingReference(
            final List<ServiceRegistryEntry> list,
            Class<?>[] supportedTypes,
            int index) {
       
        final ServiceRegistryEntry reference = list.get(index);
        if (reference == null) {
            return null;
        }
       
        if (classChecker.matchesTypes(reference, supportedTypes)) {
View Full Code Here

Examples of org.impalaframework.service.ServiceRegistryEntry

               
                if (serviceRegistry != null) {
                    String moduleName = moduleDefinition.getName();
                    logger.info("Contributing bean " + beanName + " from module " + moduleName);
                    final ServiceBeanReference beanReference = SpringServiceBeanUtils.newServiceBeanReference(beanFactory, beanName);
                    final ServiceRegistryEntry serviceReference = serviceRegistry.addService(beanName, moduleName, beanReference, beanClassLoader);
                    contributionMap.put(serviceReference, endPoint);
                }  
            }      
        }
    }
View Full Code Here

Examples of org.impalaframework.service.ServiceRegistryEntry

            ServiceBeanReference beanReference,
            List<Class<?>> classes,
            Map<String, ?> attributes,
            ClassLoader classLoader) {
       
        ServiceRegistryEntry serviceEntry = entryRegistryDelegate.addService(beanName, moduleName, beanReference, classes, attributes, classLoader);
       
        if (logger.isDebugEnabled())
            logger.debug("Added service bean '" + beanName
                    + "' contributed from module '" + moduleName
                    + "' to service registry, with attributes " + attributes);
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.