Update of /cvsroot/metamorphosis/ruper2/src/java/core/org/krysalis/ruper2/query
In directory sc8-pr-cvs1:/tmp/cvs-serv11075/src/java/core/org/krysalis/ruper2/query
Modified Files:
ResourceResultHelper.java DefaultQueryEngine.java
Log Message:
Reworked monitor interface (thanks for the ideas Anou) and made statistics
monitoring try to answer some questions about groups for us.
Index: ResourceResultHelper.java
===================================================================
RCS file: /cvsroot/metamorphosis/ruper2/src/java/core/org/krysalis/ruper2/query/ResourceResultHelper.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ResourceResultHelper.java 12 Oct 2003 18:12:05 -0000 1.3
--- ResourceResultHelper.java 22 Oct 2003 21:53:25 -0000 1.4
***************
*** 54,57 ****
--- 54,78 ----
return list;
}
+
+ /**
+ * Get contents of all lists
+ *
+ * @param result
+ * @return
+ */
+ public static List getAllResources(ResourceResult result) {
+ List list = new ArrayList();
+
+ for (Iterator j = result.iterator(); j.hasNext();) {
+ List resources = (List) j.next();
+
+ for (Iterator i = resources.iterator(); i.hasNext();) {
+ list.add(i.next());
+ }
+ }
+
+ return list;
+ }
+
/**
Index: DefaultQueryEngine.java
===================================================================
RCS file: /cvsroot/metamorphosis/ruper2/src/java/core/org/krysalis/ruper2/query/DefaultQueryEngine.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** DefaultQueryEngine.java 22 Oct 2003 02:14:07 -0000 1.9
--- DefaultQueryEngine.java 22 Oct 2003 21:53:25 -0000 1.10
***************
*** 13,16 ****
--- 13,18 ----
import org.krysalis.ruper2.impl.RepositorySetWrapper;
import org.krysalis.ruper2.impl.RepositoryWrapper;
+ import org.krysalis.ruper2.monitor.Monitor;
+ import org.krysalis.ruper2.monitor.ResourceEvent;
import org.krysalis.ruper2.resource.Resource;
import org.krysalis.ruper2.resource.ResourceGroup;
***************
*** 89,92 ****
--- 91,104 ----
DebugUtils.printSeparator();
DebugUtils.dump("Final (Grouped/Ordered) Results", result);
+
+ for (Iterator i =
+ ResourceResultHelper.getResourceList(result).iterator();
+ i.hasNext();
+ ) {
+ Monitor.getMonitor().notify(
+ new ResourceEvent(
+ ResourceEvent.RESULT,
+ (Resource)i.next()));
+ }
}
***************
*** 138,143 ****
repo,
resourceGroup));
! }
! else {
Logger.getLogger().info(
Messages.getString(
--- 150,154 ----
repo,
resourceGroup));
! } else {
Logger.getLogger().info(
Messages.getString(
***************
*** 153,158 ****
}
}
! }
! catch (Exception e) {
String message =
Messages.getString(MessageConstants.LIST_FAILED);
--- 164,168 ----
}
}
! } catch (Exception e) {
String message =
Messages.getString(MessageConstants.LIST_FAILED);
***************
*** 179,183 ****
if (null != groupBy) {
!
// Sort by groupBy, to split into groups
//:TODO: If we sorted by a CominbationComparator
--- 189,193 ----
if (null != groupBy) {
!
// Sort by groupBy, to split into groups
//:TODO: If we sorted by a CominbationComparator
***************
*** 207,212 ****
currentResource = resource;
}
! }
! else {
// A single list (one group)...
result.add(allResults);
--- 217,221 ----
currentResource = resource;
}
! } else {
// A single list (one group)...
result.add(allResults);
-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program.
Do you like what SourceForge.net is doing for the Open
Source Community? Make a contribution, and help us add new
features and functionality. Click here: http://sourceforge.net/donate/
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.