org.modeshape.jcr.RepositoryConfiguration.getName()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(9.7k)|赞(0)|评价(0)|浏览(103)

本文整理了Java中org.modeshape.jcr.RepositoryConfiguration.getName方法的一些代码示例,展示了RepositoryConfiguration.getName的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RepositoryConfiguration.getName方法的具体详情如下:
包路径:org.modeshape.jcr.RepositoryConfiguration
类名称:RepositoryConfiguration
方法名:getName

RepositoryConfiguration.getName介绍

暂无

代码示例

代码示例来源:origin: ModeShape/modeshape

public final String repositoryName() {
  return repositoryConfiguration.getName();
}

代码示例来源:origin: org.fcrepo/modeshape-jcr

protected String repositoryName() {
  return config().getName();
}

代码示例来源:origin: ModeShape/modeshape

public String getJndiName() {
  return doc.getString(FieldName.JNDI_NAME, DEFAULT_JNDI_PREFIX_OF_NAME + getName());
}

代码示例来源:origin: ModeShape/modeshape

protected String repositoryName() {
  return config().getName();
}

代码示例来源:origin: org.fcrepo/modeshape-jcr

public String getJndiName() {
  return doc.getString(FieldName.JNDI_NAME, DEFAULT_JNDI_PREFIX_OF_NAME + getName());
}

代码示例来源:origin: ModeShape/modeshape

protected void bindIntoJndi() {
  if (jndiName != null && jndiName.trim().length() != 0) {
    try {
      InitialContext ic = new InitialContext();
      ic.bind(jndiName, JcrRepository.this);
    } catch (NoInitialContextException e) {
      // No JNDI here ...
      logger.debug("No JNDI found, so not registering '{0}' repository", getName());
    } catch (OperationNotSupportedException e) {
      warn(JcrI18n.jndiReadOnly, config.getName(), jndiName);
    } catch (NamingException e) {
      logger.error(e, JcrI18n.unableToBindToJndi, config.getName(), jndiName, e.getMessage());
    } catch (Exception e) {
      logger.debug(e, "Error while registering the '{0}' repository from the '{1}' name in JNDI", config.getName(),
             jndiName);
    }
  }
}

代码示例来源:origin: ModeShape/modeshape

protected void unbindFromJndi() {
  if (jndiName != null && jndiName.trim().length() != 0) {
    try {
      InitialContext ic = new InitialContext();
      ic.unbind(jndiName);
    } catch (NoInitialContextException e) {
      // No JNDI here ...
      logger.debug("No JNDI found, so not registering '{0}' repository", getName());
    } catch (OperationNotSupportedException e) {
      warn(JcrI18n.jndiReadOnly, config.getName(), jndiName);
    } catch (Exception e) {
      logger.warn(JcrI18n.jndiReadOnly, config.getName(), jndiName);
    }
  }
}

代码示例来源:origin: org.fcrepo/modeshape-jcr

protected void bindIntoJndi() {
  if (jndiName != null && jndiName.trim().length() != 0) {
    try {
      InitialContext ic = new InitialContext();
      ic.bind(jndiName, JcrRepository.this);
    } catch (NoInitialContextException e) {
      // No JNDI here ...
      logger.debug("No JNDI found, so not registering '{0}' repository", getName());
    } catch (OperationNotSupportedException e) {
      warn(JcrI18n.jndiReadOnly, config.getName(), jndiName);
    } catch (NamingException e) {
      logger.error(e, JcrI18n.unableToBindToJndi, config.getName(), jndiName, e.getMessage());
    } catch (Exception e) {
      logger.debug(e, "Error while registering the '{0}' repository from the '{1}' name in JNDI", config.getName(),
             jndiName);
    }
  }
}

代码示例来源:origin: org.fcrepo/modeshape-jcr

