public Object read(URL contributionURL, URI artifactURI, URL artifactURL, ProcessorContext context) throws ContributionReadException { return getProcessor().read(contributionURL, artifactURI, artifactURL, context); }
public void addArtifactProcessor(URLArtifactProcessor<?> artifactProcessor) { if (artifactProcessor.getArtifactType() != null) { Pattern pattern = Pattern.compile(wildcard2regex(artifactProcessor.getArtifactType())); processorsByArtifactType.put(pattern, artifactProcessor); } if (artifactProcessor.getModelType() != null) { processorsByModelType.put(artifactProcessor.getModelType(), artifactProcessor); } }
@SuppressWarnings("unchecked") public void resolve(Object model, ModelResolver resolver, ProcessorContext context) throws ContributionResolveException { // Delegate to the processor associated with the model type if (model != null) { URLArtifactProcessor processor = processors.getProcessor(model.getClass()); if (processor != null) { processor.resolve(model, resolver, context); } } }
public Object read(URL contributionURL, URI artifactURI, URL artifactURL, ProcessorContext context) throws ContributionReadException { return getProcessor().read(contributionURL, artifactURI, artifactURL, context); }
public void addArtifactProcessor(URLArtifactProcessor<?> artifactProcessor) { if (artifactProcessor.getArtifactType() != null) { Pattern pattern = Pattern.compile(wildcard2regex(artifactProcessor.getArtifactType())); processorsByArtifactType.put(pattern, artifactProcessor); } if (artifactProcessor.getModelType() != null) { processorsByModelType.put(artifactProcessor.getModelType(), artifactProcessor); } }
@SuppressWarnings("unchecked") public void resolve(Object model, ModelResolver resolver, ProcessorContext context) throws ContributionResolveException { // Delegate to the processor associated with the model type if (model != null) { URLArtifactProcessor processor = processors.getProcessor(model.getClass()); if (processor != null) { processor.resolve(model, resolver, context); } } }
private boolean introspect(OSGiImplementation implementation, ModelResolver resolver, ProcessorContext context, Bundle bundle) throws ContributionReadException, ContributionResolveException { String componentTypeFile = (String)bundle.getHeaders().get(COMPONENT_TYPE_HEADER); if (componentTypeFile == null) { componentTypeFile = BUNDLE_COMPONENT_TYPE; } URL url = bundle.getEntry(componentTypeFile); if (url != null) { URLArtifactProcessorExtensionPoint processors = registry.getExtensionPoint(URLArtifactProcessorExtensionPoint.class); URLArtifactProcessor<ComponentType> processor = processors.getProcessor(ComponentType.class); ComponentType componentType = processor.read(null, URI.create(BUNDLE_COMPONENT_TYPE), url, context); artifactProcessor.resolve(componentType, resolver, context); mergeFromComponentType(implementation, componentType, resolver, context); return true; } return false; }
public void removeArtifactProcessor(URLArtifactProcessor<?> artifactProcessor) { if (artifactProcessor.getArtifactType() != null) { String regex = wildcard2regex(artifactProcessor.getArtifactType()); for (Object key : processorsByArtifactType.keySet()) { if ((key instanceof Pattern) && ((Pattern)key).pattern().equals(regex)) { processorsByArtifactType.remove(key); } } processorsByArtifactType.remove((Object)artifactProcessor.getArtifactType()); } if (artifactProcessor.getModelType() != null) { processorsByModelType.remove(artifactProcessor.getModelType()); } }
@SuppressWarnings("unchecked") public void resolve(Object model, ModelResolver resolver, ProcessorContext context) throws ContributionResolveException { getProcessor().resolve(model, resolver, context); } // end method resolve
return processor.read(contributionURL, sourceURI, sourceURL, context);
public void removeArtifactProcessor(URLArtifactProcessor<?> artifactProcessor) { if (artifactProcessor.getArtifactType() != null) { String regex = wildcard2regex(artifactProcessor.getArtifactType()); for (Object key : processorsByArtifactType.keySet()) { if ((key instanceof Pattern) && ((Pattern)key).pattern().equals(regex)) { processorsByArtifactType.remove(key); } } processorsByArtifactType.remove((Object)artifactProcessor.getArtifactType()); } if (artifactProcessor.getModelType() != null) { processorsByModelType.remove(artifactProcessor.getModelType()); } }
@SuppressWarnings("unchecked") public void resolve(Object model, ModelResolver resolver, ProcessorContext context) throws ContributionResolveException { getProcessor().resolve(model, resolver, context); } // end method resolve
return processor.read(contributionURL, sourceURI, sourceURL, context);
Artifact oldArtifact = context.setArtifact(artifact); try { artifactProcessor.resolve(model, contributionResolver, context); } catch (Throwable e) { throw new ContributionResolveException(e);
public synchronized List<Definitions> getDefinitions() { if (!loaded) { loadDefinitionsDocuments(); URLArtifactProcessorExtensionPoint processors = registry.getExtensionPoint(URLArtifactProcessorExtensionPoint.class); URLArtifactProcessor<Definitions> processor = processors.getProcessor(Definitions.class); ProcessorContext context = new ProcessorContext(monitorFactory.createMonitor()); for (URL url : documents) { Definitions def; try { def = processor.read(null, DEFINITIONS_URI, url, context); definitions.add(def); } catch (ContributionReadException e) { logger.log(Level.SEVERE, e.getMessage(), e); } } loaded = true; } return definitions; }
Artifact oldArtifact = context.setArtifact(artifact); try { artifactProcessor.resolve(model, contributionResolver, context); } catch (Throwable e) { throw new ContributionResolveException(e);
public synchronized List<Definitions> getDefinitions() { if (!loaded) { loadDefinitionsDocuments(); URLArtifactProcessorExtensionPoint processors = registry.getExtensionPoint(URLArtifactProcessorExtensionPoint.class); URLArtifactProcessor<Definitions> processor = processors.getProcessor(Definitions.class); ProcessorContext context = new ProcessorContext(monitorFactory.createMonitor()); for (URL url : documents) { Definitions def; try { def = processor.read(null, DEFINITIONS_URI, url, context); definitions.add(def); } catch (ContributionReadException e) { logger.log(Level.SEVERE, e.getMessage(), e); } } loaded = true; } return definitions; }
artifactProcessor.read(contributionURL, URI.create(artifact.getURI()), artifactLocationURL,
artifactProcessor.read(contributionURL, URI.create(artifact.getURI()), artifactLocationURL,