Package org.impalaframework.service

Examples of org.impalaframework.service.ServiceRegistryEntry


        final Method method = invocation.getMethod();
        final Object[] arguments = invocation.getArguments();
       
        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 AopUtils.invokeJoinpointUsingReflection(serviceReference.getServiceBeanReference().getService(), method, arguments);
               
            } finally {
                //reset the previous class loader
                if (setCCCL) {
                    Thread.currentThread().setContextClassLoader(existingClassLoader);
View Full Code Here


               
                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

        }
    }

    @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

        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

        }
       
        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

     *
     * Each time {@link #getTarget()} is called, the object is looked up from the service registry.
     * No cacheing is involved.
     */
    public Object getTarget() throws Exception {
        ServiceRegistryEntry reference = getServiceRegistryReference();
        if (reference != null) {
            return reference.getServiceBeanReference().getService();
        }
        return null;
    }
View Full Code Here

               
                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

        }
       
        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

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

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.