Search in sources :

Example 1 with PassThroughMetadataImpl

use of org.apache.aries.blueprint.reflect.PassThroughMetadataImpl in project aries by apache.

the class BaseNameSpaceHandlerSetup method parseCDR.

protected ComponentDefinitionRegistry parseCDR(String name) throws Exception {
    Parser p = new Parser();
    URL bpxml = this.getClass().getResource(name);
    p.parse(Arrays.asList(bpxml));
    Set<URI> nsuris = p.getNamespaces();
    NamespaceHandlerSet nshandlers = nhri.getNamespaceHandlers(nsuris, b);
    ComponentDefinitionRegistry cdr = new ComponentDefinitionRegistryImpl();
    cdr.registerComponentDefinition(new PassThroughMetadataImpl("blueprintBundle", b));
    p.populate(nshandlers, cdr);
    return cdr;
}
Also used : NamespaceHandlerSet(org.apache.aries.blueprint.parser.NamespaceHandlerSet) ComponentDefinitionRegistry(org.apache.aries.blueprint.ComponentDefinitionRegistry) PassThroughMetadataImpl(org.apache.aries.blueprint.reflect.PassThroughMetadataImpl) URI(java.net.URI) ComponentDefinitionRegistryImpl(org.apache.aries.blueprint.parser.ComponentDefinitionRegistryImpl) URL(java.net.URL) Parser(org.apache.aries.blueprint.parser.Parser)

Example 2 with PassThroughMetadataImpl

use of org.apache.aries.blueprint.reflect.PassThroughMetadataImpl in project aries by apache.

the class BlueprintContainerImpl method init.

public void init(boolean validate) throws Exception {
    // Parse xml resources
    Parser parser = new Parser();
    parser.parse(getResources());
    // Check namespaces
    Set<URI> namespaces = parser.getNamespaces();
    // Create handler set
    NamespaceHandlerSet handlerSet = createNamespaceHandlerSet(namespaces);
    // Add predefined beans
    componentDefinitionRegistry.registerComponentDefinition(new PassThroughMetadataImpl("blueprintContainer", this));
    if (validate) {
        // Validate
        parser.validate(handlerSet.getSchema());
    }
    // Populate
    parser.populate(handlerSet, componentDefinitionRegistry);
    // Create repository
    repository = new NoOsgiRecipeBuilder(this, tempRecipeIdSpace).createRepository();
    // Processors handling
    processTypeConverters();
    processProcessors();
    // Instantiate eager singletons
    instantiateEagerComponents();
}
Also used : NamespaceHandlerSet(org.apache.aries.blueprint.parser.NamespaceHandlerSet) PassThroughMetadataImpl(org.apache.aries.blueprint.reflect.PassThroughMetadataImpl) URI(java.net.URI) Parser(org.apache.aries.blueprint.parser.Parser)

Example 3 with PassThroughMetadataImpl

use of org.apache.aries.blueprint.reflect.PassThroughMetadataImpl in project aries by apache.

the class BlueprintContainerImpl method resetComponentDefinitionRegistry.

protected void resetComponentDefinitionRegistry() {
    this.componentDefinitionRegistry.reset();
    componentDefinitionRegistry.registerComponentDefinition(new PassThroughMetadataImpl("blueprintContainer", this));
    componentDefinitionRegistry.registerComponentDefinition(new PassThroughMetadataImpl("blueprintBundle", bundle));
    componentDefinitionRegistry.registerComponentDefinition(new PassThroughMetadataImpl("blueprintBundleContext", bundleContext));
    componentDefinitionRegistry.registerComponentDefinition(new PassThroughMetadataImpl("blueprintConverter", converter));
}
Also used : PassThroughMetadataImpl(org.apache.aries.blueprint.reflect.PassThroughMetadataImpl)

Aggregations

PassThroughMetadataImpl (org.apache.aries.blueprint.reflect.PassThroughMetadataImpl)3 URI (java.net.URI)2 NamespaceHandlerSet (org.apache.aries.blueprint.parser.NamespaceHandlerSet)2 Parser (org.apache.aries.blueprint.parser.Parser)2 URL (java.net.URL)1 ComponentDefinitionRegistry (org.apache.aries.blueprint.ComponentDefinitionRegistry)1 ComponentDefinitionRegistryImpl (org.apache.aries.blueprint.parser.ComponentDefinitionRegistryImpl)1