Package org.apache.hivemind.definition

Examples of org.apache.hivemind.definition.ConfigurationPointDefinition


        if (configurationPoints != null)
        {
            for (Iterator i = configurationPoints.iterator(); i.hasNext();)
            {
                ConfigurationPointDefinition cpd = (ConfigurationPointDefinition) i.next();

                Element configurationPoint = getConfigurationPointElement(cpd);

                module.appendChild(configurationPoint);
            }
View Full Code Here


    /**
     * Provides a list of sources (SymbolSource) for values of substitution symbols.
     */
    private void addSymbolSourcesConfiguration(ModuleDefinition md)
    {
        ConfigurationPointDefinition cpd = helper.addConfigurationPoint("SymbolSources", List.class.getName());

        helper.addContributionDefinition(cpd, new Contribution()
        {

            public void contribute(ContributionContext context)
View Full Code Here

    public ConfigurationPointDefinition getConfigurationPoint(String qualifiedConfigurationPointId)
    {
        String moduleId = IdUtils.extractModule(qualifiedConfigurationPointId);
        String configurationPointId = IdUtils.stripModule(qualifiedConfigurationPointId);

        ConfigurationPointDefinition configurationPoint = null;
        ModuleDefinition module = getModule(moduleId);
        if (module != null)
        {
            configurationPoint = module.getConfigurationPoint(configurationPointId);
        }
View Full Code Here

            String configurationPointId = unresolved.getExtensionPointId();
            if (LOG.isDebugEnabled()) {
                LOG.debug("Trying to resolve configuration point " + configurationPointId + " referenced by" +
                        " contribution " + logLocation(unresolved.getExtension().getLocation()));
            }
            ConfigurationPointDefinition configurationPoint = _definition.getConfigurationPoint(configurationPointId);
            if (configurationPoint == null)
            {
                _errorHandler.error(
                        LOG,
                        DefinitionMessages.unknownConfigurationPoint(
                                IdUtils.extractModule(configurationPointId),
                                IdUtils.stripModule(configurationPointId)),
                        unresolved.getExtension().getLocation(),
                        null);
            } else {
                configurationPoint.addContribution((ContributionDefinition) unresolved.getExtension());
            }
            iter.remove();
        }
    }
View Full Code Here

            String configurationPointId = unresolved.getExtensionPointId();
            if (LOG.isDebugEnabled()) {
                LOG.debug("Trying to resolve configuration point " + configurationPointId + " referenced by" +
                        " ConfigurationParser " + logLocation(unresolved.getExtension().getLocation()));
            }
            ConfigurationPointDefinition configurationPoint = _definition.getConfigurationPoint(configurationPointId);
            if (configurationPoint == null)
            {
                _errorHandler.error(
                        LOG,
                        DefinitionMessages.unknownConfigurationPoint(
                                IdUtils.extractModule(configurationPointId),
                                IdUtils.stripModule(configurationPointId)),
                        unresolved.getExtension().getLocation(),
                        null);
            } else {
                if (Visibility.PRIVATE.equals(configurationPoint.getVisibility())
                   && !module.getId().equals(IdUtils.extractModule(configurationPointId))) {
                    _errorHandler.error(
                            LOG,
                            DefinitionMessages.configurationPointNotVisible(
                                    configurationPoint,
                                    module),
                            unresolved.getExtension().getLocation(),
                            null);
                   
                }
               
                configurationPoint.addParser((ConfigurationParserDefinition) unresolved.getExtension());
            }
            iter.remove();
        }
    }
View Full Code Here

        fooBar.addServicePoint(spd);

        ModuleDefinitionImpl zipZoop = createModuleDefinition("zip.zoop");

        ConfigurationPointDefinition cpd = createConfigurationPointDefinition(fooBar, "cp1");
       
        zipZoop.addConfigurationPoint(cpd);
       
        definition.addModule(fooBar);
        definition.addModule(zipZoop);
View Full Code Here

        for (Iterator iterSa = schemaAssignments.iterator(); iterSa.hasNext();)
        {
            SchemaAssignment schemaAssignment = (SchemaAssignment) iterSa.next();

            String configurationPointId = IdUtils.qualify(sourceModule.getId(), schemaAssignment.getConfigurationId());
            ConfigurationPointDefinition cpd = _definition.getConfigurationPoint(configurationPointId);
            if (cpd == null) {
                throw new ApplicationRuntimeException(XmlImplMessages.unknownConfigurationPointOfSchemaAssignment(configurationPointId, schemaAssignment));
            }
           
            String schemaId = IdUtils.qualify(sourceModule.getId(), schemaAssignment.getSchemaId());
            Schema schema = getSchema(schemaId, sourceModule.getId(), schemaAssignment.getLocation());
           
            if (schema != null) {
                // TODO: check if schema has already been set
                // TODO: more type related error handling, check root type of schema
               
                // Add parser constructor with direct reference to schema
                ConfigurationParserDefinition parserDef = new ConfigurationParserDefinitionImpl(
                        sourceModule, schemaAssignment.getLocation(), HiveMindSchemaParser.INPUT_FORMAT_NAME,
                        new HiveMindSchemaParserConstructor(schema));
               
                cpd.addParser(parserDef);
               
                // For backward compatibility change the configuration to Map if the schema uses a map too
                if (HashMap.class.getName().equals(schema.getRootElementClassName())
                        || UniqueHashMap.class.getName().equals(schema.getRootElementClassName())) {
                    // The schema assignments are mainly used for backward compatibility so we can
View Full Code Here

     * @see org.apache.hivemind.definition.Contribution#contribute(org.apache.hivemind.definition.ContributionContext)
     */
    public void contribute(ContributionContext context)
    {
        // Retrieve parser for HiveMind schema
        ConfigurationPointDefinition cpd = context.getConfigurationPoint()
                .getConfigurationPointDefinition();
        ConfigurationParserDefinition parserDef = cpd.getParser(HiveMindSchemaParser.INPUT_FORMAT_NAME);
        if (parserDef == null)
        {
            // This is a valid situation. The unparsed elements are contributed
            context.mergeContribution(getElements());
        } else {
View Full Code Here

        helper.addServiceImplementation(spd, constructor, ServiceModel.PRIMITIVE);
       
        // A configuration to which startup objects may be contributed (as objects or services).
        // Startup objects must implement the java.lang.Runnable interface. Order of execution is expliclitly NOT defined.

        ConfigurationPointDefinition cpd = helper.addConfigurationPoint("Startup", List.class.getName());
       
        final List services = getDefaultStartupServices();
        helper.addContributionDefinition(cpd, new Contribution() {

            public void contribute(ContributionContext context)
View Full Code Here

     * Defines service models, providing a name and a class for each.
     */
    private void addServiceModelConfiguration()
    {

        ConfigurationPointDefinition cpd = helper.addConfigurationPoint("ServiceModels",
                Map.class.getName());
       
        final List serviceModels = getDefaultServiceModels();
        helper.addContributionDefinition(cpd, new Contribution() {

View Full Code Here

TOP

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

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.