Package org.apache.isis.runtimes.dflt.runtime.system.session

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


    }

    @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

    @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

            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

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

    // ///////////////////////////////////////////////////////////
    // Static Convenience methods (session scoped)
    // ///////////////////////////////////////////////////////////

    public static boolean inSession() {
        final IsisSession session = getInstance().getSessionInstance();
        return session != null;
    }
View Full Code Here

    /**
     * Convenience method returning the current {@link IsisSession}.
     */
    public static IsisSession getSession() {
        final IsisSession session = getInstance().getSessionInstance();
        if (session == null) {
            throw new IllegalStateException("No Session opened for this thread");
        }
        return session;
    }
View Full Code Here

    }

    @Override
    public IsisSession openSessionInstance(final AuthenticationSession authenticationSession) {
        applySessionClosePolicy();
        final IsisSession newSession = getSessionFactoryInstance().openSession(authenticationSession);
        if (isCurrentThreadServer()) {
            serverSession = newSession;
        } else {
            clientSession = newSession;
        }
View Full Code Here

           */
        return null;
    }

    private void debugDisplayContext(final String selector, final DebugBuilder debug) {
        final IsisSession d = IsisContext.getSession(selector);
        if (d != null) {
            d.debugAll(debug);
        } else {
            debug.appendln("No context: " + selector);
        }
    }
View Full Code Here

    private void debugListContexts(final DebugBuilder debug) {
        final String[] contextIds = IsisContext.getInstance().allSessionIds();
        for (final String contextId : contextIds) {
            debug.appendln(contextId);
            debug.appendln("-----");
            final IsisSession d = IsisContext.getSession(contextId);
            d.debug(debug);
            debug.appendln();
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.runtimes.dflt.runtime.system.session.IsisSession

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.