javax.naming.Context.getNameInNamespace()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(159)

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

Context.getNameInNamespace介绍

暂无

代码示例

代码示例来源:origin: wildfly/wildfly

@Override
  public String getNameInNamespace() throws NamingException {
    return context.getNameInNamespace();
  }
}

代码示例来源:origin: wildfly/wildfly

@Override
  public String getNameInNamespace() throws NamingException {
    return CNCtxFactory.INSTANCE.getInitialContext(environment).getNameInNamespace();
  }
}

代码示例来源:origin: spring-projects/spring-security

/**
 * Gets the full dn of a name by prepending the name of the context it is relative to.
 * If the name already contains the base name, it is returned unaltered.
 */
public static DistinguishedName getFullDn(DistinguishedName dn, Context baseCtx)
    throws NamingException {
  DistinguishedName baseDn = new DistinguishedName(baseCtx.getNameInNamespace());
  if (dn.contains(baseDn)) {
    return dn;
  }
  baseDn.append(dn);
  return baseDn;
}

代码示例来源:origin: spring-projects/spring-security

/**
 * Obtains the part of a DN relative to a supplied base context.
 * <p>
 * If the DN is "cn=bob,ou=people,dc=springframework,dc=org" and the base context name
 * is "ou=people,dc=springframework,dc=org" it would return "cn=bob".
 * </p>
 *
 * @param fullDn the DN
 * @param baseCtx the context to work out the name relative to.
 *
 * @return the
 *
 * @throws NamingException any exceptions thrown by the context are propagated.
 */
public static String getRelativeName(String fullDn, Context baseCtx)
    throws NamingException {
  String baseDn = baseCtx.getNameInNamespace();
  if (baseDn.length() == 0) {
    return fullDn;
  }
  DistinguishedName base = new DistinguishedName(baseDn);
  DistinguishedName full = new DistinguishedName(fullDn);
  if (base.equals(full)) {
    return "";
  }
  Assert.isTrue(full.startsWith(base), "Full DN does not start with base DN");
  full.removeFirst(base);
  return full.toString();
}

代码示例来源:origin: org.jboss/jboss-common-core

public String getNameInNamespace()
 throws NamingException
{
 return delegate.getNameInNamespace();
}

代码示例来源:origin: org.wildfly/wildfly-naming

@Override
  public String getNameInNamespace() throws NamingException {
    return context.getNameInNamespace();
  }
}

代码示例来源:origin: org.sapia/sapia_archie

/**
 * @see javax.naming.Context#getNameInNamespace()
 */
public String getNameInNamespace() throws NamingException {
 return _ctx.getNameInNamespace();
}

代码示例来源:origin: org.jboss.eap/wildfly-naming

@Override
  public String getNameInNamespace() throws NamingException {
    return context.getNameInNamespace();
  }
}

代码示例来源:origin: org.apache.james/james-server-util

@Override
  public Object operation() throws NamingException {
    return getDelegate().getNameInNamespace();
  }
}.perform();

代码示例来源:origin: org.jboss.eap/wildfly-iiop-openjdk

@Override
  public String getNameInNamespace() throws NamingException {
    return CNCtxFactory.INSTANCE.getInitialContext(environment).getNameInNamespace();
  }
}

代码示例来源:origin: org.ow2.petals/petals-kernel

@Override
public String getNameInNamespace() throws NamingException {
  String out;
  if (this.initialContext == null) {
    out = this.defaultInitCtx.getNameInNamespace();
  } else {
    out = this.initialContext.getNameInNamespace();
  }
  return out;
}

代码示例来源:origin: org.ow2.carol.cmi/cmi-jndi

public String getNameInNamespace() throws NamingException {
  if(serverModeEnabled) {
    return localContext.getNameInNamespace();
  } else {
    LOGGER.warn("Cannot getNameInNamespace because server mode is not activated.");
    return null;
  }
}

代码示例来源:origin: apache/james-project

@Override
  public Object operation() throws NamingException {
    return getDelegate().getNameInNamespace();
  }
}.perform();

代码示例来源:origin: org.apache.geronimo.modules/geronimo-naming

protected Name createBindingName(AbstractName abstractName, Object value) throws NamingException {
  if (value instanceof Context) {
    // don't bind yourself
    if (value == this) return null;
    Context context = (Context) value;
    String nameInNamespace = context.getNameInNamespace();
    return getNameParser().parse(nameInNamespace);
  }
  throw new NamingException("value is not a context: abstractName=" + abstractName + " valueType=" + value.getClass().getName());
}

代码示例来源:origin: org.apache.geronimo.framework/geronimo-naming

@Override
protected Name createBindingName(AbstractName abstractName, Object value) throws NamingException {
  if (value instanceof Context) {
    // don't bind yourself
    if (value == this) return null;
    Context context = (Context) value;
    String nameInNamespace = context.getNameInNamespace();
    return getContext().getNameParser("").parse(nameInNamespace);
  }
  throw new NamingException("value is not a context: abstractName=" + abstractName + " valueType=" + value.getClass().getName());
}

代码示例来源:origin: org.springframework.ldap/spring-ldap-core

/**
 * @see javax.naming.Context#getNameInNamespace()
 */
public String getNameInNamespace() throws NamingException {
  this.assertOpen();
  return this.getDelegateContext().getNameInNamespace();
}

代码示例来源:origin: spring-projects/spring-ldap

/**
 * @see Context#getNameInNamespace()
 */
public String getNameInNamespace() throws NamingException {
  this.assertOpen();
  return this.getDelegateContext().getNameInNamespace();
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-ldap

/**
 * @see Context#getNameInNamespace()
 */
public String getNameInNamespace() throws NamingException {
  this.assertOpen();
  return this.getDelegateContext().getNameInNamespace();
}

代码示例来源:origin: apache/servicemix-bundles

/**
 * @see Context#getNameInNamespace()
 */
public String getNameInNamespace() throws NamingException {
  this.assertOpen();
  return this.getDelegateContext().getNameInNamespace();
}

代码示例来源:origin: org.apache.xbean/xbean-naming

public String getNameInNamespace() throws NamingException {
    Name parsedNameInNamespace = context.getNameParser("").parse(context.getNameInNamespace());
    return context.composeName(parsedNameInNamespace, nameInContext).toString();
  }
}

相关文章