Package javax.naming

Examples of javax.naming.InvalidNameException


    public Object lookup(Name name) throws NamingException {
        return lookup(name.toString());
    }

    public NamingEnumeration<NameClassPair> list(String name) throws NamingException {
        if (name == null) throw new InvalidNameException("The name cannot be null");
        else if (name.startsWith("java:")) name = name.replaceFirst("^java:", "");
        else if (!name.startsWith("/")) name = tail + name;

        JNDIRequest req = new JNDIRequest(RequestMethodConstants.JNDI_LIST, name);
        req.setModuleId(moduleId);
View Full Code Here


    protected ResolveResult getBaseURLContext( final Name name, final Hashtable environment )
        throws NamingException
    {
        if( name.isEmpty() )
        {
            throw new InvalidNameException( "Unable to locate URLContext will empty name" );
        }

        final String nameString = name.get(0).toString();
        int index = nameString.indexOf( ':' );

        if( -1 == index )
        {
            final String explanation =
                "Unable to build URLContext as it does not specify scheme";
            throw new InvalidNameException( explanation );
        }

        final String scheme = nameString.substring( 0, index );
        final int end = getEndIndexOfURLPart( nameString, index + 1 );
        final String urlPart = nameString.substring( index + 1, end );
        final String namePart = nameString.substring( end );

        if( !m_scheme.equals( scheme ) )
        {
            final String explanation =
                "Bad Scheme use to build URLContext (" +
                scheme + "). " + "Expected " + m_scheme;
            throw new InvalidNameException( explanation );
        }

        final Context context = newContext( urlPart );

        return new ResolveResult( context, new CompositeName( namePart ) );
View Full Code Here

    protected void bind( final Name name, Object object, final boolean rebind )
        throws NamingException
    {
        if( isSelf( name ) )
        {
            throw new InvalidNameException( "Failed to bind self" );
        }

        String className = null;

        object = getNamespace().getStateToBind( object, name, this, getRawEnvironment() );
View Full Code Here

    public Context createSubcontext( final Name name )
        throws NamingException
    {
        if( isSelf( name ) )
        {
            throw new InvalidNameException( "Failed to create null subcontext" );
        }

        Context result = null;
        try
        {
View Full Code Here

    public void destroySubcontext( final Name name )
        throws NamingException
    {
        if( isSelf( name ) )
        {
            throw new InvalidNameException( "Failed to destroy self" );
        }

        try
        {
            getProvider().destroySubcontext( getAbsoluteName( name ) );
View Full Code Here

    public void unbind( final Name name )
        throws NamingException
    {
        if( isSelf( name ) )
        {
            throw new InvalidNameException( "Failed to unbind self" );
        }

        try
        {
            getProvider().unbind( getAbsoluteName( name ) );
View Full Code Here

    protected void bind( final Name name, Object object, final boolean rebind )
        throws NamingException
    {
        if( isSelf( name ) )
        {
            throw new InvalidNameException( "Failed to bind self" );
        }

        if( 1 == name.size() )
        {
            boolean alreadyBound;
View Full Code Here

    public void destroySubcontext( final Name name )
        throws NamingException
    {
        if( isSelf( name ) )
        {
            throw new InvalidNameException( "Failed to destroy self" );
        }

        if( 1 == name.size() )
        {
            Object object = null;
View Full Code Here

    public void unbind( final Name name )
        throws NamingException
    {
        if( isSelf( name ) )
        {
            throw new InvalidNameException( "Cannot unbind self" );
        }
        else if( 1 == name.size() )
        {
            doLocalUnbind( name );
        }
View Full Code Here

        throws NamingException
    {
        if( isSelf( oldName ) || isSelf( newName ) )
        {
            final String message = "Failed to rebind self";
            throw new InvalidNameException( message );
        }
        else if( oldName.equals( newName ) )
        {
            final String message = "Failed to rebind identical names";
            throw new InvalidNameException( message );
        }

        bind( newName, lookup( oldName ) );
        unbind( oldName );
    }
View Full Code Here

TOP

Related Classes of javax.naming.InvalidNameException

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.