/** * Lazily load artifact processors registered in the extension point. */ private synchronized void loadProcessors() { if (loaded) return; // Get the processor service declarations Collection<ServiceDeclaration> processorDeclarations; try { processorDeclarations = registry.getServiceDiscovery().getServiceDeclarations(URLArtifactProcessor.class.getName()); } catch (IOException e) { IllegalStateException ie = new IllegalStateException(e); throw ie; } for (ServiceDeclaration processorDeclaration : processorDeclarations) { Map<String, String> attributes = processorDeclaration.getAttributes(); // Load a URL artifact processor String artifactType = attributes.get("type"); String modelTypeName = attributes.get("model"); // Create a processor wrapper and register it URLArtifactProcessor<?> processor = new LazyURLArtifactProcessor(artifactType, modelTypeName, processorDeclaration, registry, staxProcessor); addArtifactProcessor(processor); } loaded = true; }
/** * Lazily load artifact processors registered in the extension point. */ private synchronized void loadProcessors() { if (loaded) return; // Get the processor service declarations Collection<ServiceDeclaration> processorDeclarations; try { processorDeclarations = registry.getServiceDiscovery().getServiceDeclarations(URLArtifactProcessor.class.getName()); } catch (IOException e) { IllegalStateException ie = new IllegalStateException(e); throw ie; } for (ServiceDeclaration processorDeclaration : processorDeclarations) { Map<String, String> attributes = processorDeclaration.getAttributes(); // Load a URL artifact processor String artifactType = attributes.get("type"); String modelTypeName = attributes.get("model"); // Create a processor wrapper and register it URLArtifactProcessor<?> processor = new LazyURLArtifactProcessor(artifactType, modelTypeName, processorDeclaration, registry, staxProcessor); addArtifactProcessor(processor); } loaded = true; }
public Object read(URL contributionURL, URI artifactURI, URL artifactURL, ProcessorContext context) throws ContributionReadException { return getProcessor().read(contributionURL, artifactURI, artifactURL, context); }
@SuppressWarnings("unchecked") public void resolve(Object model, ModelResolver resolver, ProcessorContext context) throws ContributionResolveException { getProcessor().resolve(model, resolver, context); } // end method resolve
@SuppressWarnings("unchecked") public void resolve(Object model, ModelResolver resolver, ProcessorContext context) throws ContributionResolveException { getProcessor().resolve(model, resolver, context); } // end method resolve
public Object read(URL contributionURL, URI artifactURI, URL artifactURL, ProcessorContext context) throws ContributionReadException { return getProcessor().read(contributionURL, artifactURI, artifactURL, context); }
/** * Preresolve phase, for ExtendedURLArtifactProcessors only */ @SuppressWarnings("unchecked") public void preResolve( Object model, ModelResolver resolver, ProcessorContext context) throws ContributionResolveException { URLArtifactProcessor<?> processor = getProcessor(); if( processor instanceof ExtendedURLArtifactProcessor ) { ((ExtendedURLArtifactProcessor)processor).preResolve(model, resolver, context); } // end if } // end method resolve
/** * Preresolve phase, for ExtendedURLArtifactProcessors only */ @SuppressWarnings("unchecked") public void preResolve( Object model, ModelResolver resolver, ProcessorContext context) throws ContributionResolveException { URLArtifactProcessor<?> processor = getProcessor(); if( processor instanceof ExtendedURLArtifactProcessor ) { ((ExtendedURLArtifactProcessor)processor).preResolve(model, resolver, context); } // end if } // end method resolve