Fires QUERY_COMPLETED or QUERY_ERROR at the end of the execution of the ContactQueries of the Address Books of Microsoft Outlook and Mac OS X.

cusax-fix
Lyubomir Marinov 15 years ago
parent df402569d0
commit cffa8dc40c

@ -155,16 +155,19 @@ public synchronized void start()
@Override
public void run()
{
boolean completed = false;
try
{
AsyncContactQuery.this.run();
completed = true;
}
finally
{
synchronized (AsyncContactQuery.this)
{
if (thread == Thread.currentThread())
stopped();
stopped(completed);
}
}
}
@ -179,8 +182,14 @@ public void run()
/**
* Notifies this <tt>AsyncContactQuery</tt> that it has stopped performing
* in the associated background <tt>Thread</tt>.
*
* @param completed <tt>true</tt> if this <tt>ContactQuery</tt> has
* successfully completed, <tt>false</tt> if an error has been encountered
* during its execution
*/
protected void stopped()
protected void stopped(boolean completed)
{
if (getStatus() == QUERY_IN_PROGRESS)
setStatus(completed ? QUERY_COMPLETED : QUERY_ERROR);
}
}

@ -365,11 +365,21 @@ public boolean callback(long iUnknown)
* Notifies this <tt>AsyncContactQuery</tt> that it has stopped performing
* in the associated background <tt>Thread</tt>.
*
* @see AsyncContactQuery#stopped()
* @param completed <tt>true</tt> if this <tt>ContactQuery</tt> has
* successfully completed, <tt>false</tt> if an error has been encountered
* during its execution
* @see AsyncContactQuery#stopped(boolean)
*/
@Override
protected void stopped()
protected void stopped(boolean completed)
{
getContactSource().stopped(this);
try
{
super.stopped(completed);
}
finally
{
getContactSource().stopped(this);
}
}
}

Loading…
Cancel
Save