Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ptp-dev] Converting a plug-in to use remote resources

Hi Beth,

The best consolidated source of information I have on the subject is a excerpt (below) from a response Greg sent me on ptp-dev (August, 2010) to get started remote enabling GEM. It was everything I needed. Thanks once again Greg.

In my experience, the first step was definitely to convert our plugin to the EFS (Eclipse File System) e.g.
replacing all references to  java.io.File and using the IResource Interface ( getLocationURI() will become your best friend here ). Then use the abstract interfaces in org.eclipse.ptp.remote.core for remote file manipulation, etc.

-Alan


----------------------
from Greg Watson:
----------------------------------------
There are two main approaches to remote enabling your plugin, depending on what you need to do: 

a) If you need to run remote processes, manipulate remote files directly, etc., then you should start by looking at the APIs provided by org.eclipse.ptp.remote.core and org.eclipse.ptp.remote.ui (described below). 

b) If you need to access files in a remote project (i.e. one set up using RDT), then you should always use the IResource interfaces for file manipulation and never use java.io.File (you should never use java.io.File inside Eclipse anyway). If you use IResource then you can treat local and remote files in exactly the same manner as the EFS layer will hide everything from you. See the org.eclipse.core.resource documentation for more information.

You may also use a combination of both (a) and (b).

in PTP, the org.eclipse.ptp.remote.core plugin provides a range of abstract interfaces for manipulating remote "things":

IRemoteConnection - an abstract remote connection. Provides methods to open/close the connection, forward ports (aka tunneling), get the environment, get/set the working directory, etc.
IRemoteProcess - an abstract remote process created by IRemoteProcessBuilder. Provides methods for getting the stdin, stdout and stderr streams. An IRemoteProcess is created using the IRemoteProcessBuilder interface
IFileStore - an abstract remote file (provided by EFS). Has methods for file manipulation and obtaining input and output streams. An IFileStore is created using the IRemoteFileManager interface, or can be obtained directly from EFS if you know the URI.

There are also a range of interfaces and classes for UI related activities in org.eclipse.ptp.remote.ui. For example, there's a file browser for accessing files on the remote system.

These APIs work with either Remote Tools (which is a light-weight SSH provider in PTP) or with RSE (heavy weight provider that supports other protocols such as dstore and ftp).
----------------------------------------





On 8/8/2011 7:35 PM, Beth Tibbitts wrote:

We started some notes on this subject last fall which I transcribed from an initial meeting at
http://wiki.eclipse.org/PTP/designs/remote/using

But never got much further...
Since Renato is asking me some questions about this, I thought we ought to document it somewhere such that the next person can find it too.

Alan and Wyatt, you have worked on converting your projects recently, can you take a look and add your
own pointers to the above wiki page, of what you have to do to convert a project to work on remote resources?  I am rusty...

I remember a first step as removing references to e.g.  java.io.File  and replacing them with EFS (Eclipse File System)
generic classes such as org.eclipse.core.resources.IFile
I added some references to some EFS articles to the bottom of the above page (Thanks, Wyatt)

Greg, I think you did some work to use paths represented as remotelocation/path/to/File.ext sort of representation
as URIs (http://en.wikipedia.org/wiki/Uniform_Resource_Identifier).  Am I remembering this right?
So there was a method about getting the path from an IResource that we used instead of getPath() or something...
If you remind me, I'll add something to the wiki page above if you don't want to.



...Beth

Beth Tibbitts
Eclipse Parallel Tools Platform  http://eclipse.org/ptp
IBM STG - High Performance Computing Tools
Mailing Address:  IBM Corp., 745 West New Circle Road, Lexington, KY 40511

_______________________________________________ ptp-dev mailing list ptp-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/ptp-dev

Back to the top