Package org.jvnet.hk2.metadata.tests
Class FactoryWithRanks
- java.lang.Object
-
- org.jvnet.hk2.metadata.tests.FactoryWithRanks
-
- All Implemented Interfaces:
Factory<SimpleInterface>
@Service @Rank(13) public class FactoryWithRanks extends java.lang.Object implements Factory<SimpleInterface>
-
-
Constructor Summary
Constructors Constructor Description FactoryWithRanks()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose(SimpleInterface instance)This method will dispose of objects created with this scope.SimpleInterfaceprovide()This method will create instances of the type of this factory.
-
-
-
Method Detail
-
provide
@Rank(-1) public SimpleInterface 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<SimpleInterface>- Returns:
- The produces object
-
dispose
public void dispose(SimpleInterface 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<SimpleInterface>- Parameters:
instance- The instance to dispose of
-
-