类javax.naming.directory.AttributeInUseException源码实例Demo

下面列出了怎么用javax.naming.directory.AttributeInUseException的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: emissary   文件: EmissaryServer.java
private void bindServer() throws UnknownHostException, AttributeInUseException {
    if (Namespace.exists(getDefaultNamespaceName())) {
        LOG.error("EmissaryServer already bound to namespace. This should NEVER happen.");
        throw new AttributeInUseException("EmissaryServer was already bound to the namespace using serverName: " + DEFAULT_NAMESPACE_NAME);
    }

    LOG.debug("Binding {} ", DEFAULT_NAMESPACE_NAME);
    Namespace.bind(getDefaultNamespaceName(), this);

}
 
源代码2 项目: msf4j   文件: LDAPUserStoreManager.java
public void assignUser(String username, String groupName) throws NamingException {

        try {
            ModificationItem[] mods = new ModificationItem[1];
            Attribute mod = new BasicAttribute("member", getUserDN(username));
            mods[0] = new ModificationItem(DirContext.ADD_ATTRIBUTE, mod);
            context.modifyAttributes(getGroupDN(groupName), mods);
        } catch (AttributeInUseException e) {
            // If user is already added, ignore exception
        }
    }
 
 类所在包
 类方法
 同包方法