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

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

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

Context.rename介绍

暂无

代码示例

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

@Override
public void rename(Name oldName, Name newName) throws NamingException {
  context.rename(oldName, newName);
}

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

@Override
public void rename(String oldName, String newName) throws NamingException {
  context.rename(oldName, newName);
}

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

@Override
public void rename(final String oldName, final String newName) throws NamingException {
  CNCtxFactory.INSTANCE.getInitialContext(environment).rename(oldName, newName);
}

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

@Override
public void rename(final Name oldName, final Name newName) throws NamingException {
  CNCtxFactory.INSTANCE.getInitialContext(environment).rename(oldName, newName);
}

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

@Override
  protected Object doOperation(HttpServerExchange exchange, String name) throws NamingException {
    Deque<String> newName = exchange.getQueryParameters().get("new");
    if (newName == null || newName.isEmpty()) {
      exchange.setStatusCode(StatusCodes.BAD_REQUEST);
      exchange.endExchange();
      return null;
    }
    try {
      String nn = URLDecoder.decode(newName.getFirst(), UTF_8);
      localContext.rename(name, nn);
      return null;
    } catch (UnsupportedEncodingException e) {
      throw new RuntimeException(e);
    }
  }
}

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

@Override
public void rename(final Name oldName, final Name newName) throws NamingException {
  Assert.checkNotNullParam("oldName", oldName);
  Assert.checkNotNullParam("newName", newName);
  final ReparsedName oldReparsedName = reparse(oldName);
  final ReparsedName newReparsedName = reparse(newName);
  ContextResult result = getProviderContext(oldReparsedName.getUrlScheme());
  if(result.oldStyle) {
    result.context.rename(oldName, newName);
  } else {
    result.context.rename(oldReparsedName.getName(), newReparsedName.getName());
  }
}

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

@Override
public void rename(final String oldName, final String newName) throws NamingException {
  Assert.checkNotNullParam("oldName", oldName);
  Assert.checkNotNullParam("newName", newName);
  final ReparsedName oldReparsedName = reparse(getNameParser().parse(oldName));
  final ReparsedName newReparsedName = reparse(getNameParser().parse(newName));
  ContextResult result = getProviderContext(oldReparsedName.getUrlScheme());
  if(result.oldStyle) {
    result.context.rename(oldName, newName);
  } else {
    result.context.rename(oldReparsedName.getName(), newReparsedName.getName());
  }
}

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

void handleRename(final MessageInputStream message, final int messageId, final int id) throws IOException {
  try (MessageInputStream mis = message) {
    if (version == 1) {
      try (Unmarshaller unmarshaller = createUnmarshaller(mis, configuration)) {
        int parameterType = unmarshaller.readUnsignedByte();
        if (parameterType != Protocol.P_NAME) {
          Messages.log.unexpectedParameterType(Protocol.P_NAME, parameterType);
        }
        final Name oldName = unmarshaller.readObject(Name.class);
        parameterType = unmarshaller.readUnsignedByte();
        if (parameterType != Protocol.P_NAME) {
          Messages.log.unexpectedParameterType(Protocol.P_NAME, parameterType);
        }
        final Name newName = unmarshaller.readObject(Name.class);
        localContext.rename(oldName, newName);
      } catch (ClassNotFoundException e) {
        throw new IOException(e);
      }
    } else {
      mis.readInt(); // consume authId
      final String oldName = mis.readUTF();
      final String newName = mis.readUTF();
      localContext.rename(oldName, newName);
    }
  } catch (NamingException e) {
    writeExceptionResponse(e, messageId, id);
    return;
  }
  writeSuccessResponse(messageId, id);
}

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

context3.rename("java:comp/env/jdbc/myds", "jdbc/myds");
context3.unbind("myobject");

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

final Context context = (Context) next;
try {
  context.rename(oldName.getSuffix(1), newName.getSuffix(1));
} finally {
  NamingUtils.safeClose(context);

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

@Override
  public Object operation() throws NamingException {
    getDelegate().rename(oldName, newName);
    return null;
  }
}.perform();

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

@Override
  public Object operation() throws NamingException {
    getDelegate().rename(oldName, newName);
    return null;
  }
}.perform();

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

/**
 * @see javax.naming.Context#rename(java.lang.String, java.lang.String)
 */
public void rename(String oldName, String newName) throws NamingException {
  this.assertOpen();
  this.getDelegateContext().rename(oldName, newName);
}

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

/**
 * @see Context#rename(String, String)
 */
public void rename(String oldName, String newName) throws NamingException {
  this.assertOpen();
  this.getDelegateContext().rename(oldName, newName);
}

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

/**
 * @see javax.naming.Context#rename(javax.naming.Name, javax.naming.Name)
 */
public void rename(Name oldName, Name newName) throws NamingException {
  this.assertOpen();
  this.getDelegateContext().rename(oldName, newName);
}

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

/**
 * @see Context#rename(Name, Name)
 */
public void rename(Name oldName, Name newName) throws NamingException {
  this.assertOpen();
  this.getDelegateContext().rename(oldName, newName);
}

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

protected Object executeLast() throws Exception {
  getContext().rename((String) getParameters()[0],
            (String) getParameters()[1]);
  return null;
}

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

protected Object executeLast() throws Exception {
  getContext().rename((Name) getParameters()[0],
            (Name) getParameters()[1]);
  return null;
}

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

/**
 * Binds a new name to the object bound to an old name, and unbinds the old
 * name. This operation is not supported (read only env.)
 * @param oldName the name of the existing binding; may not be empty
 * @param newName the name of the new binding; may not be empty
 * @throws NamingException if a naming exception is encountered
 */
public void rename(Name oldName, Name newName) throws NamingException {
  findContext().rename(getRelativeName(oldName), getRelativeName(newName));
}

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

/**
 * Binds a new name to the object bound to an old name, and unbinds the old
 * name. Not supported.
 * @param oldName the name of the existing binding; may not be empty
 * @param newName the name of the new binding; may not be empty
 * @throws NamingException if a naming exception is encountered
 */
public void rename(String oldName, String newName) throws NamingException {
  findContext().rename(getRelativeName(oldName), getRelativeName(newName));
}

相关文章