org.apache.camel.spi.Registry should have mandatory lookup methods
------------------------------------------------------------------
Key: CAMEL-896
URL: https://issues.apache.org/activemq/browse/CAMEL-896
Project: Apache Camel
Issue Type: Improvement
Components: camel-core
Affects Versions: 1.5.0
Reporter: Claus Ibsen
Priority: Minor
Fix For: 2.0.0
The Registry only has lookup methods that return null if the bean was not
found. Then we need to manually throw exception if the bean was expected.
We need to expose mandatoryLookup methods that will do null check
For instance:
{code}
FTPClientConfig ftpClientConfig =
this.getCamelContext().getRegistry().lookup(ref, FTPClientConfig.class);
if (ftpClientConfig == null) {
throw new IllegalArgumentException("Damm can not find it");
}
{code}
Should just be:
{code}
FTPClientConfig ftpClientConfig =
this.getCamelContext().getRegistry().mandatoryLookup(ref,
FTPClientConfig.class);
{code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.