Class EndpointDescriptionLocator
java.lang.Object
org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescriptionLocator
- All Implemented Interfaces:
IEndpointDescriptionLocator
Implementation of EndpointDescription discovery mechanism, using any/all ECF
discovery providers (implementers if
IDiscoveryLocator.- Since:
- 4.8
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassclass -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voiddiscoverEndpoint(EndpointDescription endpointDescription) Discover the given endpointDescription.findOverrideProperties(Bundle bundle, URL edFileRUL) Find all override properties for given bundle at given fileURL.findProperties(Bundle bundle, URL edFileURL) Find all override properties for given bundle at given fileURL.Get endpoints discovered by this endpoint locatorgetMatchingEndpointEventListenerHolders(ServiceReference[] refs, EndpointDescription description, int type) getMatchingEndpointEventListenerHolders(EndpointDescription description, int type) getMatchingEndpointListenerHolders(ServiceReference[] refs, EndpointDescription description) getMatchingEndpointListenerHolders(EndpointDescription description) getNetworkDiscoveredServiceID(EndpointDescription endpointDescription) Get the service ID associated with the given endpoint description.protected URLgetPropsURL(URL url, String newPath) Get props url starting with given url with newPath rather than existing path.loadAndProcessProperties(Map<String, Object> props, URL url) Load and then process properties (merge with given props).protected EDEFPropertiesloadProperties(URL url) Load EDEF properties from given url.voidstart()voidundiscoverEndpoint(EndpointDescription endpointDescription) Remove the given endpointDescription.voidupdateEndpoint(EndpointDescription endpointDescription) Update the given endpointDescription.
-
Constructor Details
-
EndpointDescriptionLocator
-
-
Method Details
-
start
public void start() -
close
public void close() -
getDiscoveryAdvertisers
-
getServiceInfoFactory
-
getDiscoveredEndpointDescriptionFactory
-
getMatchingEndpointListenerHolders
protected EndpointDescriptionLocator.EndpointListenerHolder[] getMatchingEndpointListenerHolders(EndpointDescription description) -
getMatchingEndpointEventListenerHolders
protected EndpointDescriptionLocator.EndpointEventListenerHolder[] getMatchingEndpointEventListenerHolders(EndpointDescription description, int type) - Parameters:
description- descriptiontype- type- Returns:
- EndpointEventListenerHolder[] matching endpoint event listener holders
- Since:
- 4.1
-
getMatchingEndpointEventListenerHolders
public EndpointDescriptionLocator.EndpointEventListenerHolder[] getMatchingEndpointEventListenerHolders(ServiceReference[] refs, EndpointDescription description, int type) - Parameters:
refs- service referencesdescription- descriptiontype- type- Returns:
- EndpointEventListenerHolder[] matching endpoint event listener holders
- Since:
- 4.1
-
getMatchingEndpointListenerHolders
public EndpointDescriptionLocator.EndpointListenerHolder[] getMatchingEndpointListenerHolders(ServiceReference[] refs, EndpointDescription description) -
loadProperties
Load EDEF properties from given url. Provided url must not benull.- Parameters:
url- the URL to load the properties from.- Returns:
- EDEFProperties instance. Will not be
null. - Throws:
IOException- if properties cannot be read via EDEFProperties.load(InputStream)- Since:
- 4.8
-
loadAndProcessProperties
Load and then process properties (merge with given props).- Parameters:
props- the props to merge with. Should not benull.url- the URL to load properties from vialoadProperties(URL). May benull.- Returns:
- properties loaded and merged with provided props. Returns props unmodified if url is null or load exception.
- Since:
- 4.8
-
getPropsURL
Get props url starting with given url with newPath rather than existing path.- Parameters:
url- the based URL to start with. Uses proptocol, host, port. Must not benull.newPath- new path to use with given url to create and return new url. Must not benull.- Returns:
- url created from given url with newPath. Will be
nullif MalformedURLException thrown. - Since:
- 4.8
-
findOverrideProperties
Find all override properties for given bundle at given fileURL. Will load edef_defaults.properties files and edef_defaults-[value of system property: org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescriptionLocator.localPropertiesFile].properties.- Parameters:
bundle- the bundle responsible for the given fileURL. Must not benull.edFileURL- the file URL to load properties file(s) from. Must not benull.- Returns:
- Map<String,Object> containing all properties to override those in xml from edFileURL paths and edFileURL file name with .properties suffix.
- Since:
- 4.7
-
findProperties
Find all override properties for given bundle at given fileURL. Will load edef_defaults.properties files and edef_defaults-[value of system property: org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescriptionLocator.localPropertiesFile].properties.- Parameters:
bundle- the bundle responsible for the given fileURL. Must not benull.edFileURL- the file URL to load properties file(s) from. Must not benull.- Returns:
- Map<String,Object> containing all properties to override those in xml from edFileURL paths and edFileURL file name with .properties suffix.
- Since:
- 4.8
-
getNetworkDiscoveredServiceID
Description copied from interface:IEndpointDescriptionLocatorGet the service ID associated with the given endpoint description.- Specified by:
getNetworkDiscoveredServiceIDin interfaceIEndpointDescriptionLocator- Parameters:
endpointDescription- endpoint description- Returns:
- IServiceID associated discovered endpoint description. Will
return
nullif no associated serviceID - Since:
- 4.3
-
discoverEndpoint
Description copied from interface:IEndpointDescriptionLocatorDiscover the given endpointDescription. This method will not block and will result in local EndpointEventListeners to be notified that the given endpointDescription is discovered. about- Specified by:
discoverEndpointin interfaceIEndpointDescriptionLocator- Parameters:
endpointDescription- must not be null- Since:
- 4.3
-
updateEndpoint
Description copied from interface:IEndpointDescriptionLocatorUpdate the given endpointDescription. This method will not block and will result in local EndpointEventListeners to be notified that the given endpointDescription is updated. about- Specified by:
updateEndpointin interfaceIEndpointDescriptionLocator- Parameters:
endpointDescription- must not be null- Since:
- 4.3
-
undiscoverEndpoint
Description copied from interface:IEndpointDescriptionLocatorRemove the given endpointDescription. This method will not block and will result in local EndpointEventListeners to be notified that the given endpointDescription is removed. about- Specified by:
undiscoverEndpointin interfaceIEndpointDescriptionLocator- Parameters:
endpointDescription- must not be null- Since:
- 4.3
-
getDiscoveredEndpoints
Description copied from interface:IEndpointDescriptionLocatorGet endpoints discovered by this endpoint locator- Specified by:
getDiscoveredEndpointsin interfaceIEndpointDescriptionLocator- Returns:
- EndpointDescription[] of previously discovered endpoint. Will not return null, but may return empty array.
- Since:
- 4.3
-