java.lang.Object
org.glassfish.hk2.utilities.FactoryDescriptorsImpl
- All Implemented Interfaces:
FactoryDescriptors
This is an implementation of FactoryDescriptors that can be
used by hk2 uses when creating descriptors that describe
a
Factory- Author:
- jwells
-
Constructor Summary
ConstructorsConstructorDescriptionFactoryDescriptorsImpl(Descriptor asService, Descriptor asProvideMethod) This creates a descriptor pair describing aFactoryand the associatedFactory.provide()method -
Method Summary
-
Constructor Details
-
FactoryDescriptorsImpl
This creates a descriptor pair describing aFactoryand the associatedFactory.provide()method- Parameters:
asService- A description of the factory itself as an hk2 service. May not be null. Must have DescriptorType ofDescriptorType.CLASS. One of the contracts must be FactoryasProvideMethod- A description of the provide method of the factory. Must have DescriptorType ofDescriptorType.PROVIDE_METHOD. May not be null- Throws:
IllegalArgumentException- if the descriptors are not of the proper type
-
-
Method Details
-
getFactoryAsAService
Description copied from interface:FactoryDescriptorsThis 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.CLASSsince this descriptor is describing the factory itself.- Specified by:
getFactoryAsAServicein interfaceFactoryDescriptors- Returns:
- The factory as a service itself
-
getFactoryAsAFactory
Description copied from interface:FactoryDescriptorsThis 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_METHODsince this descriptor is describing the factory as a factory, not as a service.- Specified by:
getFactoryAsAFactoryin interfaceFactoryDescriptors- Returns:
- The factory descriptor as a factory
-
hashCode
public int hashCode() -
equals
-
toString
-