You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2013/12/09 03:31:46 UTC
git commit: CAMEL-4817 properly close datastore on doStop in
GoraComponent
Updated Branches:
refs/heads/camel-gora c88e547cc -> 2be953c6d
CAMEL-4817 properly close datastore on doStop in GoraComponent
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/2be953c6
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/2be953c6
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/2be953c6
Branch: refs/heads/camel-gora
Commit: 2be953c6dd6d1845f1ad2e7ef4ace9c7ed32430e
Parents: c88e547
Author: Willem Jiang <wi...@gmail.com>
Authored: Mon Dec 9 10:30:47 2013 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Mon Dec 9 10:31:27 2013 +0800
----------------------------------------------------------------------
.../camel/component/gora/GoraComponent.java | 26 +++++++++++++++++---
1 file changed, 23 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/2be953c6/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraComponent.java b/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraComponent.java
index 0a162fd..6a2a063 100644
--- a/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraComponent.java
+++ b/components/camel-gora/src/main/java/org/apache/camel/component/gora/GoraComponent.java
@@ -55,12 +55,11 @@ public class GoraComponent extends DefaultComponent {
*
* Initialize class and create DataStore instance
*
- * @param config component configuration
+ * @param config component configuration
* @throws IOException
*/
private void init(final GoraConfiguration config) throws IOException {
-
- this.configuration = new Configuration();
+
this.goraProperties = DataStoreFactory.createProps();
this.dataStore = DataStoreFactory.getDataStore(goraProperties.getProperty(GORA_DEFAULT_DATASTORE_KEY,
@@ -101,5 +100,26 @@ public class GoraComponent extends DefaultComponent {
return dataStore;
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void doStart() throws Exception {
+ if (configuration == null) {
+ configuration = new Configuration();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void doStop() throws Exception {
+
+ if (dataStore != null) {
+ dataStore.close();
+ }
+ }
}
\ No newline at end of file