-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request akka#2014 from trobert/master
Add the ability to use an external camel context
- Loading branch information
Showing
7 changed files
with
62 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
akka-camel/src/main/scala/akka/camel/ContextProvider.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** | ||
* Copyright (C) 2009-2014 Typesafe Inc. <http://www.typesafe.com> | ||
*/ | ||
package akka.camel | ||
|
||
import akka.actor.ExtendedActorSystem | ||
import org.apache.camel.impl.DefaultCamelContext | ||
|
||
/** | ||
* Implement this interface in order to inject a specific CamelContext in a system | ||
* An instance of this class must be instantiable using a no-arg constructor. | ||
*/ | ||
trait ContextProvider { | ||
/** | ||
* Retrieve or create a Camel Context for the given actor system | ||
* Called once per actor system | ||
*/ | ||
def getContext(system: ExtendedActorSystem): DefaultCamelContext | ||
} | ||
|
||
/** | ||
* Default implementation of [[akka.camel.ContextProvider]] | ||
* Provides a new DefaultCamelContext per actor system | ||
*/ | ||
final class DefaultContextProvider extends ContextProvider { | ||
override def getContext(system: ExtendedActorSystem) = new DefaultCamelContext | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters