Examples of IsisSession


Examples of org.apache.isis.runtimes.dflt.runtime.system.session.IsisSession

    public void debugData(final DebugBuilder debug) {
        super.debugData(debug);
        debug.appendln();
        debug.appendTitle("Threads based Contexts");
        for (final Thread thread : sessionsByThread.keySet()) {
            final IsisSession data = sessionsByThread.get(thread);
            debug.appendln(thread.toString(), data);
        }
    }
View Full Code Here

Examples of org.apache.isis.runtimes.dflt.runtime.system.session.IsisSession

    }

    @Override
    protected IsisSession getSessionInstance(final String executionContextId) {
        for (final Thread thread : sessionsByThread.keySet()) {
            final IsisSession data = sessionsByThread.get(thread);
            if (data.getId().equals(executionContextId)) {
                return data;
            }
        }
        return null;
    }
View Full Code Here

Examples of org.apache.isis.runtimes.dflt.runtime.system.session.IsisSession

    @Override
    public IsisSession openSessionInstance(final AuthenticationSession authenticationSession) {
        final Thread thread = Thread.currentThread();
        synchronized (sessionsByThread) {
            applySessionClosePolicy();
            final IsisSession session = getSessionFactoryInstance().openSession(authenticationSession);
            LOG.debug("  opening session " + session + " (count " + sessionsByThread.size() + ") for " + authenticationSession.getUserName());
            saveSession(thread, session);
            session.open();
            return session;
        }
    }
View Full Code Here

Examples of org.apache.isis.runtimes.dflt.runtime.system.session.IsisSession

            return session;
        }
    }

    protected IsisSession createAndOpenSession(final Thread thread, final AuthenticationSession authenticationSession) {
        final IsisSession session = getSessionFactoryInstance().openSession(authenticationSession);
        session.open();
        LOG.info("  opening session " + session + " (count " + sessionsByThread.size() + ") for " + authenticationSession.getUserName());
        return session;
    }
View Full Code Here

Examples of org.apache.isis.runtimes.dflt.runtime.system.session.IsisSession

     * @see #openSessionInstance(AuthenticationSession)
     */
    @Override
    public IsisSession getSessionInstance() {
        final Thread thread = Thread.currentThread();
        final IsisSession session = sessionsByThread.get(thread);
        return session;
    }
View Full Code Here

Examples of org.apache.isis.runtimes.dflt.runtime.system.session.IsisSession

        if (bootstrapSession != null) {
            return bootstrapSession;
        }

        final Session session = Session.get();
        final IsisSession isisSession = sessionMap.get(session);
        return isisSession;
    }
View Full Code Here

Examples of org.apache.isis.runtimes.dflt.runtime.system.session.IsisSession

        // there could be multiple threads using a session.

        final AuthenticatedWebSessionForIsis webSession = (AuthenticatedWebSessionForIsis) Session.get();
        webSession.registerUseByThread();

        IsisSession isisSession = sessionMap.get(webSession);
        if (isisSession == null) {
            isisSession = getSessionFactoryInstance().openSession(authSession);
            // put into map prior to opening, so that subsequent calls to
            // getSessionInstance() will find this new session.
            sessionMap.put(webSession, isisSession);
            isisSession.open();
        }

        return isisSession;
    }
View Full Code Here

Examples of org.apache.isis.runtimes.dflt.runtime.system.session.IsisSession

    private synchronized void closeSessionOrDeregisterUsageOnExisting() {
        final AuthenticatedWebSessionForIsis webSession = (AuthenticatedWebSessionForIsis) Session.get();
        final boolean shouldClose = webSession.deregisterUseByThread();

        final IsisSession isisSession = sessionMap.get(webSession);
        if (isisSession == null) {
            // nothing to be done
            return;
        }

        if (shouldClose) {
            isisSession.close();
            // remove after closing, so that any calls to getSessionInstance()
            // made while closing will still find this session
            sessionMap.remove(webSession);
        }
View Full Code Here

Examples of org.apache.isis.runtimes.dflt.runtime.system.session.IsisSession

        getTransactionManager().startTransaction();
    }

    @Override
    protected synchronized void onEndRequest() {
        final IsisSession session = getIsisContext().getSessionInstance();
        if (session != null) {
            // in session
            commitTransactionIfAny();
            getIsisContext().closeSessionInstance();
        }
View Full Code Here

Examples of org.apache.isis.runtimes.dflt.runtime.system.session.IsisSession

    // Session
    // //////////////////////////////////////////////

    @Override
    public void closeAllSessionsInstance() {
        final IsisSession sessionInstance = getSessionInstance();
        if (sessionInstance != null) {
            sessionInstance.closeAll();
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.