You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2008/11/13 19:28:05 UTC

[jira] Assigned: (CAMEL-896) org.apache.camel.spi.Registry should have mandatory lookup methods

     [ https://issues.apache.org/activemq/browse/CAMEL-896?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen reassigned CAMEL-896:
---------------------------------

    Assignee: Claus Ibsen

> 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
>            Assignee: 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.