Package org.apache.qpid.client.util

Examples of org.apache.qpid.client.util.FlowControllingBlockingQueue$ThresholdListener


        _prefetchLowMark = defaultPrefetchLowMark;

        if (_acknowledgeMode == NO_ACKNOWLEDGE)
        {
            _queue =
                    new FlowControllingBlockingQueue(_prefetchHighMark, _prefetchLowMark,
                                                     new FlowControllingBlockingQueue.ThresholdListener()
                                                     {
                                                         private final AtomicBoolean _suspendState = new AtomicBoolean();

                                                         public void aboveThreshold(int currentValue)
                                                         {
                                                             // If the session has been closed don't waste time creating a thread to do
                                                             // flow control
                                                             if (!(AMQSession.this.isClosed() || AMQSession.this.isClosing()))
                                                             {  
                                                                 // Only execute change if previous state
                                                                 // was False
                                                                 if (!_suspendState.getAndSet(true))
                                                                 {
                                                                     if (_logger.isDebugEnabled())
                                                                     {
                                                                         _logger.debug(
                                                                                 "Above threshold(" + _prefetchHighMark
                                                                                 + ") so suspending channel. Current value is " + currentValue);
                                                                     }
                                                                     try
                                                                     {
                                                                         Threading.getThreadFactory().createThread(new SuspenderRunner(_suspendState)).start();
                                                                     }
                                                                     catch (Exception e)
                                                                     {
                                                                         throw new RuntimeException("Failed to create thread", e);
                                                                     }
                                                                 }
                                                             }
                                                         }

                                                         public void underThreshold(int currentValue)
                                                         {
                                                             // If the session has been closed don't waste time creating a thread to do
                                                             // flow control
                                                             if (!(AMQSession.this.isClosed() || AMQSession.this.isClosing()))
                                                             {
                                                                 // Only execute change if previous state
                                                                 // was true
                                                                 if (_suspendState.getAndSet(false))
                                                                 {
                                                                     if (_logger.isDebugEnabled())
                                                                     {

                                                                         _logger.debug(
                                                                                 "Below threshold(" + _prefetchLowMark
                                                                                 + ") so unsuspending channel. Current value is " + currentValue);
                                                                     }
                                                                     try
                                                                     {
                                                                         Threading.getThreadFactory().createThread(new SuspenderRunner(_suspendState)).start();
                                                                     }
                                                                     catch (Exception e)
                                                                     {
                                                                         throw new RuntimeException("Failed to create thread", e);
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     });
        }
        else
        {
            _queue = new FlowControllingBlockingQueue(_prefetchHighMark, null);
        }

        // Add creation logging to tie in with the existing close logging
        if (_logger.isDebugEnabled())
        {
View Full Code Here


        _prefetchLowMark = defaultPrefetchLowMark;

        if (_acknowledgeMode == NO_ACKNOWLEDGE)
        {
            _queue =
                    new FlowControllingBlockingQueue(_prefetchHighMark, _prefetchLowMark,
                                                     new FlowControllingBlockingQueue.ThresholdListener()
                                                     {
                                                         private final AtomicBoolean _suspendState = new AtomicBoolean();

                                                         public void aboveThreshold(int currentValue)
                                                         {
                                                             // If the session has been closed don't waste time creating a thread to do
                                                             // flow control
                                                             if (!(AMQSession.this.isClosed() || AMQSession.this.isClosing()))
                                                             {  
                                                                 // Only execute change if previous state
                                                                 // was False
                                                                 if (!_suspendState.getAndSet(true))
                                                                 {
                                                                     if (_logger.isDebugEnabled())
                                                                     {
                                                                         _logger.debug(
                                                                                 "Above threshold(" + _prefetchHighMark
                                                                                 + ") so suspending channel. Current value is " + currentValue);
                                                                     }
                                                                     try
                                                                     {
                                                                         Threading.getThreadFactory().createThread(new SuspenderRunner(_suspendState)).start();
                                                                     }
                                                                     catch (Exception e)
                                                                     {
                                                                         throw new RuntimeException("Failed to create thread", e);
                                                                     }
                                                                 }
                                                             }
                                                         }

                                                         public void underThreshold(int currentValue)
                                                         {
                                                             // If the session has been closed don't waste time creating a thread to do
                                                             // flow control
                                                             if (!(AMQSession.this.isClosed() || AMQSession.this.isClosing()))
                                                             {
                                                                 // Only execute change if previous state
                                                                 // was true
                                                                 if (_suspendState.getAndSet(false))
                                                                 {
                                                                     if (_logger.isDebugEnabled())
                                                                     {

                                                                         _logger.debug(
                                                                                 "Below threshold(" + _prefetchLowMark
                                                                                 + ") so unsuspending channel. Current value is " + currentValue);
                                                                     }
                                                                     try
                                                                     {
                                                                         Threading.getThreadFactory().createThread(new SuspenderRunner(_suspendState)).start();
                                                                     }
                                                                     catch (Exception e)
                                                                     {
                                                                         throw new RuntimeException("Failed to create thread", e);
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     });
        }
        else
        {
            _queue = new FlowControllingBlockingQueue(_prefetchHighMark, null);
        }

        // Add creation logging to tie in with the existing close logging
        if (_logger.isDebugEnabled())
        {
View Full Code Here

        _prefetchLowMark = defaultPrefetchLowMark;

        if (_acknowledgeMode == NO_ACKNOWLEDGE)
        {
            _queue =
                    new FlowControllingBlockingQueue(_prefetchHighMark, _prefetchLowMark,
                                                     new FlowControllingBlockingQueue.ThresholdListener()
                                                     {
                                                         private final AtomicBoolean _suspendState = new AtomicBoolean();

                                                         public void aboveThreshold(int currentValue)
                                                         {
                                                             // If the session has been closed don't waste time creating a thread to do
                                                             // flow control
                                                             if (!(AMQSession.this.isClosed() || AMQSession.this.isClosing()))
                                                             {
                                                                 // Only execute change if previous state
                                                                 // was False
                                                                 if (!_suspendState.getAndSet(true))
                                                                 {
                                                                     if (_logger.isDebugEnabled())
                                                                     {
                                                                         _logger.debug(
                                                                                 "Above threshold(" + _prefetchHighMark
                                                                                 + ") so suspending channel. Current value is " + currentValue);
                                                                     }
                                                                     try
                                                                     {
                                                                         Threading.getThreadFactory().createThread(new SuspenderRunner(_suspendState)).start();
                                                                     }
                                                                     catch (Exception e)
                                                                     {
                                                                         throw new RuntimeException("Failed to create thread", e);
                                                                     }
                                                                 }
                                                             }
                                                         }

                                                         public void underThreshold(int currentValue)
                                                         {
                                                             // If the session has been closed don't waste time creating a thread to do
                                                             // flow control
                                                             if (!(AMQSession.this.isClosed() || AMQSession.this.isClosing()))
                                                             {
                                                                 // Only execute change if previous state
                                                                 // was true
                                                                 if (_suspendState.getAndSet(false))
                                                                 {
                                                                     if (_logger.isDebugEnabled())
                                                                     {

                                                                         _logger.debug(
                                                                                 "Below threshold(" + _prefetchLowMark
                                                                                 + ") so unsuspending channel. Current value is " + currentValue);
                                                                     }
                                                                     try
                                                                     {
                                                                         Threading.getThreadFactory().createThread(new SuspenderRunner(_suspendState)).start();
                                                                     }
                                                                     catch (Exception e)
                                                                     {
                                                                         throw new RuntimeException("Failed to create thread", e);
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     });
        }
        else
        {
            _queue = new FlowControllingBlockingQueue(_prefetchHighMark, null);
        }

        // Add creation logging to tie in with the existing close logging
        if (_logger.isDebugEnabled())
        {
View Full Code Here

        _prefetchLowMark = defaultPrefetchLowMark;

        if (_acknowledgeMode == NO_ACKNOWLEDGE)
        {
            _queue =
                    new FlowControllingBlockingQueue(_prefetchHighMark, _prefetchLowMark,
                                                     new FlowControllingBlockingQueue.ThresholdListener()
                                                     {
                                                         private final AtomicBoolean _suspendState = new AtomicBoolean();

                                                         public void aboveThreshold(int currentValue)
                                                         {
                                                             // If the session has been closed don't waste time creating a thread to do
                                                             // flow control
                                                             if (!(_thisSession.isClosed() || _thisSession.isClosing()))
                                                             {  
                                                                 // Only execute change if previous state
                                                                 // was False
                                                                 if (!_suspendState.getAndSet(true))
                                                                 {
                                                                     if (_logger.isDebugEnabled())
                                                                     {
                                                                         _logger.debug(
                                                                                 "Above threshold(" + _prefetchHighMark
                                                                                 + ") so suspending channel. Current value is " + currentValue);
                                                                     }
                                                                     try
                                                                     {
                                                                         Threading.getThreadFactory().createThread(new SuspenderRunner(_suspendState)).start();
                                                                     }
                                                                     catch (Exception e)
                                                                     {
                                                                         throw new RuntimeException("Failed to create thread", e);
                                                                     }
                                                                 }
                                                             }
                                                         }

                                                         public void underThreshold(int currentValue)
                                                         {
                                                             // If the session has been closed don't waste time creating a thread to do
                                                             // flow control
                                                             if (!(_thisSession.isClosed() || _thisSession.isClosing()))
                                                             {
                                                                 // Only execute change if previous state
                                                                 // was true
                                                                 if (_suspendState.getAndSet(false))
                                                                 {
                                                                     if (_logger.isDebugEnabled())
                                                                     {

                                                                         _logger.debug(
                                                                                 "Below threshold(" + _prefetchLowMark
                                                                                 + ") so unsuspending channel. Current value is " + currentValue);
                                                                     }
                                                                     try
                                                                     {
                                                                         Threading.getThreadFactory().createThread(new SuspenderRunner(_suspendState)).start();
                                                                     }
                                                                     catch (Exception e)
                                                                     {
                                                                         throw new RuntimeException("Failed to create thread", e);
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     });
        }
        else
        {
            _queue = new FlowControllingBlockingQueue(_prefetchHighMark, null);
        }
       
        // Add creation logging to tie in with the existing close logging
        if (_logger.isInfoEnabled())
        {
View Full Code Here

        _prefetchLowMark = defaultPrefetchLowMark;

        if (_acknowledgeMode == NO_ACKNOWLEDGE)
        {
            _queue =
                    new FlowControllingBlockingQueue(_prefetchHighMark, _prefetchLowMark,
                                                     new FlowControllingBlockingQueue.ThresholdListener()
                                                     {
                                                         private final AtomicBoolean _suspendState = new AtomicBoolean();

                                                         public void aboveThreshold(int currentValue)
                                                         {
                                                             // If the session has been closed don't waste time creating a thread to do
                                                             // flow control
                                                             if (!(_thisSession.isClosed() || _thisSession.isClosing()))
                                                             {  
                                                                 // Only execute change if previous state
                                                                 // was False
                                                                 if (!_suspendState.getAndSet(true))
                                                                 {
                                                                     if (_logger.isDebugEnabled())
                                                                     {
                                                                         _logger.debug(
                                                                                 "Above threshold(" + _prefetchHighMark
                                                                                 + ") so suspending channel. Current value is " + currentValue);
                                                                     }
                                                                     try
                                                                     {
                                                                         Threading.getThreadFactory().createThread(new SuspenderRunner(_suspendState)).start();
                                                                     }
                                                                     catch (Exception e)
                                                                     {
                                                                         throw new RuntimeException("Failed to create thread", e);
                                                                     }
                                                                 }
                                                             }
                                                         }

                                                         public void underThreshold(int currentValue)
                                                         {
                                                             // If the session has been closed don't waste time creating a thread to do
                                                             // flow control
                                                             if (!(_thisSession.isClosed() || _thisSession.isClosing()))
                                                             {
                                                                 // Only execute change if previous state
                                                                 // was true
                                                                 if (_suspendState.getAndSet(false))
                                                                 {
                                                                     if (_logger.isDebugEnabled())
                                                                     {

                                                                         _logger.debug(
                                                                                 "Below threshold(" + _prefetchLowMark
                                                                                 + ") so unsuspending channel. Current value is " + currentValue);
                                                                     }
                                                                     try
                                                                     {
                                                                         Threading.getThreadFactory().createThread(new SuspenderRunner(_suspendState)).start();
                                                                     }
                                                                     catch (Exception e)
                                                                     {
                                                                         throw new RuntimeException("Failed to create thread", e);
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     });
        }
        else
        {
            _queue = new FlowControllingBlockingQueue(_prefetchHighMark, null);
        }
       
        // Add creation logging to tie in with the existing close logging
        if (_logger.isInfoEnabled())
        {
View Full Code Here

        _defaultPrefetchLowMark = defaultPrefetchLowMark;

        if (_acknowledgeMode == NO_ACKNOWLEDGE)
        {
            _queue =
                    new FlowControllingBlockingQueue(_defaultPrefetchHighMark, _defaultPrefetchLowMark,
                                                     new FlowControllingBlockingQueue.ThresholdListener()
                                                     {
                                                         private final AtomicBoolean _suspendState = new AtomicBoolean();

                                                         public void aboveThreshold(int currentValue)
                                                         {
                                                             _logger.debug(
                                                                     "Above threshold(" + _defaultPrefetchHighMark
                                                                     + ") so suspending channel. Current value is " + currentValue);
                                                             _suspendState.set(true);
                                                             new Thread(new SuspenderRunner(_suspendState)).start();

                                                         }

                                                         public void underThreshold(int currentValue)
                                                         {
                                                             _logger.debug(
                                                                     "Below threshold(" + _defaultPrefetchLowMark
                                                                     + ") so unsuspending channel. Current value is " + currentValue);
                                                             _suspendState.set(false);
                                                             new Thread(new SuspenderRunner(_suspendState)).start();

                                                         }
                                                     });
        }
        else
        {
            _queue = new FlowControllingBlockingQueue(_defaultPrefetchHighMark, null);
        }
    }
View Full Code Here

        _defaultPrefetchLowMark = defaultPrefetchLowMark;

        if (_acknowledgeMode == NO_ACKNOWLEDGE)
        {
            _queue =
                    new FlowControllingBlockingQueue(_defaultPrefetchHighMark, _defaultPrefetchLowMark,
                                                     new FlowControllingBlockingQueue.ThresholdListener()
                                                     {
                                                         private final AtomicBoolean _suspendState = new AtomicBoolean();

                                                         public void aboveThreshold(int currentValue)
                                                         {
                                                             _logger.debug(
                                                                     "Above threshold(" + _defaultPrefetchHighMark
                                                                     + ") so suspending channel. Current value is " + currentValue);
                                                             _suspendState.set(true);
                                                             new Thread(new SuspenderRunner(_suspendState)).start();

                                                         }

                                                         public void underThreshold(int currentValue)
                                                         {
                                                             _logger.debug(
                                                                     "Below threshold(" + _defaultPrefetchLowMark
                                                                     + ") so unsuspending channel. Current value is " + currentValue);
                                                             _suspendState.set(false);
                                                             new Thread(new SuspenderRunner(_suspendState)).start();

                                                         }
                                                     });
        }
        else
        {
            _queue = new FlowControllingBlockingQueue(_defaultPrefetchHighMark, null);
        }
    }
View Full Code Here

        _defaultPrefetchLowMark = defaultPrefetchLowMark;

        if (_acknowledgeMode == NO_ACKNOWLEDGE)
        {
            _queue =
                    new FlowControllingBlockingQueue(_defaultPrefetchHighMark, _defaultPrefetchLowMark,
                                                     new FlowControllingBlockingQueue.ThresholdListener()
                                                     {
                                                         public void aboveThreshold(int currentValue)
                                                         {
                                                             if (_acknowledgeMode == NO_ACKNOWLEDGE)
                                                             {
                                                                 _logger.debug(
                                                                         "Above threshold(" + _defaultPrefetchHighMark
                                                                         + ") so suspending channel. Current value is " + currentValue);
                                                                 new Thread(new SuspenderRunner(true)).start();
                                                             }
                                                         }

                                                         public void underThreshold(int currentValue)
                                                         {
                                                             if (_acknowledgeMode == NO_ACKNOWLEDGE)
                                                             {
                                                                 _logger.debug(
                                                                         "Below threshold(" + _defaultPrefetchLowMark
                                                                         + ") so unsuspending channel. Current value is " + currentValue);
                                                                 new Thread(new SuspenderRunner(false)).start();
                                                             }
                                                         }
                                                     });
        }
        else
        {
            _queue = new FlowControllingBlockingQueue(_defaultPrefetchHighMark, null);
        }
    }
View Full Code Here

        _prefetchLowMark = defaultPrefetchLowMark;

        if (_acknowledgeMode == NO_ACKNOWLEDGE)
        {
            _queue =
                    new FlowControllingBlockingQueue(_prefetchHighMark, _prefetchLowMark,
                                                     new FlowControllingBlockingQueue.ThresholdListener()
                                                     {
                                                         private final AtomicBoolean _suspendState = new AtomicBoolean();

                                                         public void aboveThreshold(int currentValue)
                                                         {
                                                             // If the session has been closed don't waste time creating a thread to do
                                                             // flow control
                                                             if (!(AMQSession.this.isClosed() || AMQSession.this.isClosing()))
                                                             {  
                                                                 // Only execute change if previous state
                                                                 // was False
                                                                 if (!_suspendState.getAndSet(true))
                                                                 {
                                                                     if (_logger.isDebugEnabled())
                                                                     {
                                                                         _logger.debug(
                                                                                 "Above threshold(" + _prefetchHighMark
                                                                                 + ") so suspending channel. Current value is " + currentValue);
                                                                     }
                                                                     try
                                                                     {
                                                                         Threading.getThreadFactory().createThread(new SuspenderRunner(_suspendState)).start();
                                                                     }
                                                                     catch (Exception e)
                                                                     {
                                                                         throw new RuntimeException("Failed to create thread", e);
                                                                     }
                                                                 }
                                                             }
                                                         }

                                                         public void underThreshold(int currentValue)
                                                         {
                                                             // If the session has been closed don't waste time creating a thread to do
                                                             // flow control
                                                             if (!(AMQSession.this.isClosed() || AMQSession.this.isClosing()))
                                                             {
                                                                 // Only execute change if previous state
                                                                 // was true
                                                                 if (_suspendState.getAndSet(false))
                                                                 {
                                                                     if (_logger.isDebugEnabled())
                                                                     {

                                                                         _logger.debug(
                                                                                 "Below threshold(" + _prefetchLowMark
                                                                                 + ") so unsuspending channel. Current value is " + currentValue);
                                                                     }
                                                                     try
                                                                     {
                                                                         Threading.getThreadFactory().createThread(new SuspenderRunner(_suspendState)).start();
                                                                     }
                                                                     catch (Exception e)
                                                                     {
                                                                         throw new RuntimeException("Failed to create thread", e);
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     });
        }
        else
        {
            _queue = new FlowControllingBlockingQueue(_prefetchHighMark, null);
        }

        // Add creation logging to tie in with the existing close logging
        if (_logger.isDebugEnabled())
        {
View Full Code Here

        _defaultPrefetchLowMark = defaultPrefetchLowMark;

        if (_acknowledgeMode == NO_ACKNOWLEDGE)
        {
            _queue =
                    new FlowControllingBlockingQueue(_defaultPrefetchHighMark, _defaultPrefetchLowMark,
                                                     new FlowControllingBlockingQueue.ThresholdListener()
                                                     {
                                                         private final AtomicBoolean _suspendState = new AtomicBoolean();

                                                         public void aboveThreshold(int currentValue)
                                                         {
                                                             _logger.debug(
                                                                     "Above threshold(" + _defaultPrefetchHighMark
                                                                     + ") so suspending channel. Current value is " + currentValue);
                                                             _suspendState.set(true);
                                                             new Thread(new SuspenderRunner(_suspendState)).start();

                                                         }

                                                         public void underThreshold(int currentValue)
                                                         {
                                                             _logger.debug(
                                                                     "Below threshold(" + _defaultPrefetchLowMark
                                                                     + ") so unsuspending channel. Current value is " + currentValue);
                                                             _suspendState.set(false);
                                                             new Thread(new SuspenderRunner(_suspendState)).start();

                                                         }
                                                     });
        }
        else
        {
            _queue = new FlowControllingBlockingQueue(_defaultPrefetchHighMark, null);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.client.util.FlowControllingBlockingQueue$ThresholdListener

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.