mail/src/main/java/org/jboss/as/mail/extension/MailSessionAdd.java
static String getJndiName(final ModelNode modelNode, OperationContext context) throws OperationFailedException {
        final String rawJndiName = MailSessionDefinition.JNDI_NAME.resolveModelAttribute(context, modelNode).asString();
        return getJndiName(rawJndiName);
    }
static String getJndiName(final ModelNode modelNode, OperationContext context) throws OperationFailedException {
        final String rawJndiName = MailSessionDefinition.JNDI_NAME.resolveModelAttribute(context, modelNode).asString();
        return getJndiName(rawJndiName);
    }
Extracts the raw JNDI_NAME value from the given model node, and depending on the value and
the value of any USE_JAVA_CONTEXT child node, converts the raw name into a compliant jndi name.

@param modelNode the model node; either an operation or the model behind a mail session resource
@return the compliant jndi name