Package org.apache.hivemind.definition.impl

Examples of org.apache.hivemind.definition.impl.ConfigurationPointDefinitionImpl


        for (int i = 0; i < count; i++)
        {
            ConfigurationPointDescriptor cpd = (ConfigurationPointDescriptor) points.get(i);

            ConfigurationPointDefinitionImpl configurationPoint = new ConfigurationPointDefinitionImpl(
                    module, cpd.getId(), cpd.getLocation(), cpd.getVisibility(),
                    cpd.getType(), cpd.getCount());
            module.addConfigurationPoint(configurationPoint);
           
            // If schema is embedded we can add a parser now, otherwise it must
            // be resolved and processed later
            if (cpd.getContributionsSchema() != null) {
                // TODO: compare container class name and rootElementClassName
                if (HashMap.class.getName().equals(cpd.getContributionsSchema().getRootElementClassName())
                    || UniqueHashMap.class.getName().equals(cpd.getContributionsSchema().getRootElementClassName())) {
                   
                    configurationPoint.setConfigurationTypeName(Map.class.getName());
                }

                // Add parser constructor with direct reference to schema
                ConfigurationParserDefinition parserDef = new ConfigurationParserDefinitionImpl(
                        module, cpd.getContributionsSchema().getLocation(), HiveMindSchemaParser.INPUT_FORMAT_NAME,
                        new HiveMindSchemaParserConstructor(cpd.getContributionsSchema()));
               
                configurationPoint.addParser(parserDef);
            } else if (cpd.getContributionsSchemaId() != null) {
                // Add schema assignment and resolve in post processing
                String qualifiedId = IdUtils.qualify(module.getId(), cpd.getId());
                SchemaAssignment schemaAssignment = new SchemaAssignment(qualifiedId,
                        cpd.getContributionsSchemaId(), cpd.getLocation());
View Full Code Here


       
        Visibility visibility = Visibility.PUBLIC;
        if (Modifier.isProtected(method.getModifiers())) {
            visibility = Visibility.PRIVATE;
        }
        ConfigurationPointDefinitionImpl cpd = new ConfigurationPointDefinitionImpl(module, configuration.id(),
                location, visibility, method.getReturnType().getName(), Occurances.UNBOUNDED);
        module.addConfigurationPoint(cpd);
       
        // Add method implementation as initial contribution
        Contribution contribution = new MethodCallContributionConstructor(
                location, method, instanceProvider);
        ContributionDefinitionImpl cd = new ContributionDefinitionImpl(module, location, contribution, true);
        cpd.addContribution(cd);
    }
View Full Code Here

        Module om = (Module) newMock(Module.class);

        replayControls();

        ConfigurationPointDefinitionImpl cpd = new ConfigurationPointDefinitionImpl(createModuleDefinition("module"));
        cpd.setVisibility(Visibility.PUBLIC);
        ConfigurationPointImpl cp = new ConfigurationPointImpl(m, cpd);

        assertEquals(true, cp.visibleToModule(om));

        verifyControls();
View Full Code Here

    {
        Module m = (Module) newMock(Module.class);

        replayControls();

        ConfigurationPointDefinitionImpl cpd = new ConfigurationPointDefinitionImpl(createModuleDefinition("module"));
        cpd.setVisibility(Visibility.PUBLIC);
        ConfigurationPointImpl cp = new ConfigurationPointImpl(m, cpd);

        assertEquals(true, cp.visibleToModule(null));

        verifyControls();
View Full Code Here

        Module m = (Module) newMock(Module.class);
        Module om = (Module) newMock(Module.class);

        replayControls();

        ConfigurationPointDefinitionImpl cpd = new ConfigurationPointDefinitionImpl(createModuleDefinition("module"));
        cpd.setVisibility(Visibility.PRIVATE);
        ConfigurationPointImpl cp = new ConfigurationPointImpl(m, cpd);

        assertEquals(false, cp.visibleToModule(om));

        verifyControls();
View Full Code Here

    {
        Module m = (Module) newMock(Module.class);

        replayControls();

        ConfigurationPointDefinitionImpl cpd = new ConfigurationPointDefinitionImpl(createModuleDefinition("module"));
        cpd.setVisibility(Visibility.PRIVATE);
        ConfigurationPointImpl cp = new ConfigurationPointImpl(m, cpd);

        assertEquals(false, cp.visibleToModule(null));

        verifyControls();
View Full Code Here

    /**
     * Convenience method for creating a {@link ConfigurationPointDefinition}.
     */
    protected ConfigurationPointDefinition createConfigurationPointDefinition(ModuleDefinition module, String pointId)
    {
        ConfigurationPointDefinitionImpl result = new ConfigurationPointDefinitionImpl(module, pointId,
                newLocation(), Visibility.PUBLIC, ArrayList.class.getName(),
                Occurances.UNBOUNDED);

        return result;
    }
View Full Code Here

TOP

Related Classes of org.apache.hivemind.definition.impl.ConfigurationPointDefinitionImpl

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.