com.sun.enterprise.config.serverbeans.Server.isResourceRefExists()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(243)

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

Server.isResourceRefExists介绍

暂无

代码示例

代码示例来源:origin: org.glassfish.main.deployment/dol

/**
 * Validate the given resource in the corresponding target using domain.xml server beans.
 * For resources defined outside the application.
 *
 * @param jndiName to be validated
 * @return True if resource is present in domain.xml in the corresponding target. False otherwise.
 */
private boolean isResourceInDomainXML(String jndiName) {
  if (jndiName == null)
    return false;
  Server svr = domain.getServerNamed(target);
  if (svr != null) {
    return svr.isResourceRefExists(jndiName);
  }
  Cluster cluster = domain.getClusterNamed(target);
  return cluster != null && cluster.isResourceRefExists(jndiName);
}

代码示例来源:origin: org.glassfish.main.resourcebase.resources/nucleus-resources

Server server = configBeansUtilities.getServerNamed(target);
if (server != null) {
  if (server.isResourceRefExists(jndiName)) {
      List<Server> instances = tgt.getInstances(target);
      for (Server svr : instances) {
        if (svr.isResourceRefExists(jndiName)) {
          svr.deleteResourceRef(jndiName);

代码示例来源:origin: org.glassfish.connectors/connectors-runtime

/**
 * Returns true if the given resource is referenced by this server.
 *
 * @param resourceInfo the name of the resource
 * @return true if the named resource is used/referred by this server
 */
protected boolean isReferenced(ResourceInfo resourceInfo) {
  boolean refExists = false;
  if (ConnectorsUtil.isModuleScopedResource(resourceInfo) ||
      ConnectorsUtil.isApplicationScopedResource(resourceInfo)) {
    refExists = getServer().getApplicationRef(resourceInfo.getApplicationName()) != null;
  } else {
    String resourceName = resourceInfo.getName();
    refExists = getServer().isResourceRefExists(resourceName);
  }
  if (_logger.isLoggable(Level.FINE)) {
    _logger.fine("isReferenced :: " + resourceInfo + " - " + refExists);
  }
  return refExists;
}

代码示例来源:origin: org.glassfish.connectors/connectors-runtime

if (server.isResourceRefExists(jndiName)) {
    List<Server> instances = tgt.getInstances(target);
    for (Server svr : instances) {
      if (svr.isResourceRefExists(jndiName)) {
        svr.deleteResourceRef(jndiName);

代码示例来源:origin: org.glassfish.main.resourcebase.resources/nucleus-resources

if (!server.isResourceRefExists(jndiName)) {
    List<Server> instances = tgt.getInstances(target);
    for (Server svr : instances) {
      if (!svr.isResourceRefExists(jndiName)) {
        svr.createResourceRef(enabled, jndiName);

代码示例来源:origin: org.glassfish.admin/admin-util

if (!server.isResourceRefExists(jndiName)) {
    List<Server> instances = tgt.getInstances(target);
    for (Server svr : instances) {
      if (!svr.isResourceRefExists(jndiName)) {
        svr.createResourceRef(enabled, jndiName);

代码示例来源:origin: org.glassfish.admin/admin-util

if (server.isResourceRefExists(jndiName)) {
    List<Server> instances = tgt.getInstances(target);
    for (Server svr : instances) {
      if (svr.isResourceRefExists(jndiName)) {
        svr.deleteResourceRef(jndiName);

代码示例来源:origin: org.glassfish.admin/admin-util

public boolean resourceExists(String jndiName, String target) {
  boolean exists = false;
  if(target.equals(DOMAIN)){
    //if target is "domain", as long as the resource is present in "resources" section,
    //it is valid.
    exists = true;
  }else if(ConfigBeansUtilities.getServerNamed(target) != null){
    Server server = configBeanUtilities.getServerNamed(target);
    exists = server.isResourceRefExists(jndiName);
  }else if (domain.getClusterNamed(target) != null){
    Cluster cluster = domain.getClusterNamed(target);
    exists = cluster.isResourceRefExists(jndiName);
  }else{
    //if target is "CONFIG", as long as the resource is present in "resources" section,
    //it is valid.
    for(Config config : domain.getConfigs().getConfig()){
      if(config.getName().equals(target)){
        exists = true;
        break;
      }
    }
  }
  return exists;
}

代码示例来源:origin: org.glassfish.main.resourcebase.resources/nucleus-resources

public boolean resourceExists(String jndiName, String target) {
  boolean exists = false;
  Domain domain = habitat.getService(Domain.class);
  if(target.equals(DOMAIN)){
    //if target is "domain", as long as the resource is present in "resources" section,
    //it is valid.
    exists = true;
  }else if(habitat.<ConfigBeansUtilities>getService(ConfigBeansUtilities.class).getServerNamed(target) != null){
    Server server = habitat.<ConfigBeansUtilities>getService(ConfigBeansUtilities.class).getServerNamed(target);
    exists = server.isResourceRefExists(jndiName);
  }else if (domain.getClusterNamed(target) != null){
    Cluster cluster = domain.getClusterNamed(target);
    exists = cluster.isResourceRefExists(jndiName);
  }else{
    //if target is "CONFIG", as long as the resource is present in "resources" section,
    //it is valid.
    for(Config config : domain.getConfigs().getConfig()){
      if(config.getName().equals(target)){
        exists = true;
        break;
      }
    }
  }
  return exists;
}

代码示例来源:origin: org.glassfish.admin/admin-util

if (server.isResourceRefExists(refName)) {
  report.setMessage(localStrings.getLocalString("create.resource.ref.existsAlready",
      "Resource ref {0} already exists", refName));

代码示例来源:origin: org.glassfish.admin/admin-util

Server server = ConfigBeansUtilities.getServerNamed(target);
if (server != null) {
  if (server.isResourceRefExists(refName)) {

相关文章