summaryrefslogtreecommitdiffstats
path: root/sandbox/slaws/jms-osgi/jms-osgi/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox/slaws/jms-osgi/jms-osgi/src/main/java')
-rw-r--r--sandbox/slaws/jms-osgi/jms-osgi/src/main/java/calculator/CalculatorActivator.java4
-rw-r--r--sandbox/slaws/jms-osgi/jms-osgi/src/main/java/sample/Helloworld.java28
-rw-r--r--sandbox/slaws/jms-osgi/jms-osgi/src/main/java/sample/HelloworldActivator.java50
-rw-r--r--sandbox/slaws/jms-osgi/jms-osgi/src/main/java/sample/HelloworldImpl.java29
4 files changed, 109 insertions, 2 deletions
diff --git a/sandbox/slaws/jms-osgi/jms-osgi/src/main/java/calculator/CalculatorActivator.java b/sandbox/slaws/jms-osgi/jms-osgi/src/main/java/calculator/CalculatorActivator.java
index 5e65623761..1c7a9bec51 100644
--- a/sandbox/slaws/jms-osgi/jms-osgi/src/main/java/calculator/CalculatorActivator.java
+++ b/sandbox/slaws/jms-osgi/jms-osgi/src/main/java/calculator/CalculatorActivator.java
@@ -35,8 +35,8 @@ public class CalculatorActivator implements BundleActivator {
public void start(BundleContext context) throws Exception {
logger.info("Starting " + context.getBundle());
- Node node = TuscanyRuntime.runComposite("Calculator.composite", context.getBundle().getLocation());
- node.stop();
+ //Node node = TuscanyRuntime.runComposite("Calculator.composite", context.getBundle().getLocation());
+ //node.stop();
}
public void stop(BundleContext context) throws Exception {
diff --git a/sandbox/slaws/jms-osgi/jms-osgi/src/main/java/sample/Helloworld.java b/sandbox/slaws/jms-osgi/jms-osgi/src/main/java/sample/Helloworld.java
new file mode 100644
index 0000000000..f4e8c50448
--- /dev/null
+++ b/sandbox/slaws/jms-osgi/jms-osgi/src/main/java/sample/Helloworld.java
@@ -0,0 +1,28 @@
+/*
+ * 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 sample;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface Helloworld {
+
+ String sayHello(String name);
+
+}
diff --git a/sandbox/slaws/jms-osgi/jms-osgi/src/main/java/sample/HelloworldActivator.java b/sandbox/slaws/jms-osgi/jms-osgi/src/main/java/sample/HelloworldActivator.java
new file mode 100644
index 0000000000..46f74c0f68
--- /dev/null
+++ b/sandbox/slaws/jms-osgi/jms-osgi/src/main/java/sample/HelloworldActivator.java
@@ -0,0 +1,50 @@
+/*
+ * 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 sample;
+
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+import java.util.logging.Logger;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+/**
+ *
+ */
+public class HelloworldActivator implements BundleActivator {
+ private Logger logger = Logger.getLogger(HelloworldActivator.class.getName());
+
+ public void start(BundleContext context) throws Exception {
+ logger.info("Starting " + context.getBundle());
+
+ Dictionary<String, Object> props = new Hashtable<String, Object>();
+
+ logger.info("Registering " + Helloworld.class.getName());
+ props.put("sca.service", "HelloworldComponent#service-name(HelloworldService)");
+ context.registerService(Helloworld.class.getName(), new HelloworldImpl(), props);
+ }
+
+ public void stop(BundleContext context) throws Exception {
+ logger.info("Stopping " + context.getBundle());
+ // Registered services will be automatically unregistered
+ }
+}
diff --git a/sandbox/slaws/jms-osgi/jms-osgi/src/main/java/sample/HelloworldImpl.java b/sandbox/slaws/jms-osgi/jms-osgi/src/main/java/sample/HelloworldImpl.java
new file mode 100644
index 0000000000..01b2b1197d
--- /dev/null
+++ b/sandbox/slaws/jms-osgi/jms-osgi/src/main/java/sample/HelloworldImpl.java
@@ -0,0 +1,29 @@
+/*
+ * 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 sample;
+
+public class HelloworldImpl implements Helloworld {
+
+ public String sayHello(String name) {
+ String returnString = "Hello " + name;
+ System.out.println(returnString);
+ return returnString;
+ }
+
+}