Uploaded image for project: 'MINA SSHD'
  1. MINA SSHD
  2. SSHD-841

Use Nio2ServiceFactoryFactory as the hardwired default if no other found or explicitly set

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.1.0
    • 2.1.0
    • None
    • Important

    Description

      The current code uses ServiceLoader#load mechanism to detect any 3rd party provided IoServiceFactoryFactory-ies. However, since Nio2ServiceFactoryFactory is always present in the sshd-core, it is always picked up along with any others that the user may have placed in the classpath. Furthermore, the service loading mechanism makes no guarantees as to the order in which registered services are scanned. Since the mechanism that instantiates the factory uses the "first" detected factory it is pretty much useless - unless the user configures the org.apache.sshd.common.io.IoServiceFactoryFactory system property.

      The correct flow should be:

      • Consult org.apache.sshd.common.io.IoServiceFactoryFactory system property
      • If no specific factory specified - scan the service loaders
      • If exactly one found then use it - fail if multiple ones registered
      • Otherwise use Nio2ServiceFactoryFactory

      Attachments

        Activity

          People

            lgoldstein Lyor Goldstein
            lgoldstein Lyor Goldstein
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: