Class ConfigurationServiceFactory<S extends LogConfigurator>

java.lang.Object
org.apache.sling.commons.log.logback.internal.config.ConfigurationServiceFactory<S>
Type Parameters:
S - the type of LogConfigurator provided by the factory
All Implemented Interfaces:
org.osgi.framework.ServiceFactory<S>

public class ConfigurationServiceFactory<S extends LogConfigurator> extends Object implements org.osgi.framework.ServiceFactory<S>
Factory of logging configuration services
  • Constructor Summary

    Constructors
    Constructor
    Description
    ConfigurationServiceFactory(@NotNull org.apache.sling.commons.log.logback.internal.LogConfigManager mgr, @NotNull Supplier<S> svcSupplier)
    Constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    getService(@NotNull org.osgi.framework.Bundle bundle, @NotNull org.osgi.framework.ServiceRegistration<S> registration)
    Get or create the service for the supplied registration.
    void
    ungetService(@NotNull org.osgi.framework.Bundle bundle, @NotNull org.osgi.framework.ServiceRegistration<S> registration, S svc)
    Unget the service for the supplied registration.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ConfigurationServiceFactory

      public ConfigurationServiceFactory(@NotNull @NotNull org.apache.sling.commons.log.logback.internal.LogConfigManager mgr, @NotNull @NotNull Supplier<S> svcSupplier)
      Constructor
      Parameters:
      mgr - the log configuration manager
      svcSupplier - the supplier that creates the service instance
  • Method Details

    • getService

      @NotNull public S getService(@NotNull @NotNull org.osgi.framework.Bundle bundle, @NotNull @NotNull org.osgi.framework.ServiceRegistration<S> registration)
      Get or create the service for the supplied registration. The useCount is incremented for each call.
      Specified by:
      getService in interface org.osgi.framework.ServiceFactory<S extends LogConfigurator>
      Returns:
      the service for the registration
    • ungetService

      public void ungetService(@NotNull @NotNull org.osgi.framework.Bundle bundle, @NotNull @NotNull org.osgi.framework.ServiceRegistration<S> registration, @NotNull S svc)
      Unget the service for the supplied registration. This decrements the useCount and if that reaches zero then the service object is disposed
      Specified by:
      ungetService in interface org.osgi.framework.ServiceFactory<S extends LogConfigurator>