public interface ObjectGridOSGiManager
ObjectGridOSGiManager is responsible for querying and managing the
OSGi services currently used for an ObjectGrid instance.
This API is useful in the case that the user application can directly access
the ObjectGrid instances. Users can directly access the client ObjectGrid instances
and local ObjectGrid instances using ObjectGridManager interface.
Users can also access server-side ObjectGrid instances using user plug-ins
running in the container server, for example, ObjectGridEventGroup.ShardEvents.
Use the
OSGiManagerFactory.getOSGiManager(ObjectGrid objectGrid)
method to get an instance of ObjectGridOSGiManager.
| Modifier and Type | Method and Description |
|---|---|
Integer |
getRanking(String serviceName)
Get the current ranking for a specific service used by a grid
|
Map<String,Integer> |
getRankings()
Get the current service rankings for all services used by an ObjectGrid.
|
void |
useRanking(Map<String,Integer> serviceRankings)
To use a set of services with specific rankings.
|
void |
useRanking(String serviceName,
Integer ranking)
To use the service for a specific ranking.
|
Integer getRanking(String serviceName)
serviceName - the service nameMap<String,Integer> getRankings()
void useRanking(String serviceName, Integer ranking) throws ServiceNotAvailableException, ServiceUpdateException
This method can only be called when the ObjectGrid type is a CLIENT type or
a LOCAL type. You can get the ObjectGrid type using the
ObjectGrid.getObjectGridType() method.
This method might be removed when the API is finalized.
serviceName - the OSGi service nameranking - the service ranking to be usedServiceNotAvailableException - thrown when that specified service ranking of the service is not availableServiceUpdateException - thrown when the specified OSGi service version is
available, but the service update fails.void useRanking(Map<String,Integer> serviceRankings) throws ServiceNotAvailableException, ServiceUpdateException
This method can only be called when the ObjectGrid type is a CLIENT type or
a LOCAL type. You can get the ObjectGrid type using the
ObjectGrid.getObjectGridType() method.
This method might be removed when the API is finalized.
serviceRankings - A map of the used service rankings to be used.
The key of the map is the service name, and value of the map is the service version to be used.ServiceNotAvailableException - thrown when that specified version of the service is not availableServiceUpdateException - thrown when the specified OSGi service version is
available, but the service update fails.