Interface IServiceInfoFactory
-
- All Known Implementing Classes:
ServiceInfoFactory
public interface IServiceInfoFactory
Service info factory service contract. A service info factory is used to convertEndpointDescription
s toIServiceInfo
instances (via createServiceInfo. The resulting IServiceInfo instances are then used to publish the EndpointDescription metadata to aIDiscoveryAdvertiser
.If no other instances of this service have been registered, a default instance of
ServiceInfoFactory
will be used. Note that this default instance is registered with the lowest possible priority, so that if otherIServiceInfoFactory
instances are registered, they will be preferred/used over the default. This means that Those wishing to customize/control this process of convertingEndpointDescription
s toIServiceInfo
must- create their own implementation of
IServiceInfoFactory
- register it with the OSGi service registry with a priority
({org.osgi.framework.Constants#SERVICE_RANKING}) higher than
Integer.MIN_VALUE
- See Also:
IDiscoveredEndpointDescriptionFactory
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IServiceInfo
createServiceInfo(IDiscoveryAdvertiser advertiser, EndpointDescription endpointDescription)
Create an service info instance to represent the given endpointDescription for discovery using the given discovery advertiser.
-
-
-
Method Detail
-
createServiceInfo
IServiceInfo createServiceInfo(IDiscoveryAdvertiser advertiser, EndpointDescription endpointDescription)
Create an service info instance to represent the given endpointDescription for discovery using the given discovery advertiser.- Parameters:
advertiser
- the advertiser to use for creating the service info result. Must not benull
.endpointDescription
- the endpoint description that the service info is to represent. Must not benull
.- Returns:
- IServiceInfo to use to publish the endpointDescription for
discovery (via
IDiscoveryAdvertiser.registerService(IServiceInfo)
. If a service info instance has previously been created for the given endpointDescription by this service info factory, then that serviceInfo will be returned in favor of creating a new one. Otherwise, a new service info will be created and returned. If some error occurs in the creation of the serviceInfo,null
will be returned. - Since:
- 3.0
-
-