Package org.jvnet.hk2.metadata.tests
Class ComplexFactory
- java.lang.Object
-
- org.jvnet.hk2.metadata.tests.ComplexFactory
-
- All Implemented Interfaces:
Factory<ComplexImpl>
@Service @Named public class ComplexFactory extends java.lang.Object implements Factory<ComplexImpl>
A factory thar produces a complex object type
-
-
Constructor Summary
Constructors Constructor Description ComplexFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose(ComplexImpl instance)This method will dispose of objects created with this scope.ComplexImplprovide()This method will create instances of the type of this factory.
-
-
-
Method Detail
-
provide
@PerLookup @Named("non-default-name") public ComplexImpl provide()
Description copied from interface:FactoryThis method will create instances of the type of this factory. The provide method must be annotated with the desired scope and qualifiers.- Specified by:
providein interfaceFactory<ComplexImpl>- Returns:
- The produces object
-
dispose
public void dispose(ComplexImpl instance)
Description copied from interface:FactoryThis method will dispose of objects created with this scope. This method should not be annotated, as it is naturally paired with the provide method- Specified by:
disposein interfaceFactory<ComplexImpl>- Parameters:
instance- The instance to dispose of
-
-