Interface IDiscoveredEndpointDescriptionFactory
- All Known Implementing Classes:
DiscoveredEndpointDescriptionFactory
DiscoveredEndpointDescription
s. A discovered
endpoint description factory is used by a EndpointDescriptionLocator
to convert a service info (discovered by the locator) into a discovered
endpoint description (instance of DiscoveredEndpointDescription). This
discovered endpoint description is then used by the
EndpointDescriptionLocator
to notify endpoint description listeners
as per section 122.6 of the OSGi Enterprise
Specification OSGi enterprise specification.
If no other instances of this service have been registered, a default
instance of DiscoveredEndpointDescriptionFactory
will be used by the
EndpointDescriptionLocator
. Note that this default instance is
registered with the lowest possible priority, so that if other
IDiscoveredEndpointDescriptionFactory
instances are registered, they
will be preferred/used over the default. This means that those wishing to
customize/control this process of converting IServiceInfo
s to
DiscoveredEndpointDescription
must
create their own implementation of
IDiscoveredEndpointDescriptionFactory
and register it with the OSGi service registry with a priority
({org.osgi.framework.Constants#SERVICE_RANKING}) higher than
Integer.MIN_VALUE
Then at runtime, when needed by the EndpointDescriptionLocator
, the
new discovered endpoint description factory will be used.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptioncreateDiscoveredEndpointDescription
(IDiscoveryLocator locator, IServiceInfo discoveredServiceInfo) Create an EndpointDescription for a discovered remote service.void
Remove all DiscoveredEndpointDescription from this factory.removeDiscoveredEndpointDescription
(IDiscoveryLocator locator, IServiceID serviceID) Remove an EndpointDescription for a previously discovered remote service.boolean
removeDiscoveredEndpointDescription
(EndpointDescription endpointDescription) Remove the DiscoveredEndpointDescription associated with the given endpointDescription.
-
Method Details
-
createDiscoveredEndpointDescription
DiscoveredEndpointDescription createDiscoveredEndpointDescription(IDiscoveryLocator locator, IServiceInfo discoveredServiceInfo) Create an EndpointDescription for a discovered remote service. Implementers of this factory service may return the type of EndpointDescription appropriate for the associated distribution system (e.g. ECFEndpointDescription). Implementers should returnnull
if no notification should occur.- Parameters:
locator
- the locator responsible for the discoveredServiceInfo. Must not benull
.discoveredServiceInfo
- the discovered service info. Must not benull
.- Returns:
- DiscoveredEndpointDescription that will be used to notify
EndpointListeners about a new EndpointDescription. If
null
is returned, no notification should be performed by the calling code.
-
removeDiscoveredEndpointDescription
DiscoveredEndpointDescription removeDiscoveredEndpointDescription(IDiscoveryLocator locator, IServiceID serviceID) Remove an EndpointDescription for a previously discovered remote service. Implementers of this factory service may return the type of EndpointDescription appropriate for the associated distribution system (e.g. ECFEndpointDescription). Implementers should returnnull
if no notification should occur.- Parameters:
locator
- the locator responsible for the discoveredServiceInfo. Must not benull
.serviceID
- the discovered service ID. Must not benull
.- Returns:
- EndpointDescription that will be used to notify EndpointListeners
about an undiscovered EndpointDescription. If
null
is returned, no notification should be performed by the calling code.
-
removeDiscoveredEndpointDescription
Remove the DiscoveredEndpointDescription associated with the given endpointDescription.- Parameters:
endpointDescription
- that was previously associated with a DiscoveredEndpointDescription (viacreateDiscoveredEndpointDescription(IDiscoveryLocator, IServiceInfo)
to be removed. Must not benull
.- Returns:
true
if actually removed,false
if nothing was removed.
-
removeAllDiscoveredEndpointDescriptions
void removeAllDiscoveredEndpointDescriptions()Remove all DiscoveredEndpointDescription from this factory.
-