Package com.ponysdk.core.stm

Examples of com.ponysdk.core.stm.Txn.begin()


        if (UIContext.get() == null) {
            begin();
            try {
                if (listenerCollection.isEmpty()) return;
                final Txn txn = Txn.get();
                txn.begin(txnContext);
                try {
                    for (final Object data : collection) {
                        for (final DataListener listener : listenerCollection) {
                            listener.onData(data);
                        }
View Full Code Here


        if (UIContext.get() == null) {
            begin();
            try {
                if (listenerCollection.isEmpty()) return;
                final Txn txn = Txn.get();
                txn.begin(txnContext);
                try {
                    for (final DataListener listener : listenerCollection) {
                        listener.onData(data);
                    }
                    txn.commit();
View Full Code Here

    @Override
    public void onClose() {
        begin();
        try {
            final Txn txn = Txn.get();
            txn.begin(txnContext);
            try {
                doClose();
                txn.commit();
            } catch (final Throwable e) {
                log.error("Cannot process open socket", e);
View Full Code Here

    @Override
    public void onOpen() {
        begin();
        try {
            final Txn txn = Txn.get();
            txn.begin(txnContext);
            try {
                doOpen();
                txn.commit();
            } catch (final Throwable e) {
                log.error("Cannot process open socket", e);
View Full Code Here

        try {
            if (UIContext.get() == null) {
                begin();
                try {
                    final Txn txn = Txn.get();
                    txn.begin(txnContext);
                    try {
                        runnable.run();
                        txn.commit();
                    } catch (final Throwable e) {
                        log.error("Cannot process commmand", e);
View Full Code Here

                if (previousUIContext != null) previousUIContext.destroy();
            }

            try {
                final Txn txn = Txn.get();
                txn.begin(new TxnContextHttp(true, request, response));
                try {

                    final long receivedSeqNum = data.getLong(APPLICATION.SEQ_NUM);
                    uiContext.updateIncomingSeqNum(receivedSeqNum);
View Full Code Here

        uiContext.acquire();
        UIContext.setCurrent(uiContext);
        try {
            final Txn txn = Txn.get();
            txn.begin(new TxnContextHttp(false, request, response));
            try {
                final Long receivedSeqNum = checkClientMessage(request.getSession(), data, uiContext);

                if (receivedSeqNum != null) {
                    process(uiContext, data);
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.