use of org.eclipse.ecf.examples.remoteservices.common.IRemoteEnvironmentInfo in project ecf by eclipse.
the class Lab1Action method run.
/**
* The action has been activated. The argument of the
* method represents the 'real' action sitting
* in the workbench UI.
* @see IWorkbenchWindowActionDelegate#run
*/
public void run(IAction action) {
try {
IRemoteServiceContainerAdapter adapter = getContainerAdapter();
// Create target ID
String target = TARGET;
ID targetID = createTargetID(container, target);
// Get and resolve remote service reference
IRemoteServiceReference[] ref = adapter.getRemoteServiceReferences(targetID, org.eclipse.ecf.examples.remoteservices.common.IRemoteEnvironmentInfo.class.getName(), null);
IRemoteService svc = adapter.getRemoteService(ref[0]);
// get proxy
IRemoteEnvironmentInfo proxy = (IRemoteEnvironmentInfo) svc.getProxy();
// Call it!
String osArch = proxy.getOSArch();
// Show result
MessageDialog.openInformation(window.getShell(), "ECF Lab 1", "Target " + target + " has OS Arch=" + osArch);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
Aggregations