Package org.apache.hivemind.parse

Examples of org.apache.hivemind.parse.ConfigurationPointDescriptor


        ModuleDescriptor md = parse("DuplicateSchemas.xml");

        assertLoggedMessagePattern("Multiple contributions schemas specified for configuration MyConfiguration. Using locally defined schema \\(at ");

        ConfigurationPointDescriptor cpd = (ConfigurationPointDescriptor) md
                .getConfigurationPoints().get(0);
        Schema nestedSchema = cpd.getContributionsSchema();

        assertNotNull(nestedSchema);

        ElementModel em = (ElementModel) nestedSchema.getElementModel().get(0);
View Full Code Here


    {
        ModuleDescriptor md = parse("SchemaDescription.xml");

        List points = md.getConfigurationPoints();

        ConfigurationPointDescriptor cpd = (ConfigurationPointDescriptor) points.get(0);

        assertEquals("PointWithDescription", cpd.getId());
    }
View Full Code Here

    public void testEmbeddedConfigSchema() throws Exception
    {
        ModuleDescriptor md = parse("EmbeddedConfigSchema.xml");

        List points = md.getConfigurationPoints();
        ConfigurationPointDescriptor cpd = (ConfigurationPointDescriptor) points.get(0);
        Schema s = cpd.getContributionsSchema();

        List l = s.getElementModel();

        assertEquals(1, l.size());
View Full Code Here

    public void testSetPropertyRule() throws Exception
    {
        ModuleDescriptor md = parse("SetPropertyRule.xml");

        List points = md.getConfigurationPoints();
        ConfigurationPointDescriptor cpd = (ConfigurationPointDescriptor) points.get(0);
        Schema s = cpd.getContributionsSchema();
        List l = s.getElementModel();

        ElementModel em = (ElementModel) l.get(0);

        List rules = em.getRules();
View Full Code Here

    public void testPushAttributeRule() throws Exception
    {
        ModuleDescriptor md = parse("PushAttributeRule.xml");

        List points = md.getConfigurationPoints();
        ConfigurationPointDescriptor cpd = (ConfigurationPointDescriptor) points.get(0);
        Schema s = cpd.getContributionsSchema();
        List l = s.getElementModel();

        ElementModel em = (ElementModel) l.get(0);

        List rules = em.getRules();
View Full Code Here

    public void testPrivateConfigurationPoint() throws Exception
    {
        ModuleDescriptor md = parse("PrivateConfigurationPoint.xml");

        List points = md.getConfigurationPoints();
        ConfigurationPointDescriptor cpd = (ConfigurationPointDescriptor) points.get(0);

        assertEquals(Visibility.PRIVATE, cpd.getVisibility());
    }
View Full Code Here

        List points = md.getConfigurationPoints();
        int count = size(points);

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

            String pointId = moduleId + "." + cpd.getId();

            ConfigurationPoint existingPoint = (ConfigurationPoint) _configurationPoints
                    .get(pointId);

            if (existingPoint != null)
            {
                _errorHandler.error(_log, ImplMessages.duplicateExtensionPointId(
                        pointId,
                        existingPoint), cpd.getLocation(), null);
                continue;
            }

            if (_log.isDebugEnabled())
                _log.debug("Creating configuration point " + pointId);

            ConfigurationPointImpl point = new ConfigurationPointImpl();

            point.setExtensionPointId(pointId);
            point.setLocation(cpd.getLocation());
            point.setModule(module);
            point.setExpectedCount(cpd.getCount());

            point.setContributionsSchema(findSchema(cpd.getContributionsSchema(), module, cpd
                    .getContributionsSchemaId(), cpd.getLocation()));

            point.setVisibility(cpd.getVisibility());

            point.setShutdownCoordinator(_shutdownCoordinator);

            registry.addConfigurationPoint(point);
View Full Code Here

    /**
     * Convenience method for creating a {@link ConfigurationPointDescriptor}.
     */
    protected ConfigurationPointDescriptor createConfigurationPointDescriptor(String pointId)
    {
        ConfigurationPointDescriptor result = new ConfigurationPointDescriptor();

        result.setId(pointId);
        result.setLocation(fabricateLocation(0));

        return result;
    }
View Full Code Here

        fooBar.addSchema(schema);

        ModuleDescriptor zipZoop = new ModuleDescriptor(null, errorHandler);
        zipZoop.setModuleId("zip.zoop");

        ConfigurationPointDescriptor cpd = new ConfigurationPointDescriptor();
        cpd.setId("Zap");
        cpd.setContributionsSchemaId("foo.bar.Baz");

        zipZoop.addConfigurationPoint(cpd);

        RegistryInfrastructureConstructor ric = new RegistryInfrastructureConstructor(errorHandler,
                LogFactory.getLog(TestRegistryInfrastructureConstructor.class), null);
View Full Code Here

        fooBar.addSchema(schema);

        ModuleDescriptor zipZoop = new ModuleDescriptor(null, eh);
        zipZoop.setModuleId("zip.zoop");

        ConfigurationPointDescriptor cpd = new ConfigurationPointDescriptor();
        cpd.setId("Zap");
        cpd.setContributionsSchemaId("foo.bar.Baz");
        cpd.setLocation(l);

        zipZoop.addConfigurationPoint(cpd);

        RegistryInfrastructureConstructor ric = new RegistryInfrastructureConstructor(eh, log, null);
View Full Code Here

TOP

Related Classes of org.apache.hivemind.parse.ConfigurationPointDescriptor

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.