Supports selective consumption of messages on the channel. The first message
to be accepted by given message selector is returned as result.

@param selector
@return
485612
public Message<?> receive(MessageSelector selector) {
        Object[] array = this.queue.toArray();
        for (Object o : array) {
            Message<?> message = (Message<?>) o;
            if (selector.accept(message) && this.queue.remove(message)) {
                return message;
            }
        }
        
        return null;
    }
189541
public void setSelector(String selector)
  {
    if (tc.isEntryEnabled())
      SibTr.entry(tc, "setSelector", selector);

    this.selector = selector;

    if (tc.isEntryEnabled())
      SibTr.exit(tc, "setSelector");
  }
121996
public static String getMessageSelector(String eventName, IPublisherInfo publisherInfo) {
        StringBuilder sb = new StringBuilder(
                "(JMSType='" + eventName + "' OR JMSType LIKE '" + eventName + ".%') AND (Recipients IS NULL");
        
        if (publisherInfo != null) {
            for (String selector : publisherInfo.getAttributes().values()) {
                addRecipientSelector(selector, sb);
            }
        }
        
        sb.append(')');
        return sb.toString();
    }
813844
function(selector) {

	if( typeof selector == 'string' ) {
		var node = y.querySelectorAll(selector);

		if( node.length == 0 ) {
			return null;
		}

		return new NWTNodeInstance(node[0]);
	} else {
		return new NWTNodeInstance(selector);
	}
}
490500
public java.util.List<Selector> getSelectors() {
        if (selectors == null) {
            selectors = new com.amazonaws.internal.SdkInternalList<Selector>();
        }
        return selectors;
    }
1131519
public B partialFilterSelector(Selector selector) {
        instance.def.selector = Helpers.getJsonObjectFromSelector(selector);
        return returnThis();
    }
107789
public static <T1, R> Plan0<R> then(/* this */Observable<T1> source, Func1<T1, R> selector) {
        if (source == null) {
            throw new NullPointerException("source");
        }
        if (selector == null) {
            throw new NullPointerException("selector");
        }
        return new Pattern1<T1>(source).then(selector);
    }
1156945
public static cacheselector get(nitro_service service, String selectorname) throws Exception{
		cacheselector obj = new cacheselector();
		obj.set_selectorname(selectorname);
		cacheselector response = (cacheselector) obj.get_resource(service);
		return response;
	}
392490
public OpsAgent getAgent(OpsSelector selector) {
        OpsAgent agent = m_agents.get(selector);
        assert (agent != null);
        return agent;
    }
729849
public ArrayList getConsumerListForExpression(
    String topicExpression,
    boolean selector,
    boolean isWildcarded)
  {
    if (tc.isEntryEnabled()) 
      SibTr.entry(tc, 
                  "getConsumerListForExpression", 
                  new Object[]{topicExpression,
                               new Boolean(selector),
                               new Boolean(isWildcarded)});

    ArrayList consumerList = null;
    if(selector)
    {
      if(isWildcarded)
      {
        // Selector and wildcarded
        consumerList = (ArrayList)_wildcardSelectorSubs.get(topicExpression);
      }
      else
      {
        // Selector but not wildcarded
        consumerList = (ArrayList)_exactSelectorSubs.get(topicExpression);
      }
    }
    else
    {
      // No Selector expression
      if(isWildcarded)
      {
        // No selector and wildcarded
        consumerList = (ArrayList)_wildcardNonSelectorSubs.get(topicExpression);
      }
      else
      {
        // No selector and not wildcarded
        consumerList = (ArrayList)_exactNonSelectorSubs.get(topicExpression);
      }      
    } 
    if (tc.isEntryEnabled()) SibTr.exit(tc, "getConsumerListForExpression", consumerList);
    return consumerList;
  }
679689
public static UnindexedMatcher matcherWithSelector(Map<String, Object> selector) {
        ChildrenQueryNode root = buildExecutionTreeForSelector(selector);

        if (root == null) {
            return null;
        }

        UnindexedMatcher matcher = new UnindexedMatcher();
        matcher.root = root;

        return matcher;
    }
1082273
private Message receiveSelected(TestContext context, String selectorString) {
        if (log.isDebugEnabled()) {
            log.debug("Setting message selector: '" + selectorString + "'");
        }

        Endpoint messageEndpoint = getOrCreateEndpoint(context);
        Consumer consumer = messageEndpoint.createConsumer();
        if (consumer instanceof SelectiveConsumer) {
            if (receiveTimeout > 0) {
                return ((SelectiveConsumer) messageEndpoint.createConsumer()).receive(
                        context.replaceDynamicContentInString(selectorString),
                        context, receiveTimeout);
            } else {
                return ((SelectiveConsumer) messageEndpoint.createConsumer()).receive(
                        context.replaceDynamicContentInString(selectorString),
                        context, messageEndpoint.getEndpointConfiguration().getTimeout());
            }
        } else {
            log.warn(String.format("Unable to receive selective with consumer implementation: '%s'", consumer.getClass()));
            return receive(context);
        }
    }
878467
public void setSelectorString(String selector)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "setSelectorString", selector);

    this.selectorString = selector;
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "setSelectorString");
  }
827226
@Override
    public String getPartialFilterSelector() {
        return (def.selector != null) ? def.selector.toString() : null;
    }
76316
static Selector getTemporarySelector(SelectableChannel sc)
        throws IOException
    {
        SoftReference<SelectorWrapper> ref = localSelector.get();
        SelectorWrapper selWrapper = null;
        Selector sel = null;
        if (ref == null
            || ((selWrapper = ref.get()) == null)
            || ((sel = selWrapper.get()) == null)
            || (sel.provider() != sc.provider())) {
            sel = sc.provider().openSelector();
            selWrapper = new SelectorWrapper(sel);
            localSelector.set(new SoftReference<SelectorWrapper>(selWrapper));
        }
        localSelectorWrapper.set(selWrapper);
        return sel;
    }
1311068
public function first($selector=null)
    {
        $result = $this[0];
        if ($selector) {
            $result = $result->filter($selector);
        }
        return $result;
    }
1031612
public MessageConsumer createConsumer(IntegerID consumerId,Destination destination, String messageSelector, boolean noLocal) throws JMSException
    {
    	externalAccessLock.readLock().lock();
    	try
		{
	        checkNotClosed();
	        LocalMessageConsumer consumer = new LocalMessageConsumer(engine,this,destination,messageSelector,noLocal,consumerId,null);
	        registerConsumer(consumer);
	        consumer.initDestination();
	        return consumer;
		}
    	finally
    	{
    		externalAccessLock.readLock().unlock();
    	}
    }