protected void unbindFromJndi() {
  if (jndiName != null && jndiName.trim().length() != 0) {
    try {
      InitialContext ic = new InitialContext();
      ic.unbind(jndiName);
    } catch (NoInitialContextException e) {
      // No JNDI here ...
      logger.debug("No JNDI found, so not registering '{0}' repository", getName());
    } catch (OperationNotSupportedException e) {
      warn(JcrI18n.jndiReadOnly, config.getName(), jndiName);
    } catch (Exception e) {
      logger.warn(JcrI18n.jndiReadOnly, config.getName(), jndiName);
    }
  }
}

代码示例来源:origin: org.fcrepo/modeshape-jcr

repoConfig.getName());
} else {
         repoConfig.getName());

代码示例来源:origin: ModeShape/modeshape

repoConfig.getName());
} else {
         repoConfig.getName());

代码示例来源:origin: org.fcrepo/modeshape-jcr

/**
 * Create a Repository instance given the {@link RepositoryConfiguration configuration}.
 *
 * @param configuration the repository configuration; may not be null
 * @throws ConfigurationException if there is a problem with the configuration
 */
protected JcrRepository( RepositoryConfiguration configuration ) throws ConfigurationException {
  ModeShape.getName(); // force log message right up front
  this.config.set(configuration);
  RepositoryConfiguration config = this.config.get();
  // Validate the configuration to make sure there are no errors ...
  Problems results = configuration.validate();
  setConfigurationProblems(results);
  if (results.hasErrors()) {
    String msg = JcrI18n.errorsInRepositoryConfiguration.text(this.repositoryName, results.errorCount(),
                                 results.toString());
    throw new ConfigurationException(results, msg);
  }
  this.repositoryName.set(config.getName());
  this.logger = Logger.getLogger(getClass());
  this.logger.debug("Activating '{0}' repository", this.repositoryName);
  // Set up the descriptors ...
  this.descriptors = new HashMap<String, Object>();
  initializeDescriptors();
}

代码示例来源:origin: ModeShape/modeshape

/**
 * Create a Repository instance given the {@link RepositoryConfiguration configuration}.
 *
 * @param configuration the repository configuration; may not be null
 * @throws ConfigurationException if there is a problem with the configuration
 */
protected JcrRepository( RepositoryConfiguration configuration ) throws ConfigurationException {
  ModeShape.getName(); // force log message right up front
  this.config.set(configuration);
  RepositoryConfiguration config = this.config.get();
  // Validate the configuration to make sure there are no errors ...
  Problems results = configuration.validate();
  setConfigurationProblems(results);
  if (results.hasErrors()) {
    String msg = JcrI18n.errorsInRepositoryConfiguration.text(this.repositoryName, results.errorCount(),
                                 results.toString());
    throw new ConfigurationException(results, msg);
  }
  this.repositoryName.set(config.getName());
  this.logger = Logger.getLogger(getClass());
  this.logger.debug("Activating '{0}' repository", this.repositoryName);
  // Set up the descriptors ...
  this.descriptors = new HashMap<String, Object>();
  initializeDescriptors();
}

代码示例来源:origin: ModeShape/modeshape

@Test
public void shouldReplaceVariables() {
  RepositoryConfiguration config = assertValid("{ 'name' = '${os.name} Repository' }");
  assertThat(config.getName(), is(System.getProperty("os.name") + " Repository"));
  System.out.println(config.getDocument());
}

代码示例来源:origin: org.fcrepo/modeshape-jcr

/***
 * Validate this configuration if the supplied changes were made to this. Note that this does <i>not</i> actually change this
 * configuration.
 *
 * @param changes the proposed changes to this configuration's underlying document; never null
 * @return the validation results; never null
 * @see #edit()
 * @see #validate()
 */
public Problems validate( Changes changes ) {
  // Create a copy of this configuration ...
  Editor copy = edit();
  copy.apply(changes);
  RepositoryConfiguration updated = new RepositoryConfiguration(copy.unwrap(), this.getName());
  return updated.validate();
}

代码示例来源:origin: ModeShape/modeshape

