Look at the "processCountRequest" method of one of the
DataGeneratorWith* classes. It uses "setData" method of DataRequestMonitor to
set the count.
I am looking at the example code "SyncDataViewer" which is about DSF
Query object from the "Introduction to Programming vith DSF"
tutorial.
// Create the query object for reading data count.
Query<Integer> countQuery = new Query<Integer>() {
@Override
protected void execute(DataRequestMonitor<Integer> rm) {
fDataGenerator.getCount(rm);
}
};
// Submit the query to be executed. A query implements a runnable
// interface and it has to be executed in order to do its work.
ImmediateExecutor.getInstance().execute(countQuery);
int count = 0;
// Block until the query completes, which will happen when the request
// monitor of the execute() method is marked done.
try {
count = countQuery.get();
} catch (Exception e) {
// InterruptedException and ExecutionException can be thrown here.
// ExecutionException containing a CoreException will be thrown
// if an error status is set to the Query's request monitor.
return new Object[0];
}
I could not understand that how countQuery.get(); method gets the count value. Because in IDataGeneration interface getCount method returns void such as:
// Data access methods.
void getCount(DataRequestMonitor<Integer> rm);
--
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.