private RuntimeException failure;
private final RemoteLoggerServiceAsync service;
public RemoteLogger() {
service = (RemoteLoggerServiceAsync) GWT.create(RemoteLoggerService.class);
final ServiceDefTarget target = (ServiceDefTarget) service;
target.setServiceEntryPoint(GWT.getModuleBaseURL() + "gwt-log");
callback = new AsyncCallback<Object>() {
public void onFailure(Throwable ex) {
if (failure == null) {
failure = new RuntimeException(
"Remote logging will be suspended due to communication failure with "
+ service.getClass().getName() + " at " + target.getServiceEntryPoint(), ex);
}
}
public void onSuccess(Object result) {
}