/***
 * Validate this configuration if the supplied changes were made to this. Note that this does <i>not</i> actually change this
 * configuration.
 *
 * @param changes the proposed changes to this configuration's underlying document; never null
 * @return the validation results; never null
 * @see #edit()
 * @see #validate()
 */
public Problems validate( Changes changes ) {
  // Create a copy of this configuration ...
  Editor copy = edit();
  copy.apply(changes);
  RepositoryConfiguration updated = new RepositoryConfiguration(copy.unwrap(), this.getName());
  return updated.validate();
}

代码示例来源:origin: ModeShape/modeshape

protected JcrRepository repository( Map<?, ?> parameters,
                  String repositoryURL ) throws RepositoryException {
  String repositoryName = repositoryNameFrom(repositoryURL, parameters);
  JcrRepository repository = lookForAlreadyDeployedRepositoryKey(repositoryURL);
  if (repository != null) {
    return repository;
  }
  RepositoryConfiguration configuration = loadRepositoryConfigurationFrom(repositoryURL);
  repository = lookForAlreadyDeployedRepositoryName(configuration.getName());
  if (repository != null) {
    return StringUtil.isBlank(repositoryName) || configuration.getName().equalsIgnoreCase(repositoryName) ? repository : null;
  }
  // Now deploy the new repository ...
  try {
    repository = ENGINE.deploy(configuration);
    repository.start();
    // The name might not match the configuration's name ...
    if (StringUtil.isBlank(repositoryName) || repository.getName().equals(repositoryName)) {
      return repository;
    }
    LOG.warn(JcrI18n.repositoryNotFound, repositoryName, repositoryURL, parameters);
    return null;
  } catch (RepositoryException re) {
    throw re;
  } catch (Exception e) {
    throw new RepositoryException(e);
  }
}

代码示例来源:origin: org.fcrepo/modeshape-jcr

protected JcrRepository repository( Map<?, ?> parameters,
                  String repositoryURL ) throws RepositoryException {
  String repositoryName = repositoryNameFrom(repositoryURL, parameters);
  JcrRepository repository = lookForAlreadyDeployedRepositoryKey(repositoryURL);
  if (repository != null) {
    return repository;
  }
  RepositoryConfiguration configuration = loadRepositoryConfigurationFrom(repositoryURL);
  repository = lookForAlreadyDeployedRepositoryName(configuration.getName());
  if (repository != null) {
    return StringUtil.isBlank(repositoryName) || configuration.getName().equalsIgnoreCase(repositoryName) ? repository : null;
  }
  // Now deploy the new repository ...
  try {
    repository = ENGINE.deploy(configuration);
    repository.start();
    // The name might not match the configuration's name ...
    if (StringUtil.isBlank(repositoryName) || repository.getName().equals(repositoryName)) {
      return repository;
    }
    LOG.warn(JcrI18n.repositoryNotFound, repositoryName, repositoryURL, parameters);
    return null;
  } catch (RepositoryException re) {
    throw re;
  } catch (Exception e) {
    throw new RepositoryException(e);
  }
}

代码示例来源:origin: ModeShape/modeshape

engine.update(config.getName(), changes).get(); // don't forget to wait!
RepositoryConfiguration config2 = engine.getRepositoryConfiguration(config.getName());
Document sequencerA2 = (Document)config2.getDocument()
                    .getDocument(FieldName.SEQUENCING)

代码示例来源:origin: ModeShape/modeshape

protected static void startRepository( RepositoryConfiguration configuration ) throws Exception {
  TestingEnvironment environment = new TestingEnvironment();
  RepositoryConfiguration config = configuration != null ?
                   new RepositoryConfiguration(configuration.getDocument(), configuration.getName(),
                                 environment) :
                   new RepositoryConfiguration(REPO_NAME, environment);
  repository = new JcrRepository(config);
  repository.start();
  session = repository.login();
}

相关文章

微信公众号

最新文章

更多