Java 8 NameAlreadyBoundException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 NameAlreadyBoundException class.

This code example shows how to use the following methods:getMessage
 
    private static void bindDataSource(InitialContext context, String name, DataSource ds) throws Exception {
        try { 
            context.bind(name, ds);
        } catch (NameAlreadyBoundException e) {
            e.getMessage(); // ignore
        } 
    } 
 
    @AfterClass 
    public static void shutDown() throws SQLException {
        if (!connection.isClosed()) {
            connection.close();
        } 
        namingMixIn.uninitialize();
    } 
 
} 
4
CodeRank
This code example shows how to use the following methods:
 
    @Override 
    public void bind( String name,
                      Object obj ) throws NamingException {
        if (this.registry.putIfAbsent(name, obj) != null) {
            throw new NameAlreadyBoundException("The name \"" + name + "\" is already bound to an object");
        } 
    } 
 
    @Override 
    public void rebind( Name name,
                        Object obj ) { 
        rebind(name.toString(), obj);
    } 
 
    @Override 
    public void rebind( String name,
                        Object obj ) { 
        this.registry.put(name, obj);
    } 
4
CodeRank
This code example shows how to use the following methods:
        bind(StringUtil.safeToString(name), obj);
    } 
 
    public void bind(String name, Object obj) throws NamingException {
        if (bindings.containsKey(name) && (!ignoreBindings)) {
            throw new NameAlreadyBoundException("bind(" + name + ")[" + obj + "]");
        } 
        bindings.put(name, obj);
    } 
 
    public void unbind(Name name) throws NamingException {
        unbind(StringUtil.safeToString(name));
    } 
 
    public void unbind(String name) throws NamingException {
        Object prev = bindings.remove(name);
        if ((prev == null) && (!ignoreBindings)) {
            throw new NameNotFoundException("unbind(" + name + ")");
        } 
    } 
4
CodeRank
This code example shows how to use the following methods:
    } 
 
    @Override 
    public void bind(final String name, final Object o) throws NamingException {
        if (dictionary.containsKey(name)) {
            throw new NameAlreadyBoundException("Name " + name + " already bound!");
        } 
        rebind(name, o);
    } 
 
    @Override 
    public void rebind(final Name name, final Object o) {
        rebind(name.toString(), o);
    } 
 
    @Override 
    public void rebind(final String name, final Object o) {
        dictionary.put(name, o);
    } 
 
4
CodeRank
This code example shows how to use the following methods:
    public DirContext createSubcontext(String name, Attributes attrs)
        throws NamingException {
 
        File file = new File(base, name);
        if (file.exists())
            throw new NameAlreadyBoundException
                (sm.getString("resources.alreadyBound", name));
        if (!file.mkdir())
            throw new NamingException
                (sm.getString("resources.bindFailed", name));
        return (DirContext) lookup(name);
 
    } 
 
 
    /** 
     * Retrieves the schema associated with the named object. The schema 
     * describes rules regarding the structure of the namespace and the 
     * attributes stored within it. The schema specifies what types of 
     * objects can be added to the directory and where they can be added; 
4
CodeRank
This code example shows how to use the following methods:
    @Override 
    public void bind(String name, Object obj) throws NamingException
    { 
        if (bindings.containsKey(name))
        { 
            throw new NameAlreadyBoundException(name);
        } 
        bindings.put(name, obj);
    } 
 
    @Override 
    public void rebind(Name name, Object obj) throws NamingExceptionrebind(name.toString(), obj);
    } 
 
    @Override 
    public void rebind(String name, Object obj) throws NamingException
    { 
        bindings.put(name, obj);
4
CodeRank
This code example shows how to use the following methods:
  } 
 
  @Override 
  public void bind(String name, Object o) throws NamingException {
    if (dictionary.containsKey(name)) {
      throw new NameAlreadyBoundException("Name " + name + " already bound!");
    } 
    dictionary.put(name, o);
  } 
 
  @Override 
  public void rebind(Name name, Object o) throws NamingException {
    rebind(name.toString(), o);
  } 
 
  @Override 
  public void rebind(String name, Object o) throws NamingException {
    dictionary.put(name, o);
  } 
 
4
CodeRank
This code example shows how to use the following methods:
                context.bind(name.getSuffix(name.size() - 1), object);
                return; 
            } 
        } 
        if (bindings.containsKey(name)) {
            throw new NameAlreadyBoundException(name.toString());
        } 
        bindings.put(name, new Binding(name.toString(), type.getName(), object, true));
    } 
 
    public void rebind(final Name name, final Object o) throws NamingException {
        unbind(name);
        bind(name, o);
    } 
 
    public void rebind(final String s, final Object o) throws NamingException {
        rebind(new CompositeName(s), o);
    } 
 
    public void unbind(final Name name) throws NamingException {
3
CodeRank
This code example shows how to use the following methods:toString
    static void initialize() { 
        Unsafe.debug("Initialize BootLog\n"); 
        try { 
            BootLogInstance.set(new BootLogImpl()); 
        } catch (NameAlreadyBoundException e) {
            Unsafe.debug(e.toString());
            Unsafe.debug("\n"); 
        } catch (NamingException e) {
            Unsafe.debug(e.toString());
            Unsafe.debug("\n"); 
        } 
    } 
} 
3
CodeRank
See Code Examples for Java 8 NameAlreadyBoundException Methods: