Class ServiceCache
- java.lang.Object
-
- org.apache.sling.scripting.core.impl.ServiceCache
-
- All Implemented Interfaces:
EventListener
,org.osgi.framework.ServiceListener
public class ServiceCache extends Object implements org.osgi.framework.ServiceListener
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
ServiceCache.Reference
-
Field Summary
Fields Modifier and Type Field Description protected List<org.osgi.framework.ServiceReference>
references
The list of references - we don't need to synchronize this as we are running in one single request.
-
Constructor Summary
Constructors Constructor Description ServiceCache(org.osgi.framework.BundleContext ctx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
<ServiceType>
ServiceTypegetService(Class<ServiceType> type)
Return a service for the given service class.void
serviceChanged(org.osgi.framework.ServiceEvent event)
-
-
-
Field Detail
-
references
protected final List<org.osgi.framework.ServiceReference> references
The list of references - we don't need to synchronize this as we are running in one single request.
-
-
Method Detail
-
dispose
public void dispose()
-
getService
public <ServiceType> ServiceType getService(Class<ServiceType> type)
Return a service for the given service class.- Type Parameters:
ServiceType
- The service class / interface- Parameters:
type
- The requested service- Returns:
- The service or
null
-
serviceChanged
public void serviceChanged(org.osgi.framework.ServiceEvent event)
- Specified by:
serviceChanged
in interfaceorg.osgi.framework.ServiceListener
- See Also:
ServiceListener.serviceChanged(org.osgi.framework.ServiceEvent)
-
-