List Info

Thread: Re: Set daemon port programmatically




Re: Set daemon port programmatically
country flaguser name
Austria
2008-04-22 10:36:58
Hi Denise,

You can look at our Unit Tests how to programmatically
create a connection:

   org.eclipse.rse.tests /
RSEBaseConnectionTestCase.getLinuxHost()

does the DStore thing. That also shows you how to avoid the
UI
prompt. For the Daemon Port specifically, see
RSEConnectionManager
line 256ff:

IConnectorService cs =
connection.getConnectorServices()[0];
IServerLauncherProperties p =
cs.getRemoteServerLauncherProperties();
if (p instanceof IRemoteServerLauncher) {
     IRemoteServerLauncher launcher =
(IRemoteServerLauncher) p;
     launcher.setDaemonPort(daemonPortNum);
}

Xuan or DaveM might know more, if you ask on the Mailing
List.

Cheers,
--
Martin Oberhuber, Senior Member of Technical Staff, Wind
River
Target Management Project Lead, DSDP PMC Member
http://www.eclipse.org
/dsdp/tm




Denise Schmidt wrote:
> I am using RSE 2.0.3.  I have written some plug in code
to add a button 
> to create a connection to a specific Unix machine.  The
code I have 
> appears to take all the default values when creating
the connection.  
> What I'd like to know is how do I change the default
port used to 
> connect to the server daemon in my code?  Here's what I
have to create 
> the connection:
> 
> ISystemRegistry registry =
RSECorePlugin.getTheSystemRegistry();
> 
> ISystemProfile profile = 
>
registry.getSystemProfileManager().getDefaultPrivateSystemPr
ofile();
> 
> String hostName =
"eddea03.rck.atm.lmco.com";
> 
> IHost host = registry.getHost(profile, hostName);
> if (host == null) {
>    IRSESystemType sysType =
RSECorePlugin.getTheCoreRegistry()
>    
.getSystemTypeById("org.eclipse.rse.systemtype.unix&quo
t;);
>    host = registry.createHost(sysType,
>     hostName,
>     hostName,
>     "Connection to Unix machine");
> }
> 
> I've been searching the web and looking through RSE
code but haven't 
> found how to set the daemon port to something other
than 4075. 
> While I'm at it, my code doesn't actually connect all
the way to the 
> server as I don't get prompted for a user ID and
password until I try to 
> expand my home directory.  I must be missing an
additional call to 
> complete the connection but I'm not sure what it is.
> 
> Thanks for any help.
> 
> 
_______________________________________________
dsdp-tm-dev mailing list
dsdp-tm-deveclipse.org

https://dev.eclipse.org/mailman/listinfo/dsdp-tm-dev

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )