Package org.activemq.filter

Examples of org.activemq.filter.Filter


  protected void replayTransientConsumedRedeliveredMessages(
      ActiveMQSession session, ActiveMQMessageConsumer consumer)
      throws JMSException {
    if (consumer.getDestination().isTopic()
        && !transientConsumedRedeliverCache.isEmpty()) {
      Filter filter = getFilterFactory().createFilter(
          consumer.getDestination(), consumer.getMessageSelector());
      if (consumer.isNoLocal()) {
        filter = new AndFilter(filter, new NoLocalFilter(clientID));
      }
      for (Iterator i = transientConsumedRedeliverCache.iterator(); i
          .hasNext();) {
        ActiveMQMessage message = (ActiveMQMessage) i.next();
        if (filter.matches(message)) {
          transientConsumedRedeliverCache.remove(message);
          message.setMessageAcknowledge(session);
          message.setJMSRedelivered(true);
          message.setConsumerNos(new int[] { consumer
              .getConsumerNumber() });
View Full Code Here


     * @param info
     * @return the Fitler
     * @throws javax.jms.JMSException
     */
    protected Filter createFilter(ConsumerInfo info) throws JMSException {
        Filter filter = filterFactory.createFilter(info.getDestination(), info.getSelector());
        if (info.isNoLocal()) {
            filter = new AndFilter(filter, new NoLocalFilter(info.getClientId()));
        }
        return filter;
    }
View Full Code Here

  protected void replayTransientConsumedRedeliveredMessages(
      ActiveMQSession session, ActiveMQMessageConsumer consumer)
      throws JMSException {
    if (consumer.getDestination().isTopic()
        && !transientConsumedRedeliverCache.isEmpty()) {
      Filter filter = getFilterFactory().createFilter(
          consumer.getDestination(), consumer.getMessageSelector());
      if (consumer.isNoLocal()) {
        filter = new AndFilter(filter, new NoLocalFilter(clientID));
      }
      for (Iterator i = transientConsumedRedeliverCache.iterator(); i
          .hasNext();) {
        ActiveMQMessage message = (ActiveMQMessage) i.next();
        if (filter.matches(message)) {
          transientConsumedRedeliverCache.remove(message);
          message.setMessageAcknowledge(session);
          message.setJMSRedelivered(true);
          message.setConsumerNos(new int[] { consumer
              .getConsumerNumber() });
View Full Code Here

* @version $Revision: 1.1.1.1 $
*/
public class SelectorParserTest extends TestCase {

    public void testParseXPath() throws Exception {
        Filter filter = parse("XPATH '//title[@lang=''eng'']'");
        assertTrue("Created ExpressionFilter filter", filter instanceof ExpressionFilter);
        Expression xpathExpression = ((ExpressionFilter) filter).getExpression();
        assertTrue("Created XPath expression", xpathExpression instanceof XPathExpression);
        System.out.println("Expression: "+xpathExpression);
    }
View Full Code Here

        for (int i = 0; i < values.length; i++) {
            String value = values[i];
            System.out.println("Parsing: " + value);

            Filter filter = parse(value);
            assertTrue("Created ExpressionFilter filter", filter instanceof ExpressionFilter);
            Expression andExpression = ((ExpressionFilter) filter).getExpression();
            assertTrue("Created LogicExpression expression", andExpression instanceof LogicExpression);
            LogicExpression logicExpression = (LogicExpression) andExpression;
            Expression left = logicExpression.getLeft();
View Full Code Here

    }


    protected void assertInvalidSelector(Message message, String text) throws JMSException {
        try {
            Filter selector = new SelectorParser().parse(text);
            fail("Created a valid selector");
        }
        catch (InvalidSelectorException e) {
        }
    }
View Full Code Here

        catch (InvalidSelectorException e) {
        }
    }

    protected void assertSelector(Message message, String text, boolean expected) throws JMSException {
        Filter selector = new SelectorParser().parse(text);
        assertTrue("Created a valid selector", selector != null);

        boolean value = selector.matches(message);

        assertEquals("Selector for: " + text, expected, value);
    }
View Full Code Here

     * @param info
     * @return the Fitler
     * @throws javax.jms.JMSException
     */
    protected Filter createFilter(ConsumerInfo info) throws JMSException {
        Filter filter = filterFactory.createFilter(info.getDestination(), info.getSelector());
        if (info.isNoLocal()) {
            filter = new AndFilter(filter, new NoLocalFilter(info.getClientId()));
        }
        return filter;
    }
View Full Code Here

     * @param info
     * @return the Fitler
     * @throws javax.jms.JMSException
     */
    protected Filter createFilter(ConsumerInfo info) throws JMSException {
        Filter filter = filterFactory.createFilter(info.getDestination(), info.getSelector());
        if (info.isNoLocal()) {
            filter = new AndFilter(filter, new NoLocalFilter(info.getClientId()));
        }
        return filter;
    }
View Full Code Here

     * @param info
     * @return the Fitler
     * @throws javax.jms.JMSException
     */
    protected Filter createFilter(ConsumerInfo info) throws JMSException {
        Filter filter = filterFactory.createFilter(info.getDestination(), info.getSelector());
        if (info.isNoLocal()) {
            filter = new AndFilter(filter, new NoLocalFilter(info.getClientId()));
        }
        return filter;
    }
View Full Code Here

TOP

Related Classes of org.activemq.filter.Filter

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.