Package org.apache.hivemind.schema

Examples of org.apache.hivemind.schema.Schema


     * @param location  the location the schema is referenced from
     * @return  null if schema wasn't found or is not visible
     */
    private Schema getSchema(String qualifiedSchemaId, String referencingModule, Location location)
    {
        Schema schema = (Schema) _schemas.get(qualifiedSchemaId);

        if (schema == null)
            _errorHandler
                    .error(LOG, XmlImplMessages.unableToResolveSchema(qualifiedSchemaId), location, null);
        else if (!schema.visibleToModule(referencingModule))
        {
            _errorHandler.error(
                    LOG,
                    XmlImplMessages.schemaNotVisible(qualifiedSchemaId, referencingModule),
                    location,
View Full Code Here


                // TODO annotations: Externalize message
                throw new ApplicationRuntimeException("ServicePoint used as ServiceImplementationFactory must be of type XmlServicePointDefinitionImpl");
            }
            XmlServicePointDefinitionImpl xmlServicePoint = (XmlServicePointDefinitionImpl) spd;

            Schema schema = xmlServicePoint.getParametersSchema();
            if (schema != null) {
               
                Occurances expected = xmlServicePoint.getParametersCount();
                checkParameterCounts(errorLog, expected);

                SchemaProcessorImpl processor = new SchemaProcessorImpl(errorLog, schema);
               
                _convertedParameters = constructParametersContainer(schema.getRootElementClassName(), factoryPoint.getModule());
                processor.process(_convertedParameters, _parameters, contributingModule);
            }
        }
    }
View Full Code Here

        if (_schemas == null)
            _schemas = new HashMap();

        String schemaId = schema.getId();

        Schema existing = getSchema(schemaId);

        if (existing != null)
        {
            _errorHandler.error(LOG, ParseMessages.duplicateSchema(
                    _moduleId + '.' + schemaId,
View Full Code Here

            ServicePoint factoryPoint = _contributingModule.getServicePoint(_factoryServiceId);

            _factory = (ServiceInterceptorFactory) factoryPoint
                    .getService(ServiceInterceptorFactory.class);

            Schema schema = factoryPoint.getParametersSchema();

            SchemaProcessorImpl processor = new SchemaProcessorImpl(factoryPoint.getErrorLog(),
                    schema);

            processor.process(_parameters, _contributingModule);
View Full Code Here

        return getSchema(qualifiedId, moduleId, location);
    }

    private Schema getSchema(String schemaId, String referencingModule, Location reference)
    {
        Schema schema = (Schema) _schemas.get(schemaId);

        if (schema == null)
            _errorHandler
                    .error(_log, ImplMessages.unableToResolveSchema(schemaId), reference, null);
        else if (!schema.visibleToModule(referencingModule))
        {
            _errorHandler.error(
                    _log,
                    ImplMessages.schemaNotVisible(schemaId, referencingModule),
                    reference,
View Full Code Here

        if (_schemas == null)
            _schemas = new HashMap();

        String schemaId = schema.getId();

        Schema existing = getSchema(schemaId);

        if (existing != null)
        {
            _errorHandler.error(LOG, ParseMessages.duplicateSchema(
                    _moduleId + '.' + schemaId,
View Full Code Here

            Occurances expected = factoryPoint.getParametersCount();

            _factory = (ServiceImplementationFactory) factoryPoint
                    .getService(ServiceImplementationFactory.class);

            Schema schema = factoryPoint.getParametersSchema();

            ErrorLog errorLog = _serviceExtensionPoint.getErrorLog();

            SchemaProcessorImpl processor = new SchemaProcessorImpl(errorLog, schema);
View Full Code Here

        String schemaId = cpd.getContributionsSchemaId();

        assertEquals("Fool", schemaId);

        Schema schema = md.getSchema(schemaId);

        assertNotNull(schema.getLocation());

        l = schema.getElementModel();
        assertEquals(2, l.size());

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

        assertEquals("foo1", em.getElementName());
View Full Code Here

    {
        ModuleDescriptor md = parse("GenericModule.xml");
        List l = md.getConfigurationPoints();
        assertEquals(1, l.size());
        ConfigurationPointDescriptor cpd = (ConfigurationPointDescriptor) l.get(0);
        Schema schema = md.getSchema(cpd.getContributionsSchemaId());

        l = schema.getElementModel();

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

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

        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);

        assertEquals("myParameter", em.getElementName());
    }
View Full Code Here

TOP

Related Classes of org.apache.hivemind.schema.Schema

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.