Project: mule
Issue MULE-8412: Reuse OperationImplementation instances instead of creating and injecting new ones each time
Currently the ext-api is creating a new instance of the operation implementation for each event. That is very confortable for the user, but it has performance considerations associated to garbage collection and the new to perform dependency injection all the time. We need to move to a schema in which: * One instance is created per configuration and reused as long as that configuration lives * The Class holding the method annotated with @Operation needs to have a constructor which receives a single argument which is the configuration to use. Failure to provide such a constructor which result in the application not starting * Upon creation, Mule will inject dependencies on this class but will not add it to the registry * This also means that it will no longer be valid to obtain things like the MuleEvent through a @Inject annotation, you have to receive it a method argument, which means that the invoker needs a refresh too
Story points: 8