Hi,
going back to scripted process status handling, I was looking at the ProgressListener interface,
and… well, it sort of pains me to pass that to scripts, since it’s really more complex than it should
be.
How about the following object, that would wrap a ProgressListener, instead?
public class ProcessStatus {
ProgressListener listener;
public ProcessStatus(ProgressListener listener) {
super();
this.listener = listener;
}
public ProgressListener getListener() {
return listener;
}
public void setStatus(float progress) {
listener.progress(progress);
}
public void setTask(String status) {
listener.setTask(Text.text(status));
}
public void throwException(String message) {
throw new WPSException(message);
}
public void throwException(String message, String code) {
throw new WPSException(code, message);
}
public void throwException(String message, String code, String locator) {
throw new WPSException(message, code, locator);
}
}
It’s as simple as possible, and does everything that WPS cares for.
Just wondering if having overloaded methods for throwException might cause issues with
scripting languages.
And oh, the exception being thrown inside throwException in the real implementation
might be one of those that directly set message, code and locator in the
generated OGC exception report, if the process wants to use a normal output
I guess it could just use its own native exception throwing right?
Let me know how it looks.
Cheers
Andrea
–
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.
==
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it