Package org.impalaframework.service

Examples of org.impalaframework.service.ServiceRegistryEntry


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


        }
    }

    @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

            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

               
                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 = SpringModuleServiceUtils.newServiceBeanReference(beanFactory, beanName);
            final ServiceRegistryEntry serviceReference = serviceRegistry.addService(exportNames[i], moduleDefinition.getName(), beanReference, beanClassLoader);
            services.add(serviceReference);
        }
    }
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 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

public class ServiceRegistryEntryTest extends TestCase {

    public void testConstruct() throws Exception {
        ClassLoader classLoader = ClassUtils.getDefaultClassLoader();
        ServiceRegistryEntry entry = new StaticServiceRegistryEntry("service1","beanName",
                "moduleName", classLoader);
        assertEquals(0, entry.getAttributes().size());
        assertSame(classLoader, entry.getBeanClassLoader());
        assertTrue(entry.getExportTypes().isEmpty());
    }
View Full Code Here

        assertSame(classLoader, entry.getBeanClassLoader());
        assertTrue(entry.getExportTypes().isEmpty());
    }
   
    public void testConstructAttributes() throws Exception {
        ServiceRegistryEntry entry = new StaticServiceRegistryEntry("service1","beanName",
                "moduleName", null, Collections.singletonMap("attribute","value"), ClassUtils.getDefaultClassLoader());
        assertEquals(1, entry.getAttributes().size());
    }
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.