On 11/30/2016 2:47 PM, Ramachandran K.
Narayanan wrote:
Hello Jay, Scott,
So I have been able to re-enable the button based on
modifications to plugin.xml. My
changes are outlined at
I have some doubts on how I can connect the Client to the
Core.
1) I see that RSCore stores an instance of the
RemoteServiceAdmin, through bindRemoteServiceAdmin
which is annotated with @Reference.
I have tried looking it up, but it's not clear what the
annotation does and when the bindRemoteService
is called.
This is a Declarative Services annotation (along with the @Component
at top). What the @Reference does is say (to the Service Component
Runtime) that the RSCore component requires a reference to an
instance of RemoteServiceAdmin to be activated. The
annotation...along with the Eclipse Neon DS annotation support
turned on should result in an xml file being created in the OSGI-INF
directory when the RSCore class is saved.
At ICE client startup, the RemoteServiceAdmin instance is/should be
created on startup (by ECF), and the instance then injected
(bindRemoteServiceAdmin called by DS). If this is not happening
for some reason (bindRemoteServiceAdmin not called), then you should
make sure that a) the ECF Remote Services SDK is installed, and b)
the org.eclipse.ecf.osgi.services.remoteserviceadmin bundle is
autostarted. Also c) that the RSCore xml file is present and that
in the META-INF/MANIFEST.MF is: Service-Component: <rscore xml
file>
For example usage of @Reference annotations in SCR see:
https://kishanthan.wordpress.com/2014/03/29/using-annotation-with-osgi-declarative-services/
2) The current changes in Core do not use DS. I can migrate
it later to use DS eventually, but without DS how can I still
obtain an instance of the RSA to store as part of the Core
class?
You should also be able to get an instance of RemoteServiceAdmin
using a ServiceTracker, but I see that DS is used elsewhere in the
ICE Client so I would recommend going the DS route, as it's easier,
more flexible and more dynamic than using ServiceTracker. But if
you would like help with the use of ServiceTracker please let me
know and I'll produce a code snippet.
Scott
|