RemoteOSGiService provides transparent access to services on remote service platforms. It uses SLP as underlying discovery protocol. Local services can be registered for remoting, applications can register listeners for ServiceTypes
to be informed whenever matching services have been discovered.
As soon as a service has been discovered and the listener has been informed, the application can fetch the service. In the default case, the service interface is transferred to the receiving peer together with an optional smart proxy class and optional injections. The service then builds a proxy bundle and registers it with the local framework so that the application can get a service reference as if the service was local. Internally, all methods of the service interface are implemented as remote method calls.
Services can define smart proxies to move some parts of the code to the client. This is done by an abstract class. All implemented method will be executed on the client, abstract methods will be implemented by remote method calls. Moving parts of the code to the client can be useful for saving service provider platform's resources.
Injections are used if the service interface uses classes as method arguments that are not expected to be present on client side. These classes will be automatically injected into the proxy bundle. The registrator can manually inject additional classes.
With version 0.5, there is also the possibility to register a service with the MIGRATE_BUNDLE policy. In this case, the bundle that provides the service is moved to the requesting peer.
@author Jan S. Rellermeyer, ETH Zurich @since 0.1
|
|