Package javax.naming

Examples of javax.naming.NameAlreadyBoundException


    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);
View Full Code Here


        // Note: No custom attributes allowed

        File file = new File(base, name);
        if (file.exists())
            throw new NameAlreadyBoundException
                (sm.getString("resources.alreadyBound", name));

        rebind(name, obj, attrs);

    }
View Full Code Here

    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);
View Full Code Here

       
        // Note: No custom attributes allowed
       
        File file = new File(base, name);
        if (file.exists())
            throw new NameAlreadyBoundException
                (sm.getString("resources.alreadyBound", name));
       
        rebind(name, obj, attrs);
    }
View Full Code Here

        throws NamingException
    {
        String name=nameN.toString();
        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);
View Full Code Here

            ne.setRemainingName(org.jboss.as.jacorb.naming.jndi.CNNameParser.cosNameToName(rest));

        } else if (e instanceof InvalidName) {
            ne = new InvalidNameException();
        } else if (e instanceof AlreadyBound) {
            ne = new NameAlreadyBoundException();
        } else if (e instanceof NotEmpty) {
            ne = new ContextNotEmptyException();
        } else {
            ne = new NamingException();
        }
View Full Code Here

       
        // Note: No custom attributes allowed
        
        File file = new File(base, name);
        if (file.exists())
            throw new NameAlreadyBoundException
                (sm.getString("resources.alreadyBound", name));
       
        rebind(file, obj, attrs);
       
    }
View Full Code Here

    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);
View Full Code Here

        String nm = name.toString();

        // Find object in internal hash table
        if (bindings.get(nm) != null)
        {
            throw new NameAlreadyBoundException("Use rebind to override");
        }

        // Add object to internal hash table
        bindings.put(nm, obj);
    }
View Full Code Here

        String oldnm = oldname.toString();
        String newnm = newname.toString();

        // Check if new name exists
        if (bindings.get(newnm) != null)
            throw new NameAlreadyBoundException(newname.toString() + " is already bound");

        // Check if old name is bound
        Object oldBinding = bindings.remove(oldnm);
        if (oldBinding == null)
            throw new NameNotFoundException(oldname.toString() + " not bound");
View Full Code Here

TOP

Related Classes of javax.naming.NameAlreadyBoundException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.