Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ptp-dev] How do I access existing project using RDT?

An easier way would be like this:

URI uri = project.getLocationURI();
IRemoteServices services = PTPRemoteCorePlugin.getRemoteServices(uri);
IRemoteConnection connection = services.getConnectionManager().getConnection(uri);
IRemoteProcessBuilder builder = services.getProcessBuilder(connection, command);

Cheers,
Greg

On Sep 29, 2011, at 8:24 PM, Chris Recoskie wrote:

You want to do something like this (from RemoteMakeBuilder):

ServiceModelManager smm = ServiceModelManager.getInstance();

try{
IServiceConfiguration serviceConfig = smm.getActiveConfiguration(getProject());
IService buildService = smm.getService(IRDTServiceConstants.SERVICE_BUILD);
IServiceProvider provider = serviceConfig.getServiceProvider(buildService);
IRemoteExecutionServiceProvider executionProvider = null;
if(provider instanceof IRemoteExecutionServiceProvider) {
executionProvider = (IRemoteExecutionServiceProvider) provider;
}

IRemoteServices remoteServices = executionProvider.getRemoteServices();

if (remoteServices == null)
return false;

if(!remoteServices.isInitialized()) {
remoteServices.initialize();
}

if (remoteServices == null)
return false;

IRemoteConnection connection = executionProvider.getConnection();

if(connection == null)
return false;

if(!connection.isOpen())
connection.open(monitor);

IRemoteProcessBuilder processBuilder = remoteServices.getProcessBuilder(connection, command);

===========================
Chris Recoskie
Team Lead, IBM CDT and RDT
IBM Toronto

<graycol.gif>Jeff Johnston ---09/29/2011 03:15:00 PM---Could someone explain the usual sequence for getting RDT interfaces for an existing project (remote

<ecblank.gif>
From:
<ecblank.gif>
Jeff Johnston <jjohnstn@xxxxxxxxxx>
<ecblank.gif>
To:
<ecblank.gif>
ptp-dev@xxxxxxxxxxx
<ecblank.gif>
Date:
<ecblank.gif>
09/29/2011 03:15 PM
<ecblank.gif>
Subject:
<ecblank.gif>
[ptp-dev] How do I access existing project using RDT?
<ecblank.gif>
Sent by:
<ecblank.gif>
ptp-dev-bounces@xxxxxxxxxxx





Could someone explain the usual sequence for getting RDT interfaces for
an existing project (remote or local)?

What I want to do is: starting from an IProject, get an
IRemoteFileManager and an IRemoteProcessBuilder for that project (either
local or remote depending on the project).

It is not clear from the APIs how to do this.

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


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


Back to the top