Class ModuleMetadata

  • All Implemented Interfaces:
    java.io.Serializable

    public final class ModuleMetadata
    extends java.lang.Object
    implements java.io.Serializable
    Holds information about /META-INF/services and /META-INF/inhabitants for a Module.

    A Service implementation is identified by the service interface it implements, the implementation class of that service interface and the module in which that implementation resides.

    Note that since a single ModuleDefinition is allowed to be used in multiple Modules, this class may not reference anything Module specific.

    See Also:
    Serialized Form
    • Field Detail

      • descriptors

        private java.util.Map<java.lang.String,​java.util.List<Descriptor>> descriptors
        META-INF/hk2-locator/* cache
      • NULL_ENTRY

        private static final ModuleMetadata.Entry NULL_ENTRY
        Empty Entry used to indicate that there's no service. This is mutable, so its working correctly depends on the good will of the callers.
    • Constructor Detail

      • ModuleMetadata

        public ModuleMetadata()
    • Method Detail

      • getDescriptors

        public java.util.Map<java.lang.String,​java.util.List<Descriptor>> getDescriptors()
      • addDescriptors

        public void addDescriptors​(java.lang.String serviceLocatorName,
                                   java.util.Collection<Descriptor> descriptorsToAdd)
      • getDescriptors

        public java.util.List<java.net.URL> getDescriptors​(java.lang.String serviceName)
      • load

        public void load​(java.net.URL source,
                         java.lang.String serviceName)
                  throws java.io.IOException
        Throws:
        java.io.IOException
      • load

        public void load​(java.net.URL source,
                         java.lang.String serviceName,
                         java.io.InputStream is)
                  throws java.io.IOException
        Throws:
        java.io.IOException