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 Object
implements ServiceLocatorRuntimeBean
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Clears all entries from the HK2 reflection cache.void
Clears all entries from the HK2 service cache.int
Returns the current total number of children attached to this ServiceLocatorint
Returns the total number of descriptors in this ServiceLocator.int
Returns the current size of the HK2 reflection cache.int
Returns the maximum number of entries allowed in the HK2 service cache.int
Returns the current size of the HK2 service cache.
-
Field Details
-
locator
-
-
Constructor Details
-
ServiceLocatorRuntimeImpl
-
-
Method Details
-
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
-