/** * Constructor accepting an instance of the registry, and key identifying the type of manager. * * @param registry the instance of the registry. * @param key the key short name of the artifact type. * @throws RegistryException Thrown when rxt configuration is not in registry. */ public GenericArtifactManager(Registry registry, String key) throws RegistryException { try { GovernanceArtifactConfiguration configuration = GovernanceUtils.findGovernanceArtifactConfiguration(key, registry); if (configuration != null) { artifactNameAttribute = configuration.getArtifactNameAttribute(); artifactNamespaceAttribute = configuration.getArtifactNamespaceAttribute(); artifactElementNamespace = configuration.getArtifactElementNamespace(); manager = new GovernanceArtifactManager(registry, configuration.getMediaType(), artifactNameAttribute, artifactNamespaceAttribute, configuration.getArtifactElementRoot(), artifactElementNamespace, configuration.getPathExpression(), configuration.getLifecycle(), configuration.getValidationAttributes(), configuration.getRelationshipDefinitions()); mediaType = configuration.getMediaType(); } else { throw new GovernanceException("Artifact type '" + key + "' is not in registry or unable to find relevant configuration."); } } catch (RegistryException e) { throw new GovernanceException("Unable to obtain governance artifact configuration for rxt: " + key, e); } }