Author: ningjiang
Date: Mon Nov 2 10:21:15 2009
New Revision: 831845
URL: http://svn.apache.org/viewvc?rev=831845&view=rev
Log:
CAMLE-2117 added activator to start the example from ServiceMix
Added:
camel/trunk/examples/camel-example-guice-jms/src/main/java/org/apache/camel/example/guice/jms/MyActivator.java
(with props)
Modified:
camel/trunk/examples/camel-example-guice-jms/pom.xml
Modified: camel/trunk/examples/camel-example-guice-jms/pom.xml
URL:
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-guice-jms/pom.xml?rev=831845&r1=831844&r2=831845&view=diff
==============================================================================
--- camel/trunk/examples/camel-example-guice-jms/pom.xml (original)
+++ camel/trunk/examples/camel-example-guice-jms/pom.xml Mon Nov 2 10:21:15
2009
@@ -34,6 +34,7 @@
<properties>
<camel.osgi.export.pkg>org.apache.camel.example.guice.jms.*</camel.osgi.export.pkg>
+
<camel.osgi.activator>org.apache.camel.example.guice.jms.MyActivator</camel.osgi.activator>
</properties>
<dependencies>
@@ -56,12 +57,18 @@
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-core</artifactId>
</dependency>
+
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ <version>4.0.1</version>
+ </dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</dependency>
-
+
<!-- for testing -->
<dependency>
<groupId>junit</groupId>
Added:
camel/trunk/examples/camel-example-guice-jms/src/main/java/org/apache/camel/example/guice/jms/MyActivator.java
URL:
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-guice-jms/src/main/java/org/apache/camel/example/guice/jms/MyActivator.java?rev=831845&view=auto
==============================================================================
---
camel/trunk/examples/camel-example-guice-jms/src/main/java/org/apache/camel/example/guice/jms/MyActivator.java
(added)
+++
camel/trunk/examples/camel-example-guice-jms/src/main/java/org/apache/camel/example/guice/jms/MyActivator.java
Mon Nov 2 10:21:15 2009
@@ -0,0 +1,39 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.example.guice.jms;
+
+import org.apache.camel.guice.Main;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class MyActivator implements BundleActivator {
+ private Main mainInstance;
+
+ public void start(BundleContext context) throws Exception {
+ // start the camel context
+ mainInstance = new Main();
+ mainInstance.start();
+ }
+
+ public void stop(BundleContext context) throws Exception {
+ // stop the camel context
+ if (mainInstance != null) {
+ mainInstance.stop();
+ }
+ }
+
+}
Propchange:
camel/trunk/examples/camel-example-guice-jms/src/main/java/org/apache/camel/example/guice/jms/MyActivator.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
camel/trunk/examples/camel-example-guice-jms/src/main/java/org/apache/camel/example/guice/jms/MyActivator.java
------------------------------------------------------------------------------
svn:keywords = Rev Date