Examples of ServiceRegistryEntry


Examples of org.impalaframework.service.ServiceRegistryEntry

        }
       
        for (int i = 0; i < beanNames.length; i++) {
            String beanName = beanNames[i];
            final ServiceBeanReference beanReference = SpringServiceBeanUtils.newServiceBeanReference(beanFactory, beanName);
            final ServiceRegistryEntry serviceReference = serviceRegistry.addService(exportNames[i], moduleDefinition.getName(), beanReference, beanClassLoader);
            services.add(serviceReference);
        }
    }
View Full Code Here

Examples of org.impalaframework.service.ServiceRegistryEntry

        }
    }

    @Override
    public int hashCode() {
        ServiceRegistryEntry entry = initServiceRegistryEntry();
        final int prime = 31;
        int result = 1;
        result = prime
                * result
                + ((entry == null) ? 0 : entry.hashCode());
        return result;
    }
View Full Code Here

Examples of org.impalaframework.service.ServiceRegistryEntry

        return result;
    }

    @Override
    public boolean equals(Object obj) {
        ServiceRegistryEntry entry =   
            initServiceRegistryEntry();
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        InfrastructureProxyIntroduction other = (InfrastructureProxyIntroduction) obj;
        final ServiceRegistryEntry otherEntry = other.initServiceRegistryEntry();
        if (entry == null) {
            if (otherEntry != null)
                return false;
        }
        else if (!entry.equals(otherEntry))
View Full Code Here

Examples of org.impalaframework.service.ServiceRegistryEntry

        if (moduleDefinition != null) {
            moduleName = moduleDefinition.getName();
        } else {
            moduleName = "internal";
        }
        ServiceRegistryEntry entry = new LocalOnlyServiceRegistryEntry(serviceBeanReference, getBeanNameToSearchFor(), moduleName, this.beanClassLoader);
       
        //no need to set context class loader as this is not being used to call across modules
        DefaultProxyFactoryCreator proxyFactoryCreator = new DefaultProxyFactoryCreator();
        proxyFactoryCreator.setSetContextClassLoader(false);
       
View Full Code Here

Examples of org.impalaframework.service.ServiceRegistryEntry

    public Object invoke(MethodInvocation invocation) throws Throwable {
       
        final boolean setCCCL = setContextClassLoader;
       
        ServiceRegistryEntry serviceReference = targetSource.getServiceRegistryReference();
       
        int retriesUsed = 0;
        while (serviceReference == null && retriesUsed < retryCount) {
            try {
                Thread.sleep(retryInterval);
            }
            catch (InterruptedException e) {
            }
            serviceReference = targetSource.getServiceRegistryReference();
            retriesUsed++;
        }

        if (serviceReference != null) {
           
            final Thread currentThread;
            final ClassLoader existingClassLoader;
            if (setCCCL) {
                currentThread = Thread.currentThread()
                existingClassLoader= currentThread.getContextClassLoader();
            } else {
                currentThread = null;
                existingClassLoader = null;
            }
           
            try {
                if (setCCCL) {
                    currentThread.setContextClassLoader(serviceReference.getBeanClassLoader());
                }
                return invocation.proceed();
               
            } finally {
                //reset the previous class loader
View Full Code Here

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

Examples of org.impalaframework.service.ServiceRegistryEntry

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

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

Examples of org.impalaframework.service.ServiceRegistryEntry

                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

Examples of org.impalaframework.service.ServiceRegistryEntry

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

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

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

            String moduleName = moduleName();
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
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.