Package org.apache.activemq.transaction

Examples of org.apache.activemq.transaction.Synchronization


                log.debug("Journalled transacted message remove for: "+ack.getLastMessageId()+", at: "+location);
            synchronized( this ) {
                inFlightTxLocations.add(location);
            }
            transactionStore.removeMessage(this, ack, location);
            context.getTransaction().addSynchronization(new Synchronization(){
                public void afterCommit() throws Exception {                   
                    if( debug )
                        log.debug("Transacted message remove commit for: "+ack.getLastMessageId()+", at: "+location);
                    synchronized( QuickJournalMessageStore.this ) {
                        inFlightTxLocations.remove(location);
View Full Code Here


                log.debug("Journalled transacted message add for: "+id+", at: "+location);
            synchronized( this ) {
                inFlightTxLocations.add(location);
            }
            transactionStore.addMessage(this, message, location);
            context.getTransaction().addSynchronization(new Synchronization(){
                public void afterCommit() throws Exception {                   
                    if( debug )
                        log.debug("Transacted message add commit for: "+id+", at: "+location);
                    synchronized( JournalMessageStore.this ) {
                        inFlightTxLocations.remove(location);
View Full Code Here

                log.debug("Journalled transacted message remove for: "+ack.getLastMessageId()+", at: "+location);
            synchronized( this ) {
                inFlightTxLocations.add(location);
            }
            transactionStore.removeMessage(this, ack, location);
            context.getTransaction().addSynchronization(new Synchronization(){
                public void afterCommit() throws Exception {                   
                    if( debug )
                        log.debug("Transacted message remove commit for: "+ack.getLastMessageId()+", at: "+location);
                    synchronized( JournalMessageStore.this ) {
                        inFlightTxLocations.remove(location);
View Full Code Here

                MessageAck ack = new MessageAck(md,MessageAck.STANDARD_ACK_TYPE,1);
                ack.setFirstMessageId(md.getMessage().getMessageId());
                doStartTransaction();
                ack.setTransactionId(getTransactionContext().getTransactionId());
                if( ack.getTransactionId()!=null ) {
                    getTransactionContext().addSynchronization(new Synchronization(){
                        public void afterRollback() throws Exception {

                            md.getMessage().onMessageRolledBack();
                           
                            RedeliveryPolicy redeliveryPolicy = connection.getRedeliveryPolicy();
View Full Code Here

        // Handle the standard acknowledgment case.
        boolean wasFull=isFull();
        if(ack.isStandardAck()||ack.isPoisonAck()){
            if(context.isInTransaction()){
                prefetchExtension.addAndGet(ack.getMessageCount());
                context.getTransaction().addSynchronization(new Synchronization(){
                    public void afterCommit() throws Exception{
                      synchronized( TopicSubscription.this ) {
                        if( singleDestination && destination!=null) {
                          destination.getDestinationStatistics().getDequeues().add(ack.getMessageCount());
                        }
View Full Code Here

        message.incrementReferenceCount();
        try {

            if (context.isInTransaction()) {
                context.getTransaction().addSynchronization(new Synchronization() {
                    public void afterCommit() throws Exception {
                        dispatch(context, message);
                    }
                });
View Full Code Here

                      dequeueCounter++;
                      node.getRegionDestination().getDestinationStatistics().getDequeues().increment();
                        iter.remove();
                    }else{
                        // setup a Synchronization to remove nodes from the dispatched list.
                        context.getTransaction().addSynchronization(new Synchronization(){
                            public void afterCommit() throws Exception{
                                synchronized(PrefetchSubscription.this){
                                    dequeueCounter++;
                                    dispatched.remove(node);
                                    node.getRegionDestination().getDestinationStatistics().getDequeues().increment();
View Full Code Here

        final MessageReference node = createMessageReference(message);
        try {

            if (context.isInTransaction()) {
                context.getTransaction().addSynchronization(new Synchronization() {
                    public void afterCommit() throws Exception {
                        dispatch(context, node, message);
                    }
                });
            }
View Full Code Here

     *                 to some internal error.
     */
    public void close() throws JMSException {
        if (!unconsumedMessages.isClosed()) {
            if (session.getTransactionContext().isInTransaction()) {
                session.getTransactionContext().addSynchronization(new Synchronization() {
                    @Override
                    public void afterCommit() throws Exception {
                        doClose();
                    }

View Full Code Here

        // consumer got the message to expand the pre-fetch window
        if (session.getTransacted()) {
            session.doStartTransaction();
            if (!synchronizationRegistered) {
                synchronizationRegistered = true;
                session.getTransactionContext().addSynchronization(new Synchronization() {
                    @Override
                    public void beforeEnd() throws Exception {
                        acknowledge();
                        synchronizationRegistered = false;
                    }
View Full Code Here

TOP

Related Classes of org.apache.activemq.transaction.Synchronization

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.