private void setContributionUris(Composite composite) { URI uri = ContributionResolver.getContribution(); composite.setContributionUri(uri); for (ComponentDefinition<? extends Implementation<?>> definition : composite.getComponents().values()) { definition.setContributionUri(uri); if (definition.getComponentType() instanceof Composite) { setContributionUris((Composite) definition.getComponentType()); } } for (ChannelDefinition definition : composite.getChannels().values()) { definition.setContributionUri(uri); } }
public void deploy(ComponentDefinition<?> definition) throws DeploymentException { URI uri = ContributionResolver.getContribution(); DefaultIntrospectionContext context = new DefaultIntrospectionContext(uri, getClass().getClassLoader()); definition.setContributionUri(uri); componentProcessor.process(definition, context); checkErrors(context); try { Composite wrapper = createWrapperComposite(definition.getName()); wrapper.add(definition); domain.include(wrapper, false); } catch (org.fabric3.api.host.domain.DeploymentException e) { throw new DeploymentException(e); } }
private <T> LogicalProducer createProducer(Class<T> interfaze, URI channelUri) throws InterfaceException { JavaServiceContract contract = introspector.introspect(interfaze); LogicalCompositeComponent domainComponent = lcm.getRootComponent(); String domainRoot = domainComponent.getUri().toString(); URI componentUri = URI.create(domainRoot + "/F3Synthetic"); InjectingComponentType componentType = new InjectingComponentType(); NonManagedImplementation implementation = new NonManagedImplementation(); implementation.setComponentType(componentType); ComponentDefinition<NonManagedImplementation> componentDefinition = new ComponentDefinition<>("F3Synthetic"); componentDefinition.setContributionUri(ContributionResolver.getContribution(interfaze)); componentDefinition.setImplementation(implementation); LogicalComponent<NonManagedImplementation> logicalComponent = new LogicalComponent<>(componentUri, componentDefinition, domainComponent); ProducerDefinition producerDefinition = new ProducerDefinition("producer", contract); LogicalProducer producer = new LogicalProducer(URI.create(domainRoot + "/F3Synthetic#producer"), producerDefinition, logicalComponent); producer.addTarget(channelUri); return producer; }