|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.ecf.osgi.services.discovery.local.FileBasedDiscoveryImpl
public class FileBasedDiscoveryImpl
Field Summary | |
---|---|
static java.lang.String |
PROP_KEY_PUBLISH_STRATEGY
ServiceRegistration property identifying Discovery's default strategy for distribution of published service information. |
static java.lang.String |
PROP_VAL_PUBLISH_STRATEGY_PULL
Constant for a "pull" publication strategy: published service information is available just upon lookup requests. |
static java.lang.String |
PROP_VAL_PUBLISH_STRATEGY_PUSH
Constant for a "push" publication strategy: published service information is actively pushed to the network for discovery. |
Constructor Summary | |
---|---|
FileBasedDiscoveryImpl(org.osgi.framework.BundleContext bc,
org.osgi.service.log.LogService logger)
Constructor. |
Method Summary | |
---|---|
void |
destroy()
Shutdown method called by Activator. |
java.util.Map |
getCachedServices()
Returns the list of known services without the locally published ones. |
protected java.util.Map |
getRegisteredServiceTracker()
Returns a Map of all registered DiscoveredServiceTracker trackers. |
void |
init()
Initialization method called by Activator. |
static boolean |
isTrackerInterestedInSED(ServiceEndpointDescription svcDescr,
java.util.Map trackerProperties,
java.util.Collection matchingInterfaces,
java.util.Collection matchingFilters)
Compares the properties of a registered DiscoveredServiceTracker with the SED properties. |
protected static void |
log(int logLevel,
java.lang.String msg)
|
protected static void |
log(int logLevel,
java.lang.String msg,
java.lang.Exception e)
|
protected void |
notifyListenersOnModifiedServiceDescription(ServiceEndpointDescription svcDescr)
|
protected void |
notifyListenersOnNewServiceDescription(ServiceEndpointDescription svcDescr)
|
protected void |
notifyListenersOnRemovedServiceDescription(ServiceEndpointDescription svcDescr)
Notifies all DSTTrackers about an unpublished service. |
static void |
notifyOnAvailableSEDs(DiscoveredServiceTracker tracker,
java.util.Map matchingCriteria)
This method informs a just registered or modified service tracker if a service matches its properties. |
protected ServiceEndpointDescription |
publishService(java.util.Collection javaInterfaces,
java.util.Collection javaInterfacesAndVersions,
java.util.Collection javaInterfacesAndEndpointInterfaces,
java.util.Map properties,
java.lang.String strategy,
java.lang.String endpointID)
Publishes a service. |
protected void |
publishService(ServiceEndpointDescription svcDescr)
|
static void |
setLogService(org.osgi.service.log.LogService logger)
|
protected void |
unpublishService(ServiceEndpointDescription serviceDescription)
Unpublishes a given service description. |
protected void |
validateServiceDescription(ServiceEndpointDescription serviceDescription)
This method checks if a given ServiceEndpointDescrioption follows the minimal requirements. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PROP_KEY_PUBLISH_STRATEGY
public static final java.lang.String PROP_VAL_PUBLISH_STRATEGY_PUSH
public static final java.lang.String PROP_VAL_PUBLISH_STRATEGY_PULL
Constructor Detail |
---|
public FileBasedDiscoveryImpl(org.osgi.framework.BundleContext bc, org.osgi.service.log.LogService logger)
bc
- the BundleContext of the containing bundle.logger
- a LogService instanceMethod Detail |
---|
public void init()
public void destroy()
protected ServiceEndpointDescription publishService(java.util.Collection javaInterfaces, java.util.Collection javaInterfacesAndVersions, java.util.Collection javaInterfacesAndEndpointInterfaces, java.util.Map properties, java.lang.String strategy, java.lang.String endpointID)
javaInterfaces
- collection of java interface namesjavaInterfacesAndVersions
- collection of versions, where the order of the version must
match the order of the java interfacesjavaInterfacesAndEndpointInterfaces
- optional collection of endpointinterface names, where the
order must match the order of the java interfacesproperties
- map of properties; keys must be Strings, values are of type
objectstrategy
- optional string that defines the publish strategy
protected void publishService(ServiceEndpointDescription svcDescr)
protected void unpublishService(ServiceEndpointDescription serviceDescription)
serviceDescription
- the service to unpublish
java.lang.IllegalArgumentException
- if serviceDescription is null or does not contain at least
one java interfaceprotected static void log(int logLevel, java.lang.String msg)
protected static void log(int logLevel, java.lang.String msg, java.lang.Exception e)
public static void setLogService(org.osgi.service.log.LogService logger)
logger
- the reference to the LogService which get called for loggingprotected void validateServiceDescription(ServiceEndpointDescription serviceDescription)
serviceDescription
- the given ServiceEndpointDescription
java.lang.IllegalArgumentException
- if serviceDescription is null or does not contain at least
one java interfaceprotected java.util.Map getRegisteredServiceTracker()
public static void notifyOnAvailableSEDs(DiscoveredServiceTracker tracker, java.util.Map matchingCriteria)
tracker
- the just registered or modified DiscoveredServiceTrackerprotected void notifyListenersOnNewServiceDescription(ServiceEndpointDescription svcDescr)
svcDescr
- protected void notifyListenersOnRemovedServiceDescription(ServiceEndpointDescription svcDescr)
svcDescr
- the unpublished ServiceEndpointDescriptionprotected void notifyListenersOnModifiedServiceDescription(ServiceEndpointDescription svcDescr)
svcDescr
- public static boolean isTrackerInterestedInSED(ServiceEndpointDescription svcDescr, java.util.Map trackerProperties, java.util.Collection matchingInterfaces, java.util.Collection matchingFilters)
svcDescr
- trackerProperties
- matchingInterfaces
- (an out-argument) a collection which will contain all
tracker's interface criteria matching with given
ServiceEndpointDescription objectmatchingFilters
- (an out-argument) a collection which will contain all
tracker's filter criteria matching with given
ServiceEndpointDescription object
public java.util.Map getCachedServices()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |