Package org.apache.hivemind.definition

Examples of org.apache.hivemind.definition.ModuleDefinition


    // is failing inside Eclipse.  It appears the be a Log4J
    // configuration problem ... but I have no idea why.

    public void testInterceptorSort() throws Exception
    {
        ModuleDefinition module = new SimpleModule();
        ServicePointDefinition servicePoint = module.getServicePoint("Simple");
       
        InterceptorDefinition interceptor1 = new OrderedInterceptorDefinitionImpl(module, "Fred", newLocation(), new TrackerServiceInterceptorConstructor("Fred"), "Barney", null);
        servicePoint.addInterceptor(interceptor1);
        InterceptorDefinition interceptor2 = new OrderedInterceptorDefinitionImpl(module, "Barney", newLocation(), new TrackerServiceInterceptorConstructor("Barney"), null, null);
        servicePoint.addInterceptor(interceptor2);
View Full Code Here


        module.setModuleId("module");
        module.toString();
        new RegistryInfrastructureImpl(null, Locale.ENGLISH).toString();
        new InterceptorStackImpl(null, mockServicePoint, null).toString();

        ModuleDefinition md = new ModuleDefinitionImpl("module", null, null, null);
        ServicePointDefinitionImpl spd = new ServicePointDefinitionImpl(md, "service", null,
                Visibility.PUBLIC, Runnable.class.getName());
        ImplementationDefinition sid = new ImplementationDefinitionImpl(md,
                null, null, ServiceModel.PRIMITIVE, true);
        spd.addImplementation(sid);
View Full Code Here

        // For the sake of backward compatibility add the core
        // to an existing module that may have been created by the XmlRegistryProvider
        // This way the core services and the hivemodule.xml from the xml package share
        // the same module name "hivemind"

        ModuleDefinition md = registryDefinition.getModule("hivemind");
        if (md == null)
        {
            md = new ModuleDefinitionImpl("hivemind", HiveMind.getClassLocation(getClass(), resolver),
                    resolver, null);
            registryDefinition.addModule(md);
View Full Code Here

        ServicePoint point = (ServicePoint) pointControl.getMock();
       
        SchemaImpl schema = new SchemaImpl("module");
        schema.setRootElementClassName(ArrayList.class.getName());
       
        ModuleDefinition md = createModuleDefinition("test");
        XmlServicePointDefinitionImpl xmlSpd = new XmlServicePointDefinitionImpl(md);
        xmlSpd.setParametersCount(Occurances.REQUIRED);
        xmlSpd.setParametersSchema(schema);
       
        Location location = newLocation();
View Full Code Here

    protected Registry buildFrameworkRegistry(ModuleDefinition[] customModules)
    {
        RegistryDefinition registryDefinition = new RegistryDefinitionImpl();
        for (int i = 0; i < customModules.length; i++)
        {
            ModuleDefinition module = customModules[i];
            registryDefinition.addModule(module);
        }

        RegistryBuilder builder = new RegistryBuilder(registryDefinition);
        return builder.constructRegistry(Locale.getDefault());
View Full Code Here

    }

    public void testGetUnqualifiedServicePoint()
    {
        RegistryInfrastructureImpl r = new RegistryInfrastructureImpl( null, null );
        ModuleDefinition moduleDefinition = createModuleDefinition("module1");
        final ModuleImpl module1 = new ModuleImpl();
        module1.setModuleId( "module1" );
        r.addServicePoint( createServicePoint(moduleDefinition, module1, "foo", ResultSet.class, Visibility.PUBLIC ) );
        try
        {
View Full Code Here

    public void testGetServiceIdsInterfaceNotFound()
    {
        RegistryInfrastructureImpl r = new RegistryInfrastructureImpl( null, null );
        final ModuleImpl module1 = new ModuleImpl();
        ModuleDefinition moduleDefinition = createModuleDefinition("module1");
        module1.setClassResolver( new DefaultClassResolver() );
        module1.setModuleId( "module1" );
        r.addServicePoint( createServicePoint(moduleDefinition, module1, "module1.foo", "com.evilsite.some.bogus.package.SomeBogusInterface.", Visibility.PUBLIC ) );
        assertEquals( new HashSet(), new HashSet( r.getServiceIds( ResultSet.class ) ) );
    }
View Full Code Here

    }

    public void testGetServiceIds()
    {
        RegistryInfrastructureImpl r = new RegistryInfrastructureImpl( null, null );
        ModuleDefinition moduleDefinition = createModuleDefinition("module1");
        assertTrue( r.getServiceIds( ResultSet.class ).isEmpty() );
        final ModuleImpl module1 = new ModuleImpl();
        module1.setClassResolver( new DefaultClassResolver() );
        module1.setModuleId( "module1" );
        r.addServicePoint( createServicePoint(moduleDefinition, module1, "foo", ResultSet.class, Visibility.PUBLIC ) );
View Full Code Here

     */
    private void checkDependencies(RegistryDefinition definition)
    {
        for (Iterator iterModules = definition.getModules().iterator(); iterModules.hasNext();)
        {
            ModuleDefinition module = (ModuleDefinition) iterModules.next();
           
            for (Iterator iterDependencies = module.getDependencies().iterator(); iterDependencies.hasNext();)
            {
                String requiredModuleId = (String) iterDependencies.next();
                checkModuleDependency(definition, module, requiredModuleId);
            }
        }
View Full Code Here

       
    }

    private void checkModuleDependency(RegistryDefinition definition, ModuleDefinition sourceModule, String requiredModuleId)
    {
        ModuleDefinition requiredModule = (ModuleDefinition) definition.getModule(requiredModuleId);
        if (requiredModule == null)
        {
            // TODO: Include Location in Dependencies
            _errorHandler.error(
                    LOG,
View Full Code Here

TOP

Related Classes of org.apache.hivemind.definition.ModuleDefinition

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.