Package org.jvnet.hk2.internal
Class ServiceLocatorRuntimeImpl
- java.lang.Object
-
- org.jvnet.hk2.internal.ServiceLocatorRuntimeImpl
-
- All Implemented Interfaces:
ServiceLocatorRuntimeBean
@Singleton @Visibility(LOCAL) public class ServiceLocatorRuntimeImpl extends java.lang.Object implements ServiceLocatorRuntimeBean
-
-
Field Summary
Fields Modifier and Type Field Description private ServiceLocatorImpl
locator
-
Constructor Summary
Constructors Modifier Constructor Description private
ServiceLocatorRuntimeImpl(ServiceLocator locator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearReflectionCache()
Clears all entries from the HK2 reflection cache.void
clearServiceCache()
Clears all entries from the HK2 service cache.int
getNumberOfChildren()
Returns the current total number of children attached to this ServiceLocatorint
getNumberOfDescriptors()
Returns the total number of descriptors in this ServiceLocator.int
getReflectionCacheSize()
Returns the current size of the HK2 reflection cache.int
getServiceCacheMaximumSize()
Returns the maximum number of entries allowed in the HK2 service cache.int
getServiceCacheSize()
Returns the current size of the HK2 service cache.
-
-
-
Field Detail
-
locator
private final ServiceLocatorImpl locator
-
-
Constructor Detail
-
ServiceLocatorRuntimeImpl
@Inject private ServiceLocatorRuntimeImpl(ServiceLocator locator)
-
-
Method Detail
-
getNumberOfDescriptors
public int getNumberOfDescriptors()
Description copied from interface:ServiceLocatorRuntimeBean
Returns the total number of descriptors in this ServiceLocator. Does not include parent services- Specified by:
getNumberOfDescriptors
in interfaceServiceLocatorRuntimeBean
- Returns:
- The number of services in this ServiceLocator (does not include services in the parent locator)
-
getNumberOfChildren
public int getNumberOfChildren()
Description copied from interface:ServiceLocatorRuntimeBean
Returns the current total number of children attached to this ServiceLocator- Specified by:
getNumberOfChildren
in interfaceServiceLocatorRuntimeBean
- Returns:
- The current number of children locators attached to this ServiceLocator
-
getServiceCacheSize
public int getServiceCacheSize()
Description copied from interface:ServiceLocatorRuntimeBean
Returns the current size of the HK2 service cache. The service cache is used to optimize frequent service lookups and injections- Specified by:
getServiceCacheSize
in interfaceServiceLocatorRuntimeBean
- Returns:
- The current size of the HK2 service cache
-
getServiceCacheMaximumSize
public int getServiceCacheMaximumSize()
Description copied from interface:ServiceLocatorRuntimeBean
Returns the maximum number of entries allowed in the HK2 service cache. The service cache is used to optimize frequent service lookups and injections- Specified by:
getServiceCacheMaximumSize
in interfaceServiceLocatorRuntimeBean
- Returns:
- The maximum number of entries allowed in the HK2 service cache
-
clearServiceCache
public void clearServiceCache()
Description copied from interface:ServiceLocatorRuntimeBean
Clears all entries from the HK2 service cache. The service cache is used to optimize frequent service lookups and injections. Calling this method may free up memory but will cause degraded injection and lookup performance until the cache can be built back up- Specified by:
clearServiceCache
in interfaceServiceLocatorRuntimeBean
-
getReflectionCacheSize
public int getReflectionCacheSize()
Description copied from interface:ServiceLocatorRuntimeBean
Returns the current size of the HK2 reflection cache. The reflection cache is used to minimize the amount of reflection done by HK2- Specified by:
getReflectionCacheSize
in interfaceServiceLocatorRuntimeBean
- Returns:
- The current size of the HK2 reflection cache
-
clearReflectionCache
public void clearReflectionCache()
Description copied from interface:ServiceLocatorRuntimeBean
Clears all entries from the HK2 reflection cache. The reflection cache is used to minimize the amount of reflection done by HK2. Calling this method may free up memory but will cause degraded service creation performance until the cache can be built back up- Specified by:
clearReflectionCache
in interfaceServiceLocatorRuntimeBean
-
-