Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[udig-devel] IService is this thing loaded?

Forgot one - a request was made to check if the Service was loaded .... This can already be accomplished with the IService.getStatus() method.

DataStore data;
if( service.getStatus() == IResolve.Status.CONNECTED){
data = service.resolve( DataStore.class, null ); // should not be a long delay ...
}
else if ( service.getStatus() == IResolve.Status.NOTCONNECTED ){
      ProgressMonitor monitor = new SomeKindOfUserVisibleProgressMonitor();
data = service.resolve( DataStore.class, null ); // should not be a long delay ...
}
else {
     // you are in trouble either BROKEN or RESTRICTED_ACCESS!!
     // maybe prompt the user to fix the problem?
}


Back to the top