This is an automated email from the ASF dual-hosted git repository. pascalschumacher pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push: new 044a81e Remove deleted camel-guice component from user manual. 044a81e is described below commit 044a81e4e0ee01513bb6d013a0c5522a8b6be321 Author: Pascal Schumacher <pascalschumac...@gmx.net> AuthorDate: Thu Sep 12 11:05:59 2019 +0200 Remove deleted camel-guice component from user manual. --- .../modules/ROOT/pages/dependency-injection.adoc | 3 +- .../ROOT/pages/faq/is-camel-ioc-friendly.adoc | 4 +- .../modules/ROOT/pages/faq/what-is-camel.adoc | 6 +- ...use-too-many-threads-with-producertemplate.adoc | 2 +- docs/user-manual/modules/ROOT/pages/guice.adoc | 147 --------------------- docs/user-manual/modules/ROOT/pages/index.adoc | 2 - docs/user-manual/modules/ROOT/pages/injector.adoc | 2 +- docs/user-manual/modules/ROOT/pages/testing.adoc | 7 +- 8 files changed, 11 insertions(+), 162 deletions(-) diff --git a/docs/user-manual/modules/ROOT/pages/dependency-injection.adoc b/docs/user-manual/modules/ROOT/pages/dependency-injection.adoc index 0ba8f57..95ae2d9 100644 --- a/docs/user-manual/modules/ROOT/pages/dependency-injection.adoc +++ b/docs/user-manual/modules/ROOT/pages/dependency-injection.adoc @@ -8,9 +8,8 @@ popular Dependency Injection libraries available at the time of writing are * Spring -* Guice * CDI Camel is developed such that any Dependency Injection framework can be used easily - though we've tried hard to optimise Camel for both -Spring,CDI and Guice +Spring and CDI. diff --git a/docs/user-manual/modules/ROOT/pages/faq/is-camel-ioc-friendly.adoc b/docs/user-manual/modules/ROOT/pages/faq/is-camel-ioc-friendly.adoc index 8c1f1c0..e5dcc73 100644 --- a/docs/user-manual/modules/ROOT/pages/faq/is-camel-ioc-friendly.adoc +++ b/docs/user-manual/modules/ROOT/pages/faq/is-camel-ioc-friendly.adoc @@ -37,8 +37,8 @@ For example camel-core has no dependencies on anything other than commons-logging; camel-spring contains all the xref:components::spring.adoc[Spring] integration, etc. -We hope to have closer integration to other IoC containers, particularly -with Guice. The current mechanism for hooking into other IoC containers +We hope to have closer integration to other IoC containers. +The current mechanism for hooking into other IoC containers are: * xref:injector.adoc[Injector] is used to perform dependency injection diff --git a/docs/user-manual/modules/ROOT/pages/faq/what-is-camel.adoc b/docs/user-manual/modules/ROOT/pages/faq/what-is-camel.adoc index 3026243..2d7ce08 100644 --- a/docs/user-manual/modules/ROOT/pages/faq/what-is-camel.adoc +++ b/docs/user-manual/modules/ROOT/pages/faq/what-is-camel.adoc @@ -28,9 +28,9 @@ out-of-box. Apache Camel provides support for xref:bean-binding.adoc[Bean Binding] and seamless integration with popular frameworks such as -xref:components::cdi.adoc[CDI], xref:spring.adoc[Spring], -xref:using-osgi-blueprint-with-camel.adoc[Blueprint] and -xref:guice.adoc[Guice]. Camel also has extensive support for +xref:components::cdi.adoc[CDI], xref:spring.adoc[Spring] and +xref:using-osgi-blueprint-with-camel.adoc[Blueprint]. +Camel also has extensive support for xref:testing.adoc[unit testing] your routes. The following projects can leverage Apache Camel as a routing and diff --git a/docs/user-manual/modules/ROOT/pages/faq/why-does-camel-use-too-many-threads-with-producertemplate.adoc b/docs/user-manual/modules/ROOT/pages/faq/why-does-camel-use-too-many-threads-with-producertemplate.adoc index a02b070..754b0e9 100644 --- a/docs/user-manual/modules/ROOT/pages/faq/why-does-camel-use-too-many-threads-with-producertemplate.adoc +++ b/docs/user-manual/modules/ROOT/pages/faq/why-does-camel-use-too-many-threads-with-producertemplate.adoc @@ -12,7 +12,7 @@ Also when you have finished using the `ProducerTemplate` you should call the `stop()` method to close down all the resources it has been using. It's better to either explicitly create one on startup or get your IoC -container (xref:components::spring.adoc[Spring] or xref:guice.adoc[Guice]) to inject +container (xref:components::spring.adoc[Spring]) to inject it into your `Processor` or bean then it can take care of creating it and destroying all the resources when you have finished with it. diff --git a/docs/user-manual/modules/ROOT/pages/guice.adoc b/docs/user-manual/modules/ROOT/pages/guice.adoc deleted file mode 100644 index 41c2e75..0000000 --- a/docs/user-manual/modules/ROOT/pages/guice.adoc +++ /dev/null @@ -1,147 +0,0 @@ -[[Guice-CamelGuice]] -= Camel Guice - -We have support for https://github.com/google/guice[Google Guice] -as a dependency injection framework. - -Maven users will need to add the following dependency to their `pom.xml` -for this component: - -[source,xml] ----- -<dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-guice</artifactId> - <version>x.x.x</version> - <!-- use the same version as your Camel core version --> -</dependency> ----- - -[[Guice-DependencyInjectingCamelwithGuice]] -== Dependency Injecting Camel with Guice - -The -http://camel.apache.org/maven/current/camel-guice/apidocs/org/apache/camel/guice/GuiceCamelContext.html[GuiceCamelContext] -is designed to work nicely inside Guice. You then need to bind it using -some Guice Module. - -The camel-guice library comes with a number of reusable Guice Modules -you can use if you wish - or you can bind the GuiceCamelContext yourself -in your own module. - -* http://camel.apache.org/maven/current/camel-guice/apidocs/org/apache/camel/guice/CamelModule.html[CamelModule] -is the base module which binds the GuiceCamelContext but leaves it up -you to bind the RouteBuilder instances -* http://camel.apache.org/maven/current/camel-guice/apidocs/org/apache/camel/guice/CamelModuleWithRouteTypes.html[CamelModuleWithRouteTypes] -extends CamelModule so that in the constructor of the module you specify -the RouteBuilder classes or instances to use -* http://camel.apache.org/maven/current/camel-guice/apidocs/org/apache/camel/guice/CamelModuleWithMatchingRoutes.html[CamelModuleWithMatchingRoutes] -extends CamelModule so that all bound RouteBuilder instances will be -injected into the CamelContext or you can supply an optional Matcher to -find RouteBuilder instances matching some kind of predicate. - -So you can specify the exact xref:route-builder.adoc[RouteBuilder] -instances you want: - -[source,java] ----- -Injector injector = Guice.createInjector(new CamelModuleWithRouteTypes(MyRouteBuilder.class, AnotherRouteBuilder.class)); -// if required you can lookup the CamelContext -CamelContext camelContext = injector.getInstance(CamelContext.class); ----- - -Or inject them all: - -[source,java] ----- -Injector injector = Guice.createInjector(new CamelModuleWithRouteTypes()); -// if required you can lookup the CamelContext -CamelContext camelContext = injector.getInstance(CamelContext.class); ----- - -You can then use Guice in the usual way to inject the route instances or -any other dependent objects. - -[[Guice-BootstrappingwithJNDI]] -== Bootstrapping with JNDI - -A common pattern used in J2EE is to bootstrap your application or root -objects by looking them up in JNDI. This has long been the approach when -working with JMS for example - looking up the JMS ConnectionFactory in -JNDI for example. - -You can follow a similar pattern with Guice using the -https://code.google.com/archive/p/guiceyfruit/wikis/JNDI.wiki[GuiceyFruit JNDI -Provider] which lets you bootstrap Guice from a `jndi.properties` file -which can include the Guice Modules to create along with environment -specific properties you can inject into your modules and objects. - -If the `jndi.properties` is conflict with other component, you can -specify the jndi properties file name in the Guice Main with option `-j` -or `-jndiProperties` with the properties file location to let Guice Main -to load right jndi properties file. - -[[Guice-ConfiguringComponent,EndpointorRouteBuilderinstances]] -== Configuring Component, Endpoint or RouteBuilder instances - -You can use Guice to dependency inject whatever objects -you need to create, be it an xref:endpoint.adoc[Endpoint], -xref:component.adoc[Component], xref:route-builder.adoc[RouteBuilder] or -arbitrary xref:bean-integration.adoc[bean used within a route]. - -The easiest way to do this is to create your own Guice Module class -which extends one of the above module classes and add a provider method -for each object you wish to create. A provider method is annotated with -`@Provides` as follows: - -[source,java] ----- -public class MyModule extends CamelModuleWithMatchingRoutes { - - @Provides - @JndiBind("jms") - JmsComponent jms(@Named("activemq.brokerURL") String brokerUrl) { - return JmsComponent.jmsComponent(new ActiveMQConnectionFactory(brokerUrl)); - } -} ----- - -You can optionally annotate the method with `@JndiBind` to bind the -object to JNDI at some name if the object is a component, endpoint or -bean you wish to refer to by name in your routes. - -You can inject any environment specific properties (such as URLs, -machine names, usernames/passwords and so forth) from the -`jndi.properties` file easily using the `@Named` annotation as shown -above. This allows most of your configuration to be in Java code which -is typesafe and easily refactorable - then leaving some properties to be -environment specific (the `jndi.properties` file) which you can then -change based on development, testing, production, etc. - -[[Guice-CreatingmultipleRouteBuilderinstancespertype]] -== Creating multiple RouteBuilder instances per type - -It is sometimes useful to create multiple instances of a particular -xref:route-builder.adoc[RouteBuilder] with different configurations. - -To do this just create multiple provider methods for each configuration; -or create a single provider method that returns a collection of -RouteBuilder instances. - -For example: - -[source,java] ----- -import org.apache.camel.guice.CamelModuleWithMatchingRoutes; -import com.google.common.collect.Lists; - -public class MyModule extends CamelModuleWithMatchingRoutes { - - @Provides - @JndiBind("foo") - Collection<RouteBuilder> foo(@Named("fooUrl") String fooUrl) { - return Lists.newArrayList(new MyRouteBuilder(fooUrl), new MyRouteBuilder("activemq:CheeseQueue")); - } -} ----- - diff --git a/docs/user-manual/modules/ROOT/pages/index.adoc b/docs/user-manual/modules/ROOT/pages/index.adoc index 104d1d6..25192ba 100644 --- a/docs/user-manual/modules/ROOT/pages/index.adoc +++ b/docs/user-manual/modules/ROOT/pages/index.adoc @@ -36,7 +36,6 @@ * xref:camel-boot.adoc[Camel Boot] * xref:components::cdi.adoc[Working with Camel and CDI] * xref:spring.adoc[Working with Camel and Spring] -* xref:guice.adoc[Working with Camel and Guice] * xref:karaf.adoc[Working with Camel and Karaf] * xref:faq/how-do-i-configure-endpoints.adoc[How do I configure endpoints?] * xref:bean-integration.adoc[Bean Integration] @@ -55,7 +54,6 @@ asynchronous * [Using CamelProxy] for how to use proxies for clients to easily invoke camel routes without them knowing * [Camel Maven Plugin] for running Camel from a Maven goal -* [Guice Maven Plugin] for working with xref:guice.adoc[Guice] * [Camel Maven Archetypes] * [Creating a new Spring based Camel Route] * [Camel JMX] diff --git a/docs/user-manual/modules/ROOT/pages/injector.adoc b/docs/user-manual/modules/ROOT/pages/injector.adoc index 18ce2dc..a1c6d0e 100644 --- a/docs/user-manual/modules/ROOT/pages/injector.adoc +++ b/docs/user-manual/modules/ROOT/pages/injector.adoc @@ -4,7 +4,7 @@ The http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/spi/Injector.html[Injector] is a pluggable strategy to any IoC container such as -Spring or Guice to be able to create and +Spring to be able to create and dependency-inject objects of a certain type. For example if you are using the diff --git a/docs/user-manual/modules/ROOT/pages/testing.adoc b/docs/user-manual/modules/ROOT/pages/testing.adoc index 40bc8ae..46d3c1f 100644 --- a/docs/user-manual/modules/ROOT/pages/testing.adoc +++ b/docs/user-manual/modules/ROOT/pages/testing.adoc @@ -36,10 +36,9 @@ The following mechanisms are supported |Name |Component |Description |Camel Test |camel-test |Is a standalone Java library letting you easily create Camel test cases using a single Java -class for all your configuration and routing without using CDI, -Spring or Guice for +class for all your configuration and routing without using CDI or Spring for Dependency Injection which does not -require an in-depth knowledge of CDI, Spring + Spring Test or Guice. +require an in-depth knowledge of CDI or Spring + Spring Test. Supports JUnit 3.x (deprecated) and JUnit 4.x based tests. |CDI Testing |camel-test-cdi | Provides a JUnit 4 @@ -85,7 +84,7 @@ include::{examplesdir}/core/camel-core/src/test/java/org/apache/camel/processor/ ---- Notice how it derives from the Camel helper class `CamelTestSupport` but -has no CDI, Spring or Guice dependency injection configuration but instead +has no CDI or Spring dependency injection configuration but instead overrides the `createRouteBuilder()` method. [[Testing-CdiTestExample]]