[ https://issues.apache.org/jira/browse/CAMEL-9498?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15124978#comment-15124978 ]
ASF GitHub Bot commented on CAMEL-9498: --------------------------------------- GitHub user yuruki opened a pull request: https://github.com/apache/camel/pull/822 CAMEL-9498: Universal local registry for CamelContext This change adds an always available local SimpleRegistry to CamelContext. Local registry makes sure that you can always add beans to a CamelContext regardless of how and where you setup and run your CamelContext. Notes: 1. CompositeRegistry can now handle nested registries. 2. Local registry is directly accessible with CamelContext.getLocalRegistry(). 3. DefaultCamelContext.getRegistry() now returns a CompositeRegistry with local SimpleRegistry as its first member. As before, one should not make assumptions on the registry hierarchy getRegistry() will give you. If you want to access a particular subregistry use getRegistry(Class<T> type). https://issues.apache.org/jira/browse/CAMEL-9498 You can merge this pull request into a Git repository by running: $ git pull https://github.com/yuruki/camel camel-localregistry Alternatively you can review and apply these changes as the patch at: https://github.com/apache/camel/pull/822.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #822 ---- commit e3ce8832f019542e3a7bbc68df0a65b851c2023a Author: Jyrki Ruuskanen <yur...@kotikone.fi> Date: 2016-01-28T21:34:44Z CAMEL-9498: Universal local registry for CamelContext ---- > Always provide a writable local registry > ---------------------------------------- > > Key: CAMEL-9498 > URL: https://issues.apache.org/jira/browse/CAMEL-9498 > Project: Camel > Issue Type: Improvement > Components: camel-core > Reporter: Jyrki Ruuskanen > Priority: Minor > > Many Camel components need to reference objects in CamelContext's registry as > part of their configuration (for example httpClientConfigurer for http/http4 > and restletRealm for restlet). > These objects often apply to that particular CamelContext and not others, > thus the registry holding these bits could be local instead of, say, OSGi > service registry. Using a local registry prevents the risk of conflicting > keys and spares us from devising a naming policy for even trivial stuff. > To conveniently create and add these objects, even from inside RouteBuilder's > configure method, we need write access to said registry. > CamelContext should, in my opinion, provide a local SimpleRegistry that is > always available. -- This message was sent by Atlassian JIRA (v6.3.4#6332)