Package org.glassfish.hk2.api
Interface FactoryDescriptors
- All Known Implementing Classes:
FactoryDescriptorsImpl
public interface FactoryDescriptors
This is a convenience class that links together the factory descriptor as a factory
for another type and the factory as a service itself. It is not required to use
this helper to register a factory, as the individual descriptors can be registered
with the system independently.
-
Method Summary
Modifier and TypeMethodDescriptionThis returns the factory as a factory for some other type.This returns the factory as a service itself.
-
Method Details
-
getFactoryAsAService
Descriptor getFactoryAsAService()This returns the factory as a service itself. The advertised contracts must contain the implementation class of the factory and theFactory
. The descriptor type must beDescriptorType.CLASS
since this descriptor is describing the factory itself.- Returns:
- The factory as a service itself
-
getFactoryAsAFactory
Descriptor getFactoryAsAFactory()This returns the factory as a factory for some other type. The implementation class should contain the implementation class of the factory service. If the implementation class returned from this does not match the implementation class returned from getFactoryAsAService an error will occur. The contracts, name and qualifiers should represent the type returned from the provide method of the factory. The descriptor type must beDescriptorType.PROVIDE_METHOD
since this descriptor is describing the factory as a factory, not as a service.- Returns:
- The factory descriptor as a factory
-