Uploaded image for project: 'Commons Logging'
  1. Commons Logging
  2. LOGGING-186

Use ServiceLoader class

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.2
    • 1.3.0
    • None

    Description

      The current service loader code used by LogFactory predates the ServiceLoader class introduced in Java 6 by 4 years and is a simplified version of it.

      This has many disadvantages:

      • the service loader file can not have any comments, like a license header or the name of the tool that generated the service file. Commons Logging just takes the first line in the file and uses it as the class name,
      • the Service Loader Mediator OSGi specification allows to use ServiceLoader in an OSGi environment, but it might ignore direct accesses to META-INF/services resources (cf. Apache Aries SPI Fly),
      • in a JPMS environment, the META-INF/services file could even not be there and the service is declared in the module descriptor.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              pkarwasz Piotr Karwasz
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: