Annotation Interface Lazy


@Retention(CLASS) @Target(PARAMETER) public @interface Lazy

Used on a bean socket variable to inject a bean instance supplier instead of an actual bean instance.

Lazy socket must then be of type Supplier and its formal parameter must designate the type dependency expected by the socket.

Lazy sockets allow to lazily retrieve bean instances, this doesn't mean that the bean to inject is created on demand in the module, but that the instance retrieval is called on demand in the dependent bean instance. This is particularly interesting when prototype beans are wired into a lazy socket, the dependent bean can then create new instances on demand during application operation.

Since:
1.0
Author:
Jeremy Kuhn