[Mulgara-svn] r411 - branches/mgr-69/src/jar/resolver/java/org/mulgara/resolver
andrae at mulgara.org
andrae at mulgara.org
Mon Sep 10 09:12:36 UTC 2007
Author: andrae
Date: 2007-09-10 04:12:35 -0500 (Mon, 10 Sep 2007)
New Revision: 411
Modified:
branches/mgr-69/src/jar/resolver/java/org/mulgara/resolver/LocalQuery.java
branches/mgr-69/src/jar/resolver/java/org/mulgara/resolver/LocalQueryResolver.java
Log:
Finished decoupling LocalQuery and LocalQueryResolver. Now beyond a single call
to create a LQR from LQ there is no reference to either file from the other.
Modified: branches/mgr-69/src/jar/resolver/java/org/mulgara/resolver/LocalQuery.java
===================================================================
--- branches/mgr-69/src/jar/resolver/java/org/mulgara/resolver/LocalQuery.java 2007-09-10 08:59:57 UTC (rev 410)
+++ branches/mgr-69/src/jar/resolver/java/org/mulgara/resolver/LocalQuery.java 2007-09-10 09:12:35 UTC (rev 411)
@@ -193,11 +193,6 @@
}
- Tuples resolveCT(Constraint constraint) throws QueryException {
- return context.resolve(constraint);
- }
-
-
/**
* @return the solution to this query
* @throws QueryException if resolution can't be obtained
@@ -350,9 +345,8 @@
ConstraintExpression constraintExpression)
throws QueryException
{
- QueryEvaluationContext context = new LocalQueryResolver(this, resolverSession);
-
- return ConstraintOperations.resolveConstraintExpression(context, modelExpression, constraintExpression);
+ return ConstraintOperations.resolveConstraintExpression(
+ new LocalQueryResolver(context, resolverSession), modelExpression, constraintExpression);
}
Modified: branches/mgr-69/src/jar/resolver/java/org/mulgara/resolver/LocalQueryResolver.java
===================================================================
--- branches/mgr-69/src/jar/resolver/java/org/mulgara/resolver/LocalQueryResolver.java 2007-09-10 08:59:57 UTC (rev 410)
+++ branches/mgr-69/src/jar/resolver/java/org/mulgara/resolver/LocalQueryResolver.java 2007-09-10 09:12:35 UTC (rev 411)
@@ -93,32 +93,20 @@
/** Logger. */
private static final Logger logger = Logger.getLogger(LocalQueryResolver.class.getName());
- private LocalQuery localQuery;
+ private DatabaseOperationContext operationContext;
private ResolverSession resolverSession;
//
// Constructor
//
-
- /**
- * Construct a database.
- *
- * @param localQuery the query to localize
- * @param resolverSession the database session to localize the
- * <var>localQuery</var> against
- * @throws IllegalArgumentException if <var>query</var> or
- * <var>resolverSession</var> are <code>null</code>
- * @throws LocalizeException if the <var>query</var> can't be localized
- */
- LocalQueryResolver(LocalQuery localQuery, ResolverSession resolverSession) {
- // Validate "query" parameter
- if (localQuery == null) {
- throw new IllegalArgumentException("Null 'localQuery' parameter");
+ LocalQueryResolver(DatabaseOperationContext operationContext, ResolverSession resolverSession) {
+ if (operationContext == null) {
+ throw new IllegalArgumentException("Null 'operationContext' parameter");
}
// Initialize fields
- this.localQuery = localQuery;
+ this.operationContext = operationContext;
this.resolverSession = resolverSession;
}
@@ -462,7 +450,7 @@
localize(new URIReferenceImpl(modelResource.getURI())), localized);
}
- Tuples result = localQuery.resolveCT(localized);
+ Tuples result = operationContext.resolve(localized);
return result;
} catch (LocalizeException e) {
More information about the Mulgara-svn
mailing list