Hi Ram and Jay,
I noticed this too so I just created a RSCoreConnectAction class
(based upon your CoreConnectAction class) that uses an EDEF
template to connect to and import the ICore remote service.
To create the EDEF template, I added this code to the Core.class
in the activator, *before* the ICore remote service is registered
(line 257 and 258 on 2.2.1 branch):
//Setup RSA debug output
bundleContext.registerService(RemoteServiceAdminListener.class,new
DebugRemoteServiceAdminListener(), null);
With this in place, when the ICore remote service is registered in
the Core OSGi server the EDEF is output to System.out as below via
the DebugRemoteServiceAdminListener.
Once started on the host, I copied this EDEF and put it in a
template file named /edef/rscore.xml inside the
org.eclipse.ice.client bundle. When the
RSCoreConnectAction.run() method is invoked...see
RSCoreConnectAction.run()...the /edef/rscore.xml is read, the
user-provided hostname and port are substituted in the appropriate
endpoint description property, and then the
RemoteServiceAdmin.importService(endpointDescription) is called to
connect to the ICore remote host, and create and register the
ICore remote service proxy.
When this happens (inside the RSA.importService call), the client
has an ICore proxy in it's service registry and with DS it will
then be automatically injected. See the class RSCore.bindCore for
an example of having the ICore remote service injected by DS.
I'll be happy to put all this into a single patch, if that's how
you would prefer. Or if you would rather just take the
appropriate snippets that would be fine. Just let me know how you
would like to handle.
Note that currently the Core class exports via the ECF generic
provider (rather than r-osgi). It's not a big deal to change
both the remote service host and consumer to use either the r-osgi
provider, or other providers (e.g. the Jersey Jax-RS provider).
Have a good Thanksgiving.
Scott
EDEF System.out on host when ICore is registered and exported as
remote service:
<endpoint-descriptions
xmlns=
"http://www.osgi.org/xmlns/rsa/v1.0.0">
<endpoint-description>
<property name="
ecf.endpoint.id" value-type="String"
value="ecftcp://localhost:57072/server" />
<property name="ecf.endpoint.id.ns" value-type="String"
value="org.eclipse.ecf.core.identity.StringID" />
<property name="ecf.endpoint.ts" value-type="Long"
value="1479948680285" />
<property name="
ecf.rsvc.id" value-type="Long"
value="0" />
<property name="endpoint.framework.uuid"
value-type="String"
value="e052c618-e0b1-0016-1552-845201c2682d" />
<property name="
endpoint.id" value-type="String"
value="26d50b6b-bc66-4e04-91cf-dd656c8f7b56" />
<property name="
endpoint.service.id" value-type="Long"
value="0" />
<property name="objectClass" value-type="String">
<array>
<value>org.eclipse.ice.core.iCore.ICore</value>
</array>
</property>
<property name="remote.configs.supported"
value-type="String">
<array>
<value>ecf.generic.server</value>
</array>
</property>
<property name="remote.intents.supported"
value-type="String">
<array>
<value>passByValue</value>
<value>exactlyOnce</value>
<value>ordered</value>
</array>
</property>
<property name="service.imported" value-type="String"
value="true" />
<property name="service.imported.configs"
value-type="String">
<array>
<value>ecf.generic.server</value>
</array>
</property>
</endpoint-description>
</endpoint-descriptions>