/** * 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; }