public Session wrap()

in src/main/java/org/apache/sling/jcr/base/internal/mount/ProxyRepository.java [114:126]


    public Session wrap(Session session) throws RepositoryException {
        if (session instanceof ProxySession) {
            return session;
        }

        Map<String, Object> attributes = new HashMap<>();
        attributes.put(RepositoryMount.PARENT_SESSION_KEY, session);
        Session mountSession = ((JackrabbitRepository) mount).login(new SimpleCredentials(session.getUserID(), new char[0]),session.getWorkspace().getName(), attributes );

        return session instanceof JackrabbitSession ?
                new ProxyJackrabbitSession(this, (JackrabbitSession) session, mountSession, this.mountPoints) :
                new ProxySession<>(this, session, mountSession, this.mountPoints);
    }