Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2013-07-20 12:51:17 -0400
committerslewis2013-07-20 12:51:17 -0400
commit12e5cdad72f5132d290f71a73b63c96bfaf01e57 (patch)
tree287d67f6fdc76679a5c62d665c776e69cac9a6ef
parent78446d52c49413b1860ee721a5d19bcb6b9ecf32 (diff)
downloadorg.eclipse.ecf-12e5cdad72f5132d290f71a73b63c96bfaf01e57.tar.gz
org.eclipse.ecf-12e5cdad72f5132d290f71a73b63c96bfaf01e57.tar.xz
org.eclipse.ecf-12e5cdad72f5132d290f71a73b63c96bfaf01e57.zip
Added consumer.ds for timeservice example. Also added copyright notice
for all source code.
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.consumer.ds/.classpath7
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.consumer.ds/.gitignore1
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.consumer.ds/.project39
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.consumer.ds/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.consumer.ds/.settings/org.eclipse.pde.core.prefs3
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.consumer.ds/META-INF/MANIFEST.MF9
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.consumer.ds/OSGI-INF/timeservicecomponent.xml5
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.consumer.ds/build.properties6
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.consumer.ds/src/com/mycorp/examples/timeservice/consumer/ds/TimeServiceComponent.java23
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.consumer.filediscovery/launch/TimeServiceConsumer DS.launch26
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.consumer.filediscovery/launch/TimeServiceConsumer.launch (renamed from examples/bundles/com.mycorp.examples.timeservice.consumer.filediscovery/launch/TimeServiceConsumer(discovery=file).launch)0
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.consumer/src/com/mycorp/examples/timeservice/consumer/Activator.java9
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.host/src/com/mycorp/examples/timeservice/host/Activator.java8
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice.host/src/com/mycorp/examples/timeservice/host/TimeServiceImpl.java8
-rw-r--r--examples/bundles/com.mycorp.examples.timeservice/src/com/mycorp/examples/timeservice/ITimeService.java8
15 files changed, 159 insertions, 0 deletions
diff --git a/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/.classpath b/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/.classpath
new file mode 100644
index 000000000..64c5e31b7
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/.gitignore b/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/.gitignore
new file mode 100644
index 000000000..5e56e040e
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/.gitignore
@@ -0,0 +1 @@
+/bin
diff --git a/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/.project b/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/.project
new file mode 100644
index 000000000..ea7403dac
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/.project
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>com.mycorp.examples.timeservice.consumer.ds</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ds.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
+ </natures>
+</projectDescription>
diff --git a/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/.settings/org.eclipse.jdt.core.prefs b/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..af0f20f97
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/.settings/org.eclipse.pde.core.prefs b/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/.settings/org.eclipse.pde.core.prefs
new file mode 100644
index 000000000..f29e940a0
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/.settings/org.eclipse.pde.core.prefs
@@ -0,0 +1,3 @@
+eclipse.preferences.version=1
+pluginProject.extensions=false
+resolve.requirebundle=false
diff --git a/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/META-INF/MANIFEST.MF b/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..8a6c53c42
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/META-INF/MANIFEST.MF
@@ -0,0 +1,9 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Timeservice Consumer Declarative Services Example
+Bundle-SymbolicName: com.mycorp.examples.timeservice.consumer.ds
+Bundle-Version: 1.0.0.qualifier
+Bundle-Vendor: MyCorp, Inc.
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Service-Component: OSGI-INF/timeservicecomponent.xml
+Import-Package: com.mycorp.examples.timeservice;version="1.0.0"
diff --git a/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/OSGI-INF/timeservicecomponent.xml b/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/OSGI-INF/timeservicecomponent.xml
new file mode 100644
index 000000000..007eb84a6
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/OSGI-INF/timeservicecomponent.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" enabled="true" name="com.mycorp.examples.timeservice.consumer.ds">
+ <implementation class="com.mycorp.examples.timeservice.consumer.ds.TimeServiceComponent"/>
+ <reference bind="bindTimeService" cardinality="1..1" interface="com.mycorp.examples.timeservice.ITimeService" name="ITimeService" policy="dynamic"/>
+</scr:component>
diff --git a/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/build.properties b/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/build.properties
new file mode 100644
index 000000000..ed9702d9e
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/build.properties
@@ -0,0 +1,6 @@
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ OSGI-INF/timeservicecomponent.xml,\
+ OSGI-INF/
+source.. = src/
diff --git a/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/src/com/mycorp/examples/timeservice/consumer/ds/TimeServiceComponent.java b/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/src/com/mycorp/examples/timeservice/consumer/ds/TimeServiceComponent.java
new file mode 100644
index 000000000..bbca1c63d
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.timeservice.consumer.ds/src/com/mycorp/examples/timeservice/consumer/ds/TimeServiceComponent.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Composent, Inc. All rights reserved. This
+ * program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: Scott Lewis - initial API and implementation
+ ******************************************************************************/
+package com.mycorp.examples.timeservice.consumer.ds;
+
+import com.mycorp.examples.timeservice.ITimeService;
+
+public class TimeServiceComponent {
+
+ void bindTimeService(ITimeService timeService) {
+ System.out.println("Calling ITimeService discovered via DS. timeService="
+ + timeService);
+ // Call the service and print out result!
+ System.out
+ .println("Call Done. Current time given by ITimeService.getCurrentTime() is: "
+ + timeService.getCurrentTime());
+ }
+}
diff --git a/examples/bundles/com.mycorp.examples.timeservice.consumer.filediscovery/launch/TimeServiceConsumer DS.launch b/examples/bundles/com.mycorp.examples.timeservice.consumer.filediscovery/launch/TimeServiceConsumer DS.launch
new file mode 100644
index 000000000..53e5a0708
--- /dev/null
+++ b/examples/bundles/com.mycorp.examples.timeservice.consumer.filediscovery/launch/TimeServiceConsumer DS.launch
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.pde.ui.EquinoxLauncher">
+<booleanAttribute key="append.args" value="true"/>
+<booleanAttribute key="automaticAdd" value="false"/>
+<booleanAttribute key="automaticValidate" value="false"/>
+<stringAttribute key="bootstrap" value=""/>
+<stringAttribute key="checked" value="[NONE]"/>
+<booleanAttribute key="clearConfig" value="false"/>
+<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/TimeServiceConsumer DS (discovery=file)"/>
+<booleanAttribute key="default" value="true"/>
+<booleanAttribute key="default_auto_start" value="true"/>
+<intAttribute key="default_start_level" value="4"/>
+<booleanAttribute key="includeOptional" value="false"/>
+<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
+<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog -console"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Declipse.ignoreApp=true &#13;&#10;-Dosgi.noShutdown=true&#13;&#10;-DverboseRemoteServiceAdmin=true"/>
+<stringAttribute key="pde.version" value="3.3"/>
+<booleanAttribute key="show_selected_only" value="false"/>
+<stringAttribute key="target_bundles" value="javax.xml@default:default,org.apache.felix.gogo.command@default:default,org.apache.felix.gogo.runtime@default:default,org.apache.felix.gogo.shell@default:default,org.eclipse.core.jobs@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.console@default:default,org.eclipse.equinox.ds@1:true,org.eclipse.equinox.event@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.util@default:default,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true"/>
+<booleanAttribute key="tracing" value="false"/>
+<booleanAttribute key="useCustomFeatures" value="false"/>
+<booleanAttribute key="useDefaultConfigArea" value="true"/>
+<stringAttribute key="workspace_bundles" value="com.mycorp.examples.timeservice.consumer.ds@default:default,com.mycorp.examples.timeservice.consumer.filediscovery@default:false,com.mycorp.examples.timeservice@default:default,org.eclipse.ecf.discovery@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.ecf.osgi.services.distribution@default:default,org.eclipse.ecf.osgi.services.remoteserviceadmin.proxy@default:default,org.eclipse.ecf.osgi.services.remoteserviceadmin@default:default,org.eclipse.ecf.provider.remoteservice@default:default,org.eclipse.ecf.provider@default:default,org.eclipse.ecf.remoteservice@default:default,org.eclipse.ecf.sharedobject@default:default,org.eclipse.ecf@default:default,org.eclipse.equinox.concurrent@default:default,org.eclipse.osgi.services.remoteserviceadmin@default:default"/>
+</launchConfiguration>
diff --git a/examples/bundles/com.mycorp.examples.timeservice.consumer.filediscovery/launch/TimeServiceConsumer(discovery=file).launch b/examples/bundles/com.mycorp.examples.timeservice.consumer.filediscovery/launch/TimeServiceConsumer.launch
index b14dae44c..b14dae44c 100644
--- a/examples/bundles/com.mycorp.examples.timeservice.consumer.filediscovery/launch/TimeServiceConsumer(discovery=file).launch
+++ b/examples/bundles/com.mycorp.examples.timeservice.consumer.filediscovery/launch/TimeServiceConsumer.launch
diff --git a/examples/bundles/com.mycorp.examples.timeservice.consumer/src/com/mycorp/examples/timeservice/consumer/Activator.java b/examples/bundles/com.mycorp.examples.timeservice.consumer/src/com/mycorp/examples/timeservice/consumer/Activator.java
index 8c7fd795b..0d2b1e12e 100644
--- a/examples/bundles/com.mycorp.examples.timeservice.consumer/src/com/mycorp/examples/timeservice/consumer/Activator.java
+++ b/examples/bundles/com.mycorp.examples.timeservice.consumer/src/com/mycorp/examples/timeservice/consumer/Activator.java
@@ -1,3 +1,11 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Composent, Inc. All rights reserved. This
+ * program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: Scott Lewis - initial API and implementation
+ ******************************************************************************/
package com.mycorp.examples.timeservice.consumer;
import org.osgi.framework.BundleActivator;
@@ -39,6 +47,7 @@ public class Activator implements BundleActivator, ServiceTrackerCustomizer<ITim
*/
public ITimeService addingService(
ServiceReference<ITimeService> reference) {
+ // XXX Here is where the ITimeService is received, when discovered.
System.out.println("ITimeService discovered!");
System.out.println("Service Reference="+reference);
// Get the time service proxy
diff --git a/examples/bundles/com.mycorp.examples.timeservice.host/src/com/mycorp/examples/timeservice/host/Activator.java b/examples/bundles/com.mycorp.examples.timeservice.host/src/com/mycorp/examples/timeservice/host/Activator.java
index 0e2223870..61a4075df 100644
--- a/examples/bundles/com.mycorp.examples.timeservice.host/src/com/mycorp/examples/timeservice/host/Activator.java
+++ b/examples/bundles/com.mycorp.examples.timeservice.host/src/com/mycorp/examples/timeservice/host/Activator.java
@@ -1,3 +1,11 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Composent, Inc. All rights reserved. This
+ * program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: Scott Lewis - initial API and implementation
+ ******************************************************************************/
package com.mycorp.examples.timeservice.host;
import java.util.Dictionary;
diff --git a/examples/bundles/com.mycorp.examples.timeservice.host/src/com/mycorp/examples/timeservice/host/TimeServiceImpl.java b/examples/bundles/com.mycorp.examples.timeservice.host/src/com/mycorp/examples/timeservice/host/TimeServiceImpl.java
index 3225b4700..9c389f910 100644
--- a/examples/bundles/com.mycorp.examples.timeservice.host/src/com/mycorp/examples/timeservice/host/TimeServiceImpl.java
+++ b/examples/bundles/com.mycorp.examples.timeservice.host/src/com/mycorp/examples/timeservice/host/TimeServiceImpl.java
@@ -1,3 +1,11 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Composent, Inc. All rights reserved. This
+ * program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: Scott Lewis - initial API and implementation
+ ******************************************************************************/
package com.mycorp.examples.timeservice.host;
import com.mycorp.examples.timeservice.ITimeService;
diff --git a/examples/bundles/com.mycorp.examples.timeservice/src/com/mycorp/examples/timeservice/ITimeService.java b/examples/bundles/com.mycorp.examples.timeservice/src/com/mycorp/examples/timeservice/ITimeService.java
index ec09274c5..57fdf44b3 100644
--- a/examples/bundles/com.mycorp.examples.timeservice/src/com/mycorp/examples/timeservice/ITimeService.java
+++ b/examples/bundles/com.mycorp.examples.timeservice/src/com/mycorp/examples/timeservice/ITimeService.java
@@ -1,3 +1,11 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Composent, Inc. All rights reserved. This
+ * program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: Scott Lewis - initial API and implementation
+ ******************************************************************************/
package com.mycorp.examples.timeservice;
/**

Back to the top