Package org.apache.jackrabbit.server

Examples of org.apache.jackrabbit.server.SessionProvider


        return repository;
    }

    @Override
    protected SessionProvider getSessionProvider() {
        return new SessionProvider() {

            public Session getSession(final HttpServletRequest req, final Repository repository, final String workspace)
                    throws LoginException, RepositoryException, ServletException {
                final ResourceResolver resolver = (ResourceResolver) req.getAttribute(AuthenticationSupport.REQUEST_ATTRIBUTE_RESOLVER);
                if (resolver != null) {
View Full Code Here


     * session.
     */
    public synchronized Session getSession(
            HttpServletRequest request, Repository repository, String workspace)
            throws LoginException, ServletException, RepositoryException {
        SessionProvider provider = null;
        Session session = null;

        for (Map.Entry<SessionProvider, Set<Session>> entry : providers.entrySet()) {
            provider = entry.getKey();
            session = provider.getSession(request, repository, workspace);
            if (session != null) {
                entry.getValue().add(session);
                break;
            }
        }

        if (session == null) {
            provider = super.getSessionProvider();
            session = provider.getSession(request, repository, workspace);
        }

        if (session != null) {
            sessions.put(session, provider);
        }
View Full Code Here

    /**
     * Releases the given session using the provider from which it was acquired.
     */
    public synchronized void releaseSession(Session session) {
        SessionProvider provider = sessions.remove(session);
        if (provider != null) {
            provider.releaseSession(session);
        }
    }
View Full Code Here

        credentialsProvider = getCredentialsProvider();
    }

    @Override
    public synchronized SessionProvider getSessionProvider() {
        final SessionProvider provider = super.getSessionProvider();
        return new SecureSessionProvider(provider);
    }
View Full Code Here

        return app.getRepository();
    }

    @Override
    public synchronized SessionProvider getSessionProvider() {
        final SessionProvider original = super.getSessionProvider();

        return new SessionProvider() {
            public Session getSession(HttpServletRequest request, Repository rep, String workspace)
                    throws LoginException, ServletException, RepositoryException {
                final String key = Brix.NS_PREFIX + "jcr-session";
                BrixSession s = (BrixSession) request.getAttribute(key);
                if (s == null) {
                    s = EventUtil.wrapSession(original.getSession(request, rep, workspace));
                    for (Plugin p : getBrix().getPlugins()) {
                        if (p instanceof SessionAwarePlugin) {
                            ((SessionAwarePlugin) p).onWebDavSession(s);
                        }
                    }
                    request.setAttribute(key, s);
                }
                return s;
            }

            public void releaseSession(Session session) {
                original.releaseSession(EventUtil.unwrapSession(session));
            }
        };
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.server.SessionProvider

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.