Examples of IsisSession


Examples of org.apache.isis.core.runtime.system.session.IsisSession

    public void onRequestHandlerExecuted(RequestCycle cycle, IRequestHandler handler) {
        if(LOG.isDebugEnabled()) {
            LOG.debug("onRequestHandlerExecuted: handler: " + handler);
        }
       
        final IsisSession session = getIsisContext().getSessionInstance();
        if (session != null) {
            try {
                // will commit (or abort) the transaction;
                // an abort will cause the exception to be thrown.
                getTransactionManager().endTransaction();
View Full Code Here

Examples of org.apache.isis.core.runtime.system.session.IsisSession

    /**
     * It is not possible to throw exceptions here, hence use of {@link #onRequestHandlerExecuted(RequestCycle, IRequestHandler)}.
     */
    @Override
    public synchronized void onEndRequest(RequestCycle cycle) {
        final IsisSession session = getIsisContext().getSessionInstance();
        if (session != null) {
            try {
                // belt and braces
                getTransactionManager().endTransaction();
            } finally {
View Full Code Here

Examples of org.apache.isis.core.runtime.system.session.IsisSession

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

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

Examples of org.apache.isis.core.runtime.system.session.IsisSession

    /**
     * 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

Examples of org.apache.isis.core.runtime.system.session.IsisSession

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

    @Override
    public void closeAllSessionsInstance() {
        final IsisSession sessionInstance = getSessionInstance();
        if (sessionInstance != null) {
            sessionInstance.closeAll();
        }
    }
View Full Code Here

Examples of org.apache.isis.core.runtime.system.session.IsisSession

    protected void shutdownAllThreads() {
        synchronized (sessionsByThread) {
            int i = 0;
            for (final Thread thread : sessionsByThread.keySet()) {
                LOG.info("Shutting down thread: " + i++);
                final IsisSession data = sessionsByThread.get(thread);
                data.closeAll();
            }
        }
    }
View Full Code Here

Examples of org.apache.isis.core.runtime.system.session.IsisSession

    @Override
    public String[] allSessionIds() {
        final String[] ids = new String[sessionsByThread.size()];
        int i = 0;
        for (final Thread thread : sessionsByThread.keySet()) {
            final IsisSession data = sessionsByThread.get(thread);
            ids[i++] = data.getId();
        }
        return ids;
    }
View Full Code Here

Examples of org.apache.isis.core.runtime.system.session.IsisSession

    @Override
    public void debugData(final DebugBuilder debug) {
        super.debugData(debug);
        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.core.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.core.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
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.