ServiceLocatorFactory that looks
in the OSGi service registry or the META-INF/services for the implementation
to use. Failing those things, it uses the standard default locator
generator, which is found in auto-depends, which is the 99.9% case
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final boolean | |
| private static final String | |
| private static final String | |
| private final HashSet | |
| private final ReentrantLock | |
| private static int | |
| private final HashMap | |
| private static final ReentrantLock |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addListener(ServiceLocatorListener listener)
Implements abstract org. Adds a service listener to the unordered set of listeners that will be notified when named listeners are added or removed from the system. |
| private void | |
| public ServiceLocator | create(String name)
Implements abstract org. Creates (or finds) a ServiceLocator. |
| public ServiceLocator | create(String name, ServiceLocator parent)
Implements abstract org. Creates or finds a ServiceLocator. |
| public ServiceLocator | create(String name, ServiceLocator parent, ServiceLocatorGenerator generator)
Implements abstract org. Creates or finds a ServiceLocator. |
| public ServiceLocator | create(String name, ServiceLocator parent, ServiceLocatorGenerator generator, ServiceLocatorFactory.
Implements abstract org. Creates a ServiceLocator. |
| public void | destroy(String name)
Implements abstract org. Removes the ServiceLocator with this name All services associated with this ServiceLocator will be shutdown |
| private void | |
| public void | destroy(ServiceLocator locator)
Implements abstract org. Removes the given ServiceLocator All services associated with this ServiceLocator will be shutdown |
| public ServiceLocator | find(String name)
Implements abstract org. Finds the ServiceLocator with this name |
| private static String | |
| private static ServiceLocatorGenerator | |
| private static ServiceLocatorGenerator | |
| private static Iterable | |
| private ServiceLocator | |
| public void | removeListener(ServiceLocatorListener listener)
Implements abstract org. Removes a service listener from the set of listeners that are notified when named listeners are added or removed from the system |
| DEBUG_SERVICE_LOCATOR_LIFECYCLE | back to summary |
|---|---|
| private static final boolean DEBUG_SERVICE_LOCATOR_LIFECYCLE | |
| DEBUG_SERVICE_LOCATOR_PROPERTY | back to summary |
|---|---|
| private static final String DEBUG_SERVICE_LOCATOR_PROPERTY | |
| GENERATED_NAME_PREFIX | back to summary |
|---|---|
| private static final String GENERATED_NAME_PREFIX | |
| listeners | back to summary |
|---|---|
| private final HashSet<ServiceLocatorListener> listeners | |
| lock | back to summary |
|---|---|
| private final ReentrantLock lock | |
| name_count | back to summary |
|---|---|
| private static int name_count | |
| serviceLocators | back to summary |
|---|---|
| private final HashMap<String, ServiceLocator> serviceLocators | |
| sLock | back to summary |
|---|---|
| private static final ReentrantLock sLock | |
| ServiceLocatorFactoryImpl | back to summary |
|---|---|
| public ServiceLocatorFactoryImpl() This will create a new set of name to locator mappings | |
| addListener | back to summary |
|---|---|
| public void addListener(ServiceLocatorListener listener) Implements abstract org. Doc from org. Adds a service listener to the unordered set of listeners that will be notified when named listeners are added or removed from the system. If this listener is already registered this method does nothing
| |
| callListenerAdded | back to summary |
|---|---|
| private void callListenerAdded(ServiceLocator added) | |
| create | back to summary |
|---|---|
| public ServiceLocator create(String name) Implements abstract org. Doc from org. Creates (or finds) a ServiceLocator. If there is already a ServiceLocator with the given name then this method will return that locator.
| |
| create | back to summary |
|---|---|
| public ServiceLocator create(String name, ServiceLocator parent) Implements abstract org. Doc from org. Creates or finds a ServiceLocator. If there is already a ServiceLocator with the given name then this method will return that ServiceLocator. The parent argument will be ignored in that case
| |
| create | back to summary |
|---|---|
| public ServiceLocator create(String name, ServiceLocator parent, ServiceLocatorGenerator generator) Implements abstract org. Doc from org. Creates or finds a ServiceLocator. If there is already a ServiceLocator with the given name then this method will return that ServiceLocator. The parent argument will be ignored in that case. If a null name is given then a new ServiceLocator with a generated name will be returned.
| |
| create | back to summary |
|---|---|
| public ServiceLocator create(String name, ServiceLocator parent, ServiceLocatorGenerator generator, ServiceLocatorFactory. Implements abstract org. Doc from org. Creates a ServiceLocator. If there is already a ServiceLocator with the given name then this method will honor the given CreatePolicy. return that ServiceLocator. The policies are
| |
| destroy | back to summary |
|---|---|
| public void destroy(String name) Implements abstract org. Doc from org. Removes the ServiceLocator with this name All services associated with this ServiceLocator will be shutdown
| |
| destroy | back to summary |
|---|---|
| private void destroy(String name, ServiceLocator locator) | |
| destroy | back to summary |
|---|---|
| public void destroy(ServiceLocator locator) Implements abstract org. Doc from org. Removes the given ServiceLocator All services associated with this ServiceLocator will be shutdown | |
| find | back to summary |
|---|---|
| public ServiceLocator find(String name) Implements abstract org. Doc from org. Finds the ServiceLocator with this name
| |
| getGeneratedName | back to summary |
|---|---|
| private static String getGeneratedName() | |
| getGenerator | back to summary |
|---|---|
| private static ServiceLocatorGenerator getGenerator() | |
| getGeneratorSecure | back to summary |
|---|---|
| private static ServiceLocatorGenerator getGeneratorSecure() | |
| getOSGiSafeGenerators | back to summary |
|---|---|
| private static Iterable | |
| internalCreate | back to summary |
|---|---|
| private ServiceLocator internalCreate(String name, ServiceLocator parent, ServiceLocatorGenerator generator) | |
| removeListener | back to summary |
|---|---|
| public void removeListener(ServiceLocatorListener listener) Implements abstract org. Doc from org. Removes a service listener from the set of listeners that are notified when named listeners are added or removed from the system
| |
| Modifier and Type | Field and Description |
|---|---|
| private static final ServiceLocatorGenerator |
| Access | Constructor and Description |
|---|---|
| private |
| defaultGenerator | back to summary |
|---|---|
| private static final ServiceLocatorGenerator defaultGenerator | |
| DefaultGeneratorInitializer | back to summary |
|---|---|
| private DefaultGeneratorInitializer() | |