|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RemoteOSGiService
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.
Field Summary | |
---|---|
static String |
INJECTIONS
For special purposes, the service can decide to inject other classes into the proxy bundle that is dynamically created on the client side. |
static String |
PRESENTATION
property for registration of a service UI component that gived the user a presentation of the service. |
static String |
R_OSGi_REGISTRATION
this property has to be set in order to release a service for remote access. |
static String |
SERVICE_PROXY_POLICY
Deprecated. With the new model, service proxies is the only supported policy. Any value set to the R_OSGi_REGISTRATION policy will have the effect of SERVICE_PROXY_POLICY; |
static String |
SERVICE_URI
the property key for the host name of the remote service. |
static String |
SMART_PROXY
Can be set to use a smart proxy. |
Method Summary | |
---|---|
RemoteServiceReference[] |
connect(URI endpoint)
connect to a remote OSGi framework. |
void |
disconnect(URI endpoint)
disconnect from a connected host. |
ChannelEndpointManager |
getEndpointManager(URI remoteEndpointAddress)
get the endpoint manager for a channel to a given remote peer. |
Object |
getRemoteService(RemoteServiceReference ref)
get the a remote service. |
RemoteServiceReference |
getRemoteServiceReference(URI serviceURI)
get a remote service reference for a given URI. |
RemoteServiceReference[] |
getRemoteServiceReferences(URI endpointAddress,
String clazz,
Filter filter)
get remote service references for all services on a certain peer that match the given criteria. |
void |
ungetRemoteService(RemoteServiceReference remoteServiceReference)
unget the service. |
Field Detail |
---|
static final String R_OSGi_REGISTRATION
static final String SERVICE_PROXY_POLICY
static final String SMART_PROXY
static final String INJECTIONS
Class
objects.
static final String PRESENTATION
org.service.proposition.remote.ServiceUIComponent
. When
this property is set, the presentation is injected into the bundle and
the R-OSGi ServiceUI can display the presentation when the service is
discovered.
static final String SERVICE_URI
Method Detail |
---|
RemoteServiceReference[] connect(URI endpoint) throws RemoteOSGiException
endpoint
- the endpoint to connect to.
RemoteOSGiException
- in case of connection errors.void disconnect(URI endpoint) throws RemoteOSGiException
endpoint
- the URI of the remote host.
RemoteOSGiException
- if something goes wrong.RemoteServiceReference getRemoteServiceReference(URI serviceURI)
serviceURI
- the uri of the service. Has to be a channel URI including a
fragment, which is the service ID on the other peer.
null
, if the
service is not present.RemoteServiceReference[] getRemoteServiceReferences(URI endpointAddress, String clazz, Filter filter)
endpointAddress
- the URI of the peer.clazz
- a service interface class, or null
for all
services.filter
- a filter string, or null
null
if
no services match.Object getRemoteService(RemoteServiceReference ref)
ref
- the remote service reference.
void ungetRemoteService(RemoteServiceReference remoteServiceReference)
getRemoteService(RemoteServiceReference)
again.
remoteServiceReference
- thre remote service reference.ChannelEndpointManager getEndpointManager(URI remoteEndpointAddress)
remoteEndpointAddress
- the endpoint address of the remote peer.
null
if no such channel
exists.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |