blob: 0b392fb2fd919e53ccaaddae7e406f7d2d854de5 [file] [log] [blame]
/*******************************************************************************
* Copyright © 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*
*******************************************************************************/
package client.handlers;
import org.eclipse.edt.rui.infobus.InfoBus;
import org.eclipse.edt.rui.widgets.TextArea;
import org.eclipse.edt.rui.widgets.TextField;
import common.Constants;
import common.ServiceInfoRecord;
import eglx.http.HttpProxy;
import eglx.http.IHttp;
import eglx.services.ServiceInvocationException;
import server.ServerInfo;
// basic library
handler ServerInfoHandler
function getServerInfo()
call ServerInfo.getServerAddress() using new HttpProxy("server.ServerInfo") returning to handleGetServerInfoResponse onException handleException;
end
function handleGetServerInfoResponse(retResult ServiceInfoRecord in)
InfoBus.publish(Constants.INFOBUS_EVENT_SERVERINFO, retResult);
end
function handleException(exp AnyException in, http IHTTP)
exceptionDisplay ExceptionDisplay{
ExceptionField.text = exp.message,
RawRequestField.text = http.getRequest().body,
RawResponseField.text = http.getResponse().body
};
if(exp isa ServiceInvocationException)
exceptionDisplay.Detail1Field.text = (exp as ServiceInvocationException).detail1;
exceptionDisplay.Detail2Field.text = (exp as ServiceInvocationException).detail2;
exceptionDisplay.Detail3Field.text = (exp as ServiceInvocationException).detail3;
end
InfoBus.publish(Constants.INFOBUS_EVENT_SERVICEINVOCATIONEXCEPTION, exceptionDisplay);
end
end