org.apache.ws.notification.topics.expression.impl
Class TopicExpressionEngineImpl

java.lang.Object
  extended byorg.apache.ws.notification.topics.expression.impl.TopicExpressionEngineImpl
All Implemented Interfaces:
TopicExpressionEngine

public class TopicExpressionEngineImpl
extends java.lang.Object
implements TopicExpressionEngine

Resolves topic expressions over topic lists. The engine looks for topic expression evaluators under "wsrf/topic/eval" context.

See Also:
TopicSpaceSet

Constructor Summary
TopicExpressionEngineImpl()
           
 
Method Summary
 Topic[] evaluateTopicExpression(TopicSpaceSet topicSpaceSet, TopicExpression topicExpression)
          Resolves a topic expression using the passed topic list.
 TopicExpressionEvaluator getEvaluator(java.lang.String dialect)
          Gets the evaluator currently registered to handle a topic expression of the specified dialect.
static TopicExpressionEngine getInstance()
          Get the default topic expression engine instance (currently used to hide JNDI lookup details, may change in the future)
 java.lang.String[] getSupportedDialects()
          Returns a list of URIs representing the registered topic expression dialects
 void refresh()
          Refresh the set of registered topic expression evaluators using information discovered from the JNDI registry.
 void registerEvaluator(TopicExpressionEvaluator evaluator)
          registers a new evaluator that can be used to evaluate topic expressions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TopicExpressionEngineImpl

public TopicExpressionEngineImpl()
Method Detail

getInstance

public static TopicExpressionEngine getInstance()
Get the default topic expression engine instance (currently used to hide JNDI lookup details, may change in the future)

Returns:
The default topic expression engine instance

refresh

public void refresh()
Refresh the set of registered topic expression evaluators using information discovered from the JNDI registry. This method removes any previously registered topic expression evaluators, so handle with care.


registerEvaluator

public void registerEvaluator(TopicExpressionEvaluator evaluator)
Description copied from interface: TopicExpressionEngine
registers a new evaluator that can be used to evaluate topic expressions

Specified by:
registerEvaluator in interface TopicExpressionEngine
Parameters:
evaluator - implementation of evaluator to be used for evaluating topic expressions

getEvaluator

public TopicExpressionEvaluator getEvaluator(java.lang.String dialect)
Description copied from interface: TopicExpressionEngine
Gets the evaluator currently registered to handle a topic expression of the specified dialect.

Specified by:
getEvaluator in interface TopicExpressionEngine
Returns:
the matching topic expression evaluator or null if none was found

evaluateTopicExpression

public Topic[] evaluateTopicExpression(TopicSpaceSet topicSpaceSet,
                                       TopicExpression topicExpression)
                                throws TopicPathDialectUnknownException,
                                       TopicExpressionResolutionException,
                                       InvalidTopicExpressionException,
                                       TopicExpressionException
Description copied from interface: TopicExpressionEngine
Resolves a topic expression using the passed topic list. The appropraite TopicExpressionEvaluator is used based on the dialect element.

Specified by:
evaluateTopicExpression in interface TopicExpressionEngine
Parameters:
topicSpaceSet - the topic list to apply the expression to
topicExpression - topic expression
Returns:
the set of topics the expression evaluated to
Throws:
TopicExpressionResolutionException - if the expression could not be evaluated
InvalidTopicExpressionException - if the topic expression is invalid
TopicPathDialectUnknownException - if the topic expression dialect is not supported
TopicExpressionException - if any other error occurs

getSupportedDialects

public java.lang.String[] getSupportedDialects()
Description copied from interface: TopicExpressionEngine
Returns a list of URIs representing the registered topic expression dialects

Specified by:
getSupportedDialects in interface TopicExpressionEngine
Returns:
the list of supported dialects


Copyright © 2004-2005 Apache Software Foundation. All Rights Reserved.