Luca Burgazzoli created CAMEL-16136:
---------------------------------------
Summary: core: replace BaseServiceResolver with a static method
Key: CAMEL-16136
URL: https://issues.apache.org/jira/browse/CAMEL-16136
Project: Camel
Issue Type: Improvement
Components: camel-core-engine
Reporter: Luca Burgazzoli
Assignee: Luca Burgazzoli
Fix For: 3.8.0
I noticed that in SimpleCamelContext and other few pieces we use the following
patter:
{code:Java}
BaseServiceResolver<DeferServiceFactory> resolver = new
BaseServiceResolver<>(
DeferServiceFactory.FACTORY,
DeferServiceFactory.class,
getBootstrapFactoryFinder());
Optional<DeferServiceFactory> result =
resolver.resolve(getCamelContextReference());
if (result.isPresent()) {
return result.get();
} else {
throw new IllegalArgumentException("...");
}
{code}
I wonder if we really need to allocate a BaseServiceResolver as in fact the
instance is never reused and I do not see any location where the class is
extended so maybe we can either replace it with a static method or we can add a
similar functionality to ExtendedCamelContext.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)