te an editor, which is actually manipulating a copy of the configuration document ... Editor editor=deployedConfig. {@link RepositoryConfiguration#edit() edit()}; // Modify the copy of the configuration (we'll do something trivial here) ... editor.setNumber(FieldName.LARGE_VALUE_SIZE_IN_BYTES,8096); // Get our changes and validate them ... Changes changes=editor. {@link Editor#getChanges() getChanges()}; Results validationResults=deployedConfig. {@link RepositoryConfiguration#validate(Changes) validate(changes)}; if ( validationResults.hasErrors() ) { // you've done something wrong with your editor } else { // Update the deployed repository's configuration with these changes ... Future<Boolean> future = engine. {@link ModeShapeEngine#update(String,Changes) update("repo",changes)}; // Optionally block while the repository instance is changed to // reflect the new configuration ... JcrRepository updated = future.get(); }
Note that this method blocks while the changes to the configuration are validated and applied, but before the repository has changed to reflect the new configuration, which is done asynchronously. The resulting future represents that asynchronous process, and the future can be used to block until that updating is completed.
@param repositoryName the name of the repository
@param changes the changes that should be applied to the repository's configuration
@return a future that allows the caller to block until the repository has completed all of its changes.
@throws ConfigurationException if the configuration is not valid with the supplied changes
@throws NoSuchRepositoryException if there is no repository with the specified name
@throws RepositoryException if there is a problem updating the repository
@throws IllegalArgumentException if any of the parameters are null or invalid
@see #deploy(RepositoryConfiguration)
@see #undeploy(String)