org.apache.ws.resource.properties.query.impl
Class QueryEngineImpl

java.lang.Object
  extended byorg.apache.ws.resource.properties.query.impl.QueryEngineImpl
All Implemented Interfaces:
QueryEngine

public class QueryEngineImpl
extends java.lang.Object
implements QueryEngine

LOG-DONE Executes queries on resource property sets. The engine looks for evaluators under the "wsrf/query/eval" JNDI context.

See Also:
ResourcePropertySet

Field Summary
static Messages MSG
           
 
Constructor Summary
QueryEngineImpl()
          Creates a new QueryEngineImpl object.
 
Method Summary
 java.lang.Object executeQuery(QueryExpression queryExpr, java.lang.Object evalContext)
          Evaluates the expression over the specified context object and returns the result.
 java.lang.Object executeQuery(QueryExpression queryExpr, ResourcePropertySet resourcePropertySet)
          Executes a query against a resource property set.
 ExpressionEvaluator getEvaluator(java.net.URI dialect)
          Gets the evaluator currently registered to handle an expression of the specified qualified name (from the top level element of the XML Schema definition of the expression)
 void refresh()
          Reinitializes the evaluators list from JNDI context.
 void registerEvaluator(ExpressionEvaluator evaluator)
          DOCUMENT_ME
 void registerEvaluator(java.net.URI dialect, ExpressionEvaluator evaluator)
          Registers a query expression evaluator for handling query expressions in specified dialect.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MSG

public static final Messages MSG
Constructor Detail

QueryEngineImpl

public QueryEngineImpl()
Creates a new QueryEngineImpl object.

Method Detail

getEvaluator

public ExpressionEvaluator getEvaluator(java.net.URI dialect)
Description copied from interface: QueryEngine
Gets the evaluator currently registered to handle an expression of the specified qualified name (from the top level element of the XML Schema definition of the expression)

Specified by:
getEvaluator in interface QueryEngine
Parameters:
dialect -
Returns:

executeQuery

public java.lang.Object executeQuery(QueryExpression queryExpr,
                                     ResourcePropertySet resourcePropertySet)
                              throws UnknownQueryExpressionDialectException,
                                     QueryEvaluationErrorException,
                                     InvalidQueryExpressionException
Description copied from interface: QueryEngine
Executes a query against a resource property set. The appropriate ExpressionEvaluator is used for the evalution based on the dialect attribute.

Specified by:
executeQuery in interface QueryEngine
Parameters:
queryExpr - a query expression
resourcePropertySet - the resource properties set to evluate the query expression against
Returns:
the result of the evaluation which depends on the expression. The results must be an xml serializable object in order to be passed back correctly to a remote client. The easiest way of achieving this is to model it as a Bean, or simply return a SOAPElement or DOM Element. If the result object returned is null an empty query result is returned.
Throws:
InvalidQueryExpressionException - if query expression is invalid
QueryEvaluationErrorException - if query evaluation fails
UnknownQueryExpressionDialectException - if query dialect is unsupported
See Also:
QueryEngine.executeQuery(org.apache.ws.resource.properties.query.QueryExpression, org.apache.ws.resource.properties.ResourcePropertySet)

executeQuery

public java.lang.Object executeQuery(QueryExpression queryExpr,
                                     java.lang.Object evalContext)
                              throws UnknownQueryExpressionDialectException,
                                     QueryEvaluationErrorException,
                                     InvalidQueryExpressionException
Description copied from interface: QueryEngine
Evaluates the expression over the specified context object and returns the result. The appropriate ExpressionEvaluator is used for the evaluation based on the dialect attribute.

Specified by:
executeQuery in interface QueryEngine
Parameters:
queryExpr - a query expression
evalContext - the context to evaluate the query expression against
Returns:
the result of the evaluation which depends on the expression. The results must be an xml serializable object in order to be passed back correctly to a remote client. The easiest way of achieving this is to model it as a Bean, or simply return a SOAPElement or DOM Element. If the result object returned is null an empty query result is returned.
Throws:
UnknownQueryExpressionDialectException - if query dialect is unsupported
InvalidQueryExpressionException - if query expression is invalid
QueryEvaluationErrorException - if query evaluation fails
See Also:
QueryEngine#executeQuery(org.apache.ws.resource.properties.query.QueryExpression, Object)}

refresh

public void refresh()
Reinitializes the evaluators list from JNDI context. If any evaluators were added using registerEvaluator() function they will be lost.


registerEvaluator

public void registerEvaluator(ExpressionEvaluator evaluator)
DOCUMENT_ME

Specified by:
registerEvaluator in interface QueryEngine
Parameters:
evaluator - DOCUMENT_ME

registerEvaluator

public void registerEvaluator(java.net.URI dialect,
                              ExpressionEvaluator evaluator)
                       throws UnknownQueryExpressionDialectException
Description copied from interface: QueryEngine
Registers a query expression evaluator for handling query expressions in specified dialect.

Specified by:
registerEvaluator in interface QueryEngine
Parameters:
dialect -
evaluator -
Throws:
UnknownQueryExpressionDialectFaultException
UnknownQueryExpressionDialectException - if the evaluator does not supoport the specified dialect


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