naming/src/main/java/org/jboss/as/naming/deployment/ContextNames.java
public static BindInfo bindInfoFor(String app, String module, String comp, String context) {
        if (context.startsWith("java:")) {
            final String namespace;
            final int i = context.indexOf('/');
            if (i == -1) {
                namespace = context.substring(5);
            } else if (i == 5) {
                // Absolute path
                return new BindInfo(JAVA_CONTEXT_SERVICE_NAME, context.substring(6));
            } else {
                namespace = context.substring(5, i);
            }

            sanitazeNameSpace(namespace,context);
            if (namespace.equals("global")) {
                return new BindInfo(GLOBAL_CONTEXT_SERVICE_NAME, context.substring(12));
            } else if (namespace.equals("jboss")) {
                String rest = context.substring(i);
                if(rest.startsWith("/exported/")) {
                    return new BindInfo(EXPORTED_CONTEXT_SERVICE_NAME, context.substring(20));
                } else {
                    return new BindInfo(JBOSS_CONTEXT_SERVICE_NAME, context.substring(11));
                }
            } else if (namespace.equals("app")) {
                return new BindInfo(contextServiceNameOfApplication(app), context.substring(9));
            } else if (namespace.equals("module")) {
                return new BindInfo(contextServiceNameOfModule(app, module), context.substring(12));
            } else if (namespace.equals("comp")) {
                return new BindInfo(contextServiceNameOfComponent(app, module, comp), context.substring(10));
            } else {
                return new BindInfo(JBOSS_CONTEXT_SERVICE_NAME, context);
            }
        } else {
            return null;
        }
    }
public static BindInfo bindInfoFor(String app, String module, String comp, String context) {
        if (context.startsWith("java:")) {
            final String namespace;
            final int i = context.indexOf('/');
            if (i == -1) {
                namespace = context.substring(5);
            } else if (i == 5) {
                // Absolute path
                return new BindInfo(JAVA_CONTEXT_SERVICE_NAME, context.substring(6));
            } else {
                namespace = context.substring(5, i);
            }

            sanitazeNameSpace(namespace,context);
            if (namespace.equals("global")) {
                return new BindInfo(GLOBAL_CONTEXT_SERVICE_NAME, context.substring(12));
            } else if (namespace.equals("jboss")) {
                String rest = context.substring(i);
                if(rest.startsWith("/exported/")) {
                    return new BindInfo(EXPORTED_CONTEXT_SERVICE_NAME, context.substring(20));
                } else {
                    return new BindInfo(JBOSS_CONTEXT_SERVICE_NAME, context.substring(11));
                }
            } else if (namespace.equals("app")) {
                return new BindInfo(contextServiceNameOfApplication(app), context.substring(9));
            } else if (namespace.equals("module")) {
                return new BindInfo(contextServiceNameOfModule(app, module), context.substring(12));
            } else if (namespace.equals("comp")) {
                return new BindInfo(contextServiceNameOfComponent(app, module, comp), context.substring(10));
            } else {
                return new BindInfo(JBOSS_CONTEXT_SERVICE_NAME, context);
            }
        } else {
            return null;
        }
    }
public static BindInfo bindInfoFor ( String app , String module , String comp , String context ) { if ( context . startsWith ( "java:" ) ) { final String namespace ; final int i = context . indexOf ( ' ' ) ; if ( i == - 1 ) { namespace = context . substring ( 5 ) ; } else if ( i == 5 ) { // Absolute path return new BindInfo ( JAVA_CONTEXT_SERVICE_NAME , context . substring ( 6 ) ) ; } else { namespace = context . substring ( 5 , i ) ; } sanitazeNameSpace ( namespace , context ) ; if ( namespace . equals ( "global" ) ) { return new BindInfo ( GLOBAL_CONTEXT_SERVICE_NAME , context . substring ( 12 ) ) ; } else if ( namespace . equals ( "jboss" ) ) { String rest = context . substring ( i ) ; if ( rest . startsWith ( "/exported/" ) ) { return new BindInfo ( EXPORTED_CONTEXT_SERVICE_NAME , context . substring ( 20 ) ) ; } else { return new BindInfo ( JBOSS_CONTEXT_SERVICE_NAME , context . substring ( 11 ) ) ; } } else if ( namespace . equals ( "app" ) ) { return new BindInfo ( contextServiceNameOfApplication ( app ) , context . substring ( 9 ) ) ; } else if ( namespace . equals ( "module" ) ) { return new BindInfo ( contextServiceNameOfModule ( app , module ) , context . substring ( 12 ) ) ; } else if ( namespace . equals ( "comp" ) ) { return new BindInfo ( contextServiceNameOfComponent ( app , module , comp ) , context . substring ( 10 ) ) ; } else { return new BindInfo ( JBOSS_CONTEXT_SERVICE_NAME , context ) ; } } else { return null ; } }
Get the service name of a context, or {@code null} if there is no service mapping for the context name.

@param app     the application name
@param module  the module name
@param comp    the component name
@param context the context to check
@return the BindInfo
Get the service name of a context or { @code null } if there is no service mapping for the context name .