Examples of SessionContextImpl


Examples of com.taobao.metamorphosis.server.network.SessionContextImpl

    }


    @Test
    public void testBeginPutPrepareRollbackCloseRecover() throws Exception {
        final SessionContext context = new SessionContextImpl("test", this.conn);
        final TransactionId xid = XIDGenerator.createXID(100);
        assertNull(context.getTransactions().get(xid));
        this.processor.beginTransaction(context, xid, 0);
        final Transaction tx = this.processor.getTransaction(context, xid);
        assertNotNull(tx);
        assertSame(xid, tx.getTransactionId());
        this.replay();

        this.processor.processPutCommand(new PutCommand("topic1", 2, "hello".getBytes(), xid, 0, 1), context, null);
        MessageStore store = this.messageStoreManager.getOrCreateMessageStore("topic1", 2);
        store.flush();
        assertEquals(0, store.getSizeInBytes());

        // prepare
        this.processor.prepareTransaction(context, xid);
        assertSame(tx, this.processor.getTransaction(context, xid));

        // rollback
        this.processor.rollbackTransaction(context, xid);
        store.flush();
        assertEquals(Transaction.FINISHED_STATE, tx.getState());
        assertNull(context.getTransactions().get(xid));

        assertEquals(0, store.getSizeInBytes());

        // close and reopen it
        this.tearDown();
View Full Code Here

Examples of com.taobao.metamorphosis.server.network.SessionContextImpl

    }


    @Test
    public void testCommitTransactionHeuristicallyRecoverHeuristicTransactions() throws Exception {
        final SessionContext context = new SessionContextImpl("test", this.conn);
        final TransactionId xid = XIDGenerator.createXID(100);
        assertNull(context.getTransactions().get(xid));
        this.processor.beginTransaction(context, xid, 0);
        final Transaction tx = this.processor.getTransaction(context, xid);
        assertNotNull(tx);
        assertSame(xid, tx.getTransactionId());
        this.replay();
View Full Code Here

Examples of net.sourceforge.jivalo.fw.lite.ejb.SessionContextImpl

  protected SessionContext getSessionContextFor(TransactionAttribute attribute)
      throws NotSupportedException, SystemException
  {
   
    SessionContextImpl ctx =
      SessionContextImpl.newInstance(
        this,
        (SessionBean)obj,
        attribute,
        namingContext);
View Full Code Here

Examples of org.apache.cocoon.sunshine.sunrise.context.SessionContextImpl

        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("BEGIN createParameters handler=" + myHandler +
                              ", path="+path+ ", application=" + appName);
        }

        SessionContextImpl context;
        context = (SessionContextImpl)contextProvider.getSessionContext(Constants.SESSION_CONTEXT_NAME,
                                                      this.objectModel,
                                                      this.resolver,
                                                      this.manager);
        parameters = context.createParameters(parameters, myHandler, path, appName);

        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("END createParameters parameters="+parameters);
        }
        return parameters;
View Full Code Here

Examples of org.apache.cocoon.sunshine.sunrise.context.SessionContextImpl

        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("BEGIN createParameters handler=" + myHandler +
                              ", path="+path+ ", application=" + appName);
        }

        SessionContextImpl context;
        context = (SessionContextImpl)contextProvider.getSessionContext(Constants.SESSION_CONTEXT_NAME,
                                                      this.objectModel,
                                                      this.resolver,
                                                      this.manager);
        parameters = context.createParameters(parameters, myHandler, path, appName);

        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("END createParameters parameters="+parameters);
        }
        return parameters;
View Full Code Here

Examples of org.apache.cocoon.sunshine.sunrise.context.SessionContextImpl

            }
            // remove context
            context.removeXML(logoutHandlerName);
            // FIXME (CZ): The sessionContextImpl should not be null, but
            //             it is sometimes. Why?
            SessionContextImpl sessionContextImpl = (SessionContextImpl)
                        this.getSunShineComponent().getContext(Constants.SESSION_CONTEXT_NAME);
            if (sessionContextImpl != null) {
                sessionContextImpl.cleanParametersCache(logoutHandlerName);
            } else if (this.getLogger().isWarnEnabled()) {
                this.getLogger().warn("AuthenticationManager:logout() - sessionContextImpl is null");
            }
            Handler logoutHandler = (Handler)this.getHandler(logoutHandlerName);
View Full Code Here

Examples of org.apache.cocoon.sunshine.sunrise.context.SessionContextImpl

        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("BEGIN createParameters handler=" + myHandler +
                              ", path="+path+ ", application=" + appName);
        }

        SessionContextImpl context;
        context = (SessionContextImpl)contextProvider.getSessionContext(Constants.SESSION_CONTEXT_NAME,
                                                      this.objectModel,
                                                      this.resolver,
                                                      this.manager);
        parameters = context.createParameters(parameters, myHandler, path, appName);

        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("END createParameters parameters="+parameters);
        }
        return parameters;
View Full Code Here

Examples of org.apache.cocoon.webapps.authentication.context.SessionContextImpl

            // remove context
            context.removeXML(logoutHandlerName);
            // FIXME (CZ): The sessionContextImpl should not be null, but
            //             it is sometimes. Why?
            SessionContextImpl sessionContextImpl = (SessionContextImpl)
                        (this.getSessionManager().getContext(AuthenticationConstants.SESSION_CONTEXT_NAME));
            if (sessionContextImpl != null) {
                sessionContextImpl.cleanParametersCache(logoutHandlerName);
            } else if (this.getLogger().isWarnEnabled()) {
                this.getLogger().warn("AuthenticationManager:logout() - sessionContextImpl is null");
            }
            Handler logoutHandler = (Handler)this.getHandler(logoutHandlerName);
View Full Code Here

Examples of org.apache.cocoon.webapps.authentication.context.SessionContextImpl

        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("BEGIN createParameters handler=" + myHandler +
                              ", path="+path+ ", application=" + appName);
        }

        SessionContextImpl context;
        context = (SessionContextImpl)contextProvider.getSessionContext(AuthenticationConstants.SESSION_CONTEXT_NAME,
                                                      this.objectModel,
                                                      this.resolver,
                                                      this.manager);
        parameters = context.createParameters(parameters, myHandler, path, appName);

        if (this.getLogger().isDebugEnabled() == true) {
            this.getLogger().debug("END createParameters parameters="+parameters);
        }
        return parameters;
View Full Code Here

Examples of org.jboss.as.ejb3.context.SessionContextImpl

    @Override
    public SessionContextImpl getEjbContext() {
        if (sessionContext == null) {
            synchronized (this) {
                if (sessionContext == null) {
                    this.sessionContext = new SessionContextImpl(this);
                }
            }
        }
        return sessionContext;
    }
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.