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.

Author:
jwells

Method Summary
 Descriptor getFactoryAsAFactory()
          This returns the factory as a factory for some other type.
 Descriptor getFactoryAsAService()
          This returns the factory as a service itself.
 

Method Detail

getFactoryAsAService

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:
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 be DescriptorType.FACTORY since this descriptor is describing the factory as a factory, not as a service.

Returns:
The factory descriptor as a factory


Copyright © 2013 Oracle Corporation. All Rights Reserved.