Top Description Methods
org.glassfish.hk2.api

public Interface FactoryDescriptors

Known Direct Implementers
org.glassfish.hk2.utilities.FactoryDescriptorsImpl

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.
Author
jwells

Method Summary

Modifier and TypeMethod and Description
public Descriptor

Returns:

The factory descriptor as a factory
getFactoryAsAFactory
()

This returns the factory as a factory for some other type.

public Descriptor

Returns:

The factory as a service itself
getFactoryAsAService
()

This returns the factory as a service itself.

Method Detail

getFactoryAsAFactoryback to summary
public 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 be DescriptorType#PROVIDE_METHOD since this descriptor is describing the factory as a factory, not as a service.

Returns:Descriptor

The factory descriptor as a factory

getFactoryAsAServiceback to summary
public Descriptor getFactoryAsAService()

This returns the factory as a service itself. The advertised contracts must contain the implementation class of the factory and the Factory. The descriptor type must be DescriptorType#CLASS since this descriptor is describing the factory itself.

Returns:Descriptor

The factory as a service itself