aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbveliev2011-06-23 12:11:53 (EDT)
committerbveliev2011-06-23 12:11:53 (EDT)
commit0f05e28e27dfac866f1468eccac0e2b067a9f8ff (patch)
tree9e346ca3fd5251c8433747a9cf17cb8e74d3297a
parent46cf0da0f958d79e120b702adf9c171834e929c2 (diff)
downloadorg.eclipse.rtp-0f05e28e27dfac866f1468eccac0e2b067a9f8ff.zip
org.eclipse.rtp-0f05e28e27dfac866f1468eccac0e2b067a9f8ff.tar.gz
org.eclipse.rtp-0f05e28e27dfac866f1468eccac0e2b067a9f8ff.tar.bz2
bug 350166: Provide the configurator interface as OSGI service
https://bugs.eclipse.org/bugs/show_bug.cgi?id=350166
-rw-r--r--configurator/org.eclipse.rtp.configurator.console/META-INF/MANIFEST.MF3
-rw-r--r--configurator/org.eclipse.rtp.configurator.console/OSGI-INF/rtpConfiguratorServiceReference.xml5
-rw-r--r--configurator/org.eclipse.rtp.configurator.console/build.properties11
-rw-r--r--configurator/org.eclipse.rtp.configurator.console/src/org/eclipse/rtp/configurator/console/CommandDelegateImpl.java19
-rw-r--r--configurator/org.eclipse.rtp.configurator.service.provider/.classpath7
-rw-r--r--configurator/org.eclipse.rtp.configurator.service.provider/.project33
-rw-r--r--configurator/org.eclipse.rtp.configurator.service.provider/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--configurator/org.eclipse.rtp.configurator.service.provider/META-INF/MANIFEST.MF11
-rw-r--r--configurator/org.eclipse.rtp.configurator.service.provider/OSGI-INF/rtpConfiguratorServiceProvider.xml7
-rw-r--r--configurator/org.eclipse.rtp.configurator.service.provider/build.properties5
-rw-r--r--configurator/org.eclipse.rtp.configurator.service.provider/src/org/eclipse/rtp/configurator/service/provider/internal/DefaultConfiguratorService.java67
11 files changed, 170 insertions, 6 deletions
diff --git a/configurator/org.eclipse.rtp.configurator.console/META-INF/MANIFEST.MF b/configurator/org.eclipse.rtp.configurator.console/META-INF/MANIFEST.MF
index 49b031f..32522cb 100644
--- a/configurator/org.eclipse.rtp.configurator.console/META-INF/MANIFEST.MF
+++ b/configurator/org.eclipse.rtp.configurator.console/META-INF/MANIFEST.MF
@@ -6,4 +6,5 @@ Bundle-Version: 0.1.0.qualifier
Bundle-Vendor: EclipseSource
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: org.eclipse.osgi.framework.console;version="1.1.0"
-Service-Component: OSGI-INF/rtpCommandProviderComponent.xml
+Service-Component: OSGI-INF/rtpCommandProviderComponent.xml, OSGI-INF/rtpConfiguratorServiceReference.xml
+Require-Bundle: org.eclipes.rtp.configurator.core;bundle-version="1.0.0"
diff --git a/configurator/org.eclipse.rtp.configurator.console/OSGI-INF/rtpConfiguratorServiceReference.xml b/configurator/org.eclipse.rtp.configurator.console/OSGI-INF/rtpConfiguratorServiceReference.xml
new file mode 100644
index 0000000..25ad335
--- /dev/null
+++ b/configurator/org.eclipse.rtp.configurator.console/OSGI-INF/rtpConfiguratorServiceReference.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" name="org.eclipse.rtp.configurator.console">
+ <implementation class="org.eclipse.rtp.configurator.console.CommandDelegateImpl"/>
+ <reference bind="setUp" cardinality="1..1" interface="org.eclipse.rtp.configurator.core.IConfiguratorService" name="IConfiguratorService" policy="static" unbind="shutDown"/>
+</scr:component>
diff --git a/configurator/org.eclipse.rtp.configurator.console/build.properties b/configurator/org.eclipse.rtp.configurator.console/build.properties
index 6210e84..f66c9f7 100644
--- a/configurator/org.eclipse.rtp.configurator.console/build.properties
+++ b/configurator/org.eclipse.rtp.configurator.console/build.properties
@@ -1,5 +1,6 @@
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- OSGI-INF/
-source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ OSGI-INF/,\
+ OSGI-INF/rtpConfiguratorServiceReference.xml
+source.. = src/
diff --git a/configurator/org.eclipse.rtp.configurator.console/src/org/eclipse/rtp/configurator/console/CommandDelegateImpl.java b/configurator/org.eclipse.rtp.configurator.console/src/org/eclipse/rtp/configurator/console/CommandDelegateImpl.java
index 12c56ea..02d1b2a 100644
--- a/configurator/org.eclipse.rtp.configurator.console/src/org/eclipse/rtp/configurator/console/CommandDelegateImpl.java
+++ b/configurator/org.eclipse.rtp.configurator.console/src/org/eclipse/rtp/configurator/console/CommandDelegateImpl.java
@@ -11,9 +11,21 @@ package org.eclipse.rtp.configurator.console;
import java.util.List;
+import org.eclipse.rtp.configurator.core.IConfiguratorService;
+
public class CommandDelegateImpl implements CommandDelegate {
+ private static IConfiguratorService configurationService;
+
+ public static void setUp(IConfiguratorService service){
+ CommandDelegateImpl.configurationService = service;
+ }
+
+ public static void shutDown(IConfiguratorService service){
+ CommandDelegateImpl.configurationService = null;
+ }
+
@Override
public void unsupportedOperation( String operation ) {
/*
@@ -27,6 +39,7 @@ public class CommandDelegateImpl implements CommandDelegate {
* Should install an iu to the latest version. The name of the iu ist the first list entry.
* If the secodn entry is not a OSGI.version than the latest should be installed.
*/
+ configurationService.install( parameter );
}
@Override
@@ -34,6 +47,7 @@ public class CommandDelegateImpl implements CommandDelegate {
/*
* Updates a specific componennt. Same parameter as install
*/
+ configurationService.update( anyListOf );
}
@Override
@@ -41,6 +55,7 @@ public class CommandDelegateImpl implements CommandDelegate {
/*
* removes a spcific compoment. Same parameter as install
*/
+ configurationService.remove( anyListOf );
}
@Override
@@ -49,6 +64,7 @@ public class CommandDelegateImpl implements CommandDelegate {
* Should list the available components in the rtp repos which where searched.
* A phonetic search should be done.
*/
+ configurationService.search( anyListOf );
}
@Override
@@ -57,6 +73,7 @@ public class CommandDelegateImpl implements CommandDelegate {
* Show details of a specific component e.g. Dependencies, available version, size and so on.
* Only one parameter = existing name of component
*/
+ configurationService.show( anyListOf );
}
@Override
@@ -64,6 +81,7 @@ public class CommandDelegateImpl implements CommandDelegate {
/*
* Should list all IUs in the rtp repos.
*/
+ configurationService.list();
}
@Override
@@ -78,6 +96,7 @@ public class CommandDelegateImpl implements CommandDelegate {
/*
* Should refresh the avalaible repos.
*/
+ configurationService.refresh();
}
}
diff --git a/configurator/org.eclipse.rtp.configurator.service.provider/.classpath b/configurator/org.eclipse.rtp.configurator.service.provider/.classpath
new file mode 100644
index 0000000..8a8f166
--- /dev/null
+++ b/configurator/org.eclipse.rtp.configurator.service.provider/.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/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/configurator/org.eclipse.rtp.configurator.service.provider/.project b/configurator/org.eclipse.rtp.configurator.service.provider/.project
new file mode 100644
index 0000000..b6b8a8e
--- /dev/null
+++ b/configurator/org.eclipse.rtp.configurator.service.provider/.project
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.rtp.configurator.service.provider</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.ds.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/configurator/org.eclipse.rtp.configurator.service.provider/.settings/org.eclipse.jdt.core.prefs b/configurator/org.eclipse.rtp.configurator.service.provider/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..be2d1c9
--- /dev/null
+++ b/configurator/org.eclipse.rtp.configurator.service.provider/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Thu Jun 23 15:07:09 CEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/configurator/org.eclipse.rtp.configurator.service.provider/META-INF/MANIFEST.MF b/configurator/org.eclipse.rtp.configurator.service.provider/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..d3bae12
--- /dev/null
+++ b/configurator/org.eclipse.rtp.configurator.service.provider/META-INF/MANIFEST.MF
@@ -0,0 +1,11 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Configurator Service Provider
+Bundle-SymbolicName: org.eclipse.rtp.configurator.service.provider
+Bundle-Version: 1.0.0.qualifier
+Bundle-Vendor: EclipseSource
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipes.rtp.configurator.core;bundle-version="1.0.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy
+Service-Component: OSGI-INF/rtpConfiguratorServiceProvider.xml
diff --git a/configurator/org.eclipse.rtp.configurator.service.provider/OSGI-INF/rtpConfiguratorServiceProvider.xml b/configurator/org.eclipse.rtp.configurator.service.provider/OSGI-INF/rtpConfiguratorServiceProvider.xml
new file mode 100644
index 0000000..b8167c0
--- /dev/null
+++ b/configurator/org.eclipse.rtp.configurator.service.provider/OSGI-INF/rtpConfiguratorServiceProvider.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.rtp.configurator.service.provider">
+ <implementation class="org.eclipse.rtp.configurator.service.provider.internal.DefaultConfiguratorService"/>
+ <service>
+ <provide interface="org.eclipse.rtp.configurator.core.IConfiguratorService"/>
+ </service>
+</scr:component>
diff --git a/configurator/org.eclipse.rtp.configurator.service.provider/build.properties b/configurator/org.eclipse.rtp.configurator.service.provider/build.properties
new file mode 100644
index 0000000..a70e9f2
--- /dev/null
+++ b/configurator/org.eclipse.rtp.configurator.service.provider/build.properties
@@ -0,0 +1,5 @@
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ OSGI-INF/rtpConfiguratorServiceProvider.xml
+source.. = src/
diff --git a/configurator/org.eclipse.rtp.configurator.service.provider/src/org/eclipse/rtp/configurator/service/provider/internal/DefaultConfiguratorService.java b/configurator/org.eclipse.rtp.configurator.service.provider/src/org/eclipse/rtp/configurator/service/provider/internal/DefaultConfiguratorService.java
new file mode 100644
index 0000000..14914cd
--- /dev/null
+++ b/configurator/org.eclipse.rtp.configurator.service.provider/src/org/eclipse/rtp/configurator/service/provider/internal/DefaultConfiguratorService.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+* Copyright (c) 2011 EclipseSource and others. 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:
+* EclipseSource - initial API and implementation
+*******************************************************************************/
+package org.eclipse.rtp.configurator.service.provider.internal;
+
+import java.util.List;
+
+import org.eclipse.rtp.configurator.core.IConfiguratorService;
+
+public class DefaultConfiguratorService implements IConfiguratorService{
+
+
+ @Override
+ public void install(List<String> parameter) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void update(List<String> anyListOf) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void remove(List<String> anyListOf) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void search(List<String> anyListOf) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void show(List<String> anyListOf) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void list() {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void updateWorld() {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void refresh() {
+ // TODO Auto-generated method stub
+
+ }
+
+}