org.apache.activemq.filter.function
Interface FilterFunction

All Known Implementing Classes:
inListFunction, makeListFunction, regexMatchFunction, replaceFunction, splitFunction

public interface FilterFunction

Interface required for objects that will be registered as functions for use in selectors. Handles parse- time and evaluation-time operations.


Method Summary
 Object evaluate(FunctionCallExpression expr, MessageEvaluationContext message)
          Evaluate the function call in the given context.
 boolean isValid(FunctionCallExpression expr)
          Check whether the function, as it is used, is valid.
 boolean returnsBoolean(FunctionCallExpression expr)
          Determine whether the function, as it will be called, returns a boolean value.
 

Method Detail

isValid

boolean isValid(FunctionCallExpression expr)
Check whether the function, as it is used, is valid. Checking arguments here will return errors to clients at the time invalid selectors are initially specified, rather than waiting until the selector is applied to a message.

Parameters:
FunctionCallExpression - expr - the full expression of the function call, as used.
Returns:
true - if the function call is valid; false - otherwise.

returnsBoolean

boolean returnsBoolean(FunctionCallExpression expr)
Determine whether the function, as it will be called, returns a boolean value. Called during expression parsing after the full expression for the function call, including its arguments, has been parsed. This allows functions with variable return types to function as boolean expressions in selectors without sacrificing parse-time checking.

Parameters:
FunctionCallExpression - expr - the full expression of the function call, as used.
Returns:
true - if the function returns a boolean value for its use in the given expression; false - otherwise.

evaluate

Object evaluate(FunctionCallExpression expr,
                MessageEvaluationContext message)
                throws JMSException
Evaluate the function call in the given context. The arguments must be evaluated, as-needed, by the function. Note that boolean expressions must return Boolean objects.

Parameters:
FunctionCallExpression - expr - the full expression of the function call, as used.
MessageEvaluationContext - message - the context within which to evaluate the call.
Throws:
JMSException


Copyright © 2005–2013 The Apache Software Foundation. All rights reserved.