naming/src/main/java/org/jboss/as/naming/deployment/ContextNames.java
public static BindInfo bindInfoFor(final String jndiName) {
        // TODO: handle non java: schemes
        String bindName;
        if (jndiName.startsWith("java:")) {
            bindName = jndiName.substring(5);
        } else if (!jndiName.startsWith("jboss") && !jndiName.startsWith("global") && !jndiName.startsWith("/")) {
            bindName = "/" + jndiName;
        } else {
            bindName = jndiName;
        }
        final ServiceName parentContextName;
        if(bindName.startsWith("jboss/exported/")) {
            parentContextName = EXPORTED_CONTEXT_SERVICE_NAME;
            bindName = bindName.substring(15);
        } else if (bindName.startsWith("jboss/")) {
            parentContextName = JBOSS_CONTEXT_SERVICE_NAME;
            bindName = bindName.substring(6);
        } else if (bindName.startsWith("global/")) {
            parentContextName = GLOBAL_CONTEXT_SERVICE_NAME;
            bindName = bindName.substring(7);
        } else if (bindName.startsWith("/")) {
            parentContextName = JAVA_CONTEXT_SERVICE_NAME;
            bindName = bindName.substring(1);
        } else {
            throw NamingLogger.ROOT_LOGGER.illegalContextInName(jndiName);
        }
        return new BindInfo(parentContextName, bindName);
    }
public static BindInfo bindInfoFor(final String jndiName) {
        // TODO: handle non java: schemes
        String bindName;
        if (jndiName.startsWith("java:")) {
            bindName = jndiName.substring(5);
        } else if (!jndiName.startsWith("jboss") && !jndiName.startsWith("global") && !jndiName.startsWith("/")) {
            bindName = "/" + jndiName;
        } else {
            bindName = jndiName;
        }
        final ServiceName parentContextName;
        if(bindName.startsWith("jboss/exported/")) {
            parentContextName = EXPORTED_CONTEXT_SERVICE_NAME;
            bindName = bindName.substring(15);
        } else if (bindName.startsWith("jboss/")) {
            parentContextName = JBOSS_CONTEXT_SERVICE_NAME;
            bindName = bindName.substring(6);
        } else if (bindName.startsWith("global/")) {
            parentContextName = GLOBAL_CONTEXT_SERVICE_NAME;
            bindName = bindName.substring(7);
        } else if (bindName.startsWith("/")) {
            parentContextName = JAVA_CONTEXT_SERVICE_NAME;
            bindName = bindName.substring(1);
        } else {
            throw NamingLogger.ROOT_LOGGER.illegalContextInName(jndiName);
        }
        return new BindInfo(parentContextName, bindName);
    }
public static BindInfo bindInfoFor ( final String jndiName ) { // TODO: handle non java: schemes String bindName ; if ( jndiName . startsWith ( "java:" ) ) { bindName = jndiName . substring ( 5 ) ; } else if ( ! jndiName . startsWith ( "jboss" ) && ! jndiName . startsWith ( "global" ) && ! jndiName . startsWith ( "/" ) ) { bindName = "/" + jndiName ; } else { bindName = jndiName ; } final ServiceName parentContextName ; if ( bindName . startsWith ( "jboss/exported/" ) ) { parentContextName = EXPORTED_CONTEXT_SERVICE_NAME ; bindName = bindName . substring ( 15 ) ; } else if ( bindName . startsWith ( "jboss/" ) ) { parentContextName = JBOSS_CONTEXT_SERVICE_NAME ; bindName = bindName . substring ( 6 ) ; } else if ( bindName . startsWith ( "global/" ) ) { parentContextName = GLOBAL_CONTEXT_SERVICE_NAME ; bindName = bindName . substring ( 7 ) ; } else if ( bindName . startsWith ( "/" ) ) { parentContextName = JAVA_CONTEXT_SERVICE_NAME ; bindName = bindName . substring ( 1 ) ; } else { throw NamingLogger . ROOT_LOGGER . illegalContextInName ( jndiName ) ; } return new BindInfo ( parentContextName , bindName ) ; }
Get the service name of a NamingStore

@param jndiName the jndi name
@return the bind info for the jndi name
Get the service name of a NamingStore