Package org.apache.hivemind.service

Examples of org.apache.hivemind.service.Autowiring


        ImplementationConstructor constructor = new AbstractServiceImplementationConstructor(md.getLocation())
        {
            public Object constructCoreServiceImplementation(ImplementationConstructionContext context)
            {
                List strategies = (List) context.getConfiguration("AutowiringStrategies");
                Autowiring result = new AutowiringImpl(context.getRegistry(), strategies, context.getDefiningModule().getErrorHandler());
                return result;
            }
        };
        helper.addServiceImplementation(spd, constructor, ServiceModel.PRIMITIVE);
View Full Code Here


        registry.getService(StringHolder.class, null);
        registryControl.setReturnValue(new StringHolderImpl());

        replayControls();
       
        Autowiring autowiring = new AutowiringImpl(registry, strategyContributions, new DefaultErrorHandler());
        autowiring.autowireProperties(target, new String[] {"stringHolder"});

        verifyControls();

        assertNotNull(target.getStringHolder());
    }
View Full Code Here

        strategy1.autowireProperty(registry, target, "stringHolder");
        strategy1Control.setReturnValue(false);
       
        replayControls();
       
        Autowiring autowiring = new AutowiringImpl(registry, strategyContributions, new DefaultErrorHandler());
        autowiring.autowireProperties("strategy1", target);

        verifyControls();

    }
View Full Code Here

        MockControl registryControl = newControl(RegistryInfrastructure.class);
        RegistryInfrastructure registry = (RegistryInfrastructure) registryControl.getMock();
       
        replayControls();
       
        Autowiring autowiring = new AutowiringImpl(registry, strategyContributions, new DefaultErrorHandler());
        autowiring.autowireProperties(target);

        verifyControls();

    }
View Full Code Here

        MockControl registryControl = newControl(RegistryInfrastructure.class);
        RegistryInfrastructure registry = (RegistryInfrastructure) registryControl.getMock();
       
        replayControls();
       
        Autowiring autowiring = new AutowiringImpl(registry, strategyContributions, new DefaultErrorHandler());
        autowiring.autowireProperties(target);

        verifyControls();

    }
View Full Code Here

        }
    }

    private void autowireServices(Object service, Collection propertyNames)
    {
        Autowiring autowiring = (Autowiring) _contributingModule.getService(HiveMind.AUTOWIRING_SERVICE, Autowiring.class);
       
        String[] props = (String[]) propertyNames.toArray(new String[propertyNames.size()]);
        autowiring.autowireProperties(AutowiringStrategy.BY_TYPE, service, props);
    }
View Full Code Here

TOP

Related Classes of org.apache.hivemind.service.Autowiring

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.