Package org.impalaframework.service

Examples of org.impalaframework.service.ServiceRegistryEntry


    }
   
    /* ******************* Private and package method ******************** */
   
    private void handleEventRemoved(ServiceRegistryEvent event) {
        ServiceRegistryEntry ref = event.getServiceRegistryEntry();
       
        //no particular point matching before removing as it is more extra work than
        //simply calling remove.
        serviceActivityNotifiable.remove(ref);
    }
View Full Code Here


        //simply calling remove.
        serviceActivityNotifiable.remove(ref);
    }

    void handleEventAdded(ServiceRegistryEvent event) {
        ServiceRegistryEntry entry = event.getServiceRegistryEntry();
        handleReferenceAdded(entry);
    }
View Full Code Here

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

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

        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

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

    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

    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

                NamedServiceEndpoint endPoint = SpringModuleServiceUtils.findServiceEndpoint(beanFactory, beanName);
                if (hasRegisterableEndpoint(beanName, endPoint)) {         
                    logger.info("Contributing bean " + beanName + " from module " + moduleName);
                   
                    final ServiceBeanReference service = new StaticSpringServiceBeanReference(bean);
                    final ServiceRegistryEntry serviceReference = serviceRegistry.addService(beanName, moduleName, service, beanClassLoader);
                    referenceMap.put(beanName, serviceReference);
                }  
            } else {
               
                if (logger.isDebugEnabled()) {
View Full Code Here

    /* *************** DestructionAwareBeanPostProcessor methods ************** */

    public void maybeUnexportBean(Object bean, String beanName) throws BeansException {

        final String moduleName = moduleName();
        final ServiceRegistryEntry serviceRegistryReference = referenceMap.get(beanName);
       
        //if we have reference for this bean
        if (serviceRegistryReference != null) {

            logger.info("Removing bean " + beanName + " contributed from module " + moduleName);
View Full Code Here

TOP

Related Classes of org.impalaframework.service.ServiceRegistryEntry

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.