Class ServiceCache

  • All Implemented Interfaces:
    EventListener, org.osgi.framework.ServiceListener

    public class ServiceCache
    extends Object
    implements org.osgi.framework.ServiceListener
    • 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.
    • Constructor Detail

      • ServiceCache

        public ServiceCache​(org.osgi.framework.BundleContext ctx)
    • 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 interface org.osgi.framework.ServiceListener
        See Also:
        ServiceListener.serviceChanged(org.osgi.framework.ServiceEvent)