Used in conjunction with @Bean
to declare a mutating socket bean.
A mutating socket bean must implement Function<A, B>
where A
is the type of the socket exposed by the module and B
is the type of the instance
after transformation and used during dependency injection.
@Mutator @Bean
public class MutatingSocketBean implements Function<Type, TransformedType> {
@Override
public TransformedType apply(Type instance) {...}
}
Such socket can be created when there is a need to pre-process, adapt, decorate or transform an external dependency to fit module's needs.
- Since:
- 1.6
- Author:
- Jeremy Kuhn
- See Also:
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionboolean
Indicates whether the socket should be required and mutator always invoked regardless on whether the socket is wired or not.
-
Element Details
-
required
boolean requiredIndicates whether the socket should be required and mutator always invoked regardless on whether the socket is wired or not.
- Returns:
- true to make the socket required and always invoke the mutator on the wired instance, false otherwise
- Default:
false
-