From: Giovanni Meo Date: Tue, 4 Jun 2013 15:06:50 +0000 (+0200) Subject: Finalize the OSGi launcher for the opendaylight distribution X-Git-Tag: releasepom-0.1.0~390^2 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=0da481a10d9da80f2807a552d94e6f4eb8bfe729 Finalize the OSGi launcher for the opendaylight distribution In this commit following changes are being done: 1) Adjusted opendaylight-osgi-launcher-local.launch not to include bundles that are clustering.stub and protocol_plugin.stub because those are only meant for integration testing 2) Modifed the opendaylight.target to refer to an http repository so eventual problem with certificates will not be seen, using the https url of jenkins on some system has been causing problems because the root certificate for jenkins was not known. 3) Adjusted the opendaylight-osgi-launcher.launch not to include the bundles that are clustering.stub and protocol_plugin.stub because those are only meant for integration testing 4) Adjust the opendaylight-osgi-launcher.launch to make sure the jersey libraries startup soon else an harmless yet annoying error would be printed 5) Moved clusterin.test bundle off Declarative service else the OSGI-INF/component.xml location even though works for built done via maven will not work for builds done via eclipse PDE. Change-Id: Ic2f2196514dc8c7c5af419f81c6f46e7eb29aed1 Signed-off-by: Giovanni Meo --- diff --git a/opendaylight/clustering/test/pom.xml b/opendaylight/clustering/test/pom.xml index 695e939cd3..fb1efbb0f1 100644 --- a/opendaylight/clustering/test/pom.xml +++ b/opendaylight/clustering/test/pom.xml @@ -26,11 +26,13 @@ javax.transaction, org.eclipse.osgi.framework.console, ch.qos.logback.classic, - org.opendaylight.controller.clustering.services + org.opendaylight.controller.clustering.services, + org.opendaylight.controller.sal.core, + org.apache.felix.dm - - OSGI-INF/component.xml - + + org.opendaylight.controller.clustering.test.internal.Activator + ${project.basedir}/META-INF @@ -43,5 +45,10 @@ clustering.services 0.4.0-SNAPSHOT + + org.opendaylight.controller + sal + 0.4.0-SNAPSHOT + diff --git a/opendaylight/clustering/test/src/main/java/org/opendaylight/controller/clustering/test/internal/Activator.java b/opendaylight/clustering/test/src/main/java/org/opendaylight/controller/clustering/test/internal/Activator.java new file mode 100644 index 0000000000..341eacc4c6 --- /dev/null +++ b/opendaylight/clustering/test/src/main/java/org/opendaylight/controller/clustering/test/internal/Activator.java @@ -0,0 +1,73 @@ + +/* + * Copyright (c) 2013 Cisco Systems, Inc. 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 + */ + +package org.opendaylight.controller.clustering.test.internal; + +import org.opendaylight.controller.sal.core.ComponentActivatorAbstractBase; +import org.opendaylight.controller.clustering.services.IClusterServices; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.apache.felix.dm.Component; + +public class Activator extends ComponentActivatorAbstractBase { + protected static final Logger logger = LoggerFactory + .getLogger(Activator.class); + + /** + * Function called when the activator starts just after some + * initializations are done by the + * ComponentActivatorAbstractBase. + * + */ + public void init() { + } + + /** + * Function called when the activator stops just before the + * cleanup done by ComponentActivatorAbstractBase + * + */ + public void destroy() { + } + + /** + * Function that is used to communicate to dependency manager the + * list of known implementations for services inside a container + * + * + * @return An array containing all the CLASS objects that will be + * instantiated in order to get an fully working implementation + * Object + */ + public Object[] getGlobalImplementations() { + Object[] res = { SimpleClient.class }; + return res; + } + + /** + * Function that is called when configuration of the dependencies + * is required. + * + * @param c dependency manager Component object, used for + * configuring the dependencies exported and imported + * @param imp Implementation class that is being configured, + * needed as long as the same routine can configure multiple + * implementations + */ + public void configureGlobalInstance(Component c, Object imp) { + if (imp.equals(SimpleClient.class)) { + // export the service for Apps and Plugins + c.setInterface(new String[] { org.eclipse.osgi.framework.console.CommandProvider.class.getName() }, + null); + c.add(createServiceDependency().setService(IClusterServices.class) + .setCallbacks("setIClusterServices", "unsetIClusterServices") + .setRequired(true)); + } + } +} diff --git a/opendaylight/clustering/test/src/main/resources/OSGI-INF/component.xml b/opendaylight/clustering/test/src/main/resources/OSGI-INF/component.xml deleted file mode 100644 index df0e388e61..0000000000 --- a/opendaylight/clustering/test/src/main/resources/OSGI-INF/component.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - diff --git a/opendaylight/distribution/opendaylight/opendaylight-osgi-launcher-local.launch b/opendaylight/distribution/opendaylight/opendaylight-osgi-launcher-local.launch index 258373558a..af7bd4f951 100644 --- a/opendaylight/distribution/opendaylight/opendaylight-osgi-launcher-local.launch +++ b/opendaylight/distribution/opendaylight/opendaylight-osgi-launcher-local.launch @@ -11,6 +11,7 @@ + @@ -21,9 +22,9 @@ - + - + diff --git a/opendaylight/distribution/opendaylight/opendaylight-osgi-launcher.launch b/opendaylight/distribution/opendaylight/opendaylight-osgi-launcher.launch index a802ee3606..497db69f71 100644 --- a/opendaylight/distribution/opendaylight/opendaylight-osgi-launcher.launch +++ b/opendaylight/distribution/opendaylight/opendaylight-osgi-launcher.launch @@ -11,6 +11,7 @@ + @@ -21,9 +22,9 @@ - + - + diff --git a/opendaylight/distribution/opendaylight/opendaylight.target b/opendaylight/distribution/opendaylight/opendaylight.target index c714f56716..e3d1e5275d 100644 --- a/opendaylight/distribution/opendaylight/opendaylight.target +++ b/opendaylight/distribution/opendaylight/opendaylight.target @@ -1,85 +1,85 @@ - + - + + + + + + + + + + + + - + + + + + + + + + + + + + + + + - + + - - + + + + - - - + + + + + - + + + + + - + + + - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - + + + - - - - - - - + + + + + + +