/** * Constructor accepting an instance of the registry, and also details on the type of manager. * * @param registry the instance of the registry. * @param mediaType the media type of resources being saved or fetched. */ protected ServiceManager(Registry registry, String mediaType) throws RegistryException { GovernanceArtifactConfiguration configuration = GovernanceUtils.findGovernanceArtifactConfiguration( GovernanceConstants.SERVICE_ARTIFACT_KEY, registry); this.manager = new GovernanceArtifactManager( registry, mediaType, configuration.getArtifactNameAttribute(), configuration.getArtifactNamespaceAttribute(), configuration.getArtifactElementRoot(), GovernanceConstants.SERVICE_ELEMENT_NAMESPACE, configuration.getPathExpression(), new Association[0]); this.registry = registry; }
/** * 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); } }
artifactId, contentElement, configuration.getArtifactNameAttribute(), configuration.getArtifactNamespaceAttribute(), configuration.getArtifactElementNamespace(), configuration.getMediaType());