Commit c2a19ac4 authored by Munilla Christophe's avatar Munilla Christophe

FraSCAti refactoring to use juliac_2.4.2

parent e293e7aa
......@@ -82,10 +82,13 @@
<extensions>true</extensions>
<configuration>
<instructions>
<_nouses>true</_nouses>
<Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
<Bundle-Name>${pom.name}</Bundle-Name>
<Bundle-Vendor>INRIA - University of Lille 1</Bundle-Vendor>
<Bundle-Description>${pom.name}</Bundle-Description>
<Import-Package>org.osgi.framework;version="1.3"</Import-Package>
<DynamicImport-Package>*</DynamicImport-Package>
</instructions>
</configuration>
</plugin>
......
<?xml version="1.0"?>
<!--
* OW2 FraSCAti OSGi
* Copyright (c) 2011 - 2012 Inria, University of Lille 1
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Contact: frascati@ow2.org
*
* Author: Christophe Munilla
*
* Contributor(s):
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.ow2.frascati.osgi.fio</groupId>
<artifactId>frascati-osgi-bundles</artifactId>
<version>1.5-SNAPSHOT</version>
</parent>
<artifactId>bundle-frascati-pojosr-util</artifactId>
<name>FraSCAti In OSGi Pojosr Resources Handler</name>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>org.ow2.frascati.osgi</groupId>
<artifactId>frascati-osgi-util</artifactId>
<version>1.5-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.ow2.frascati.osgi</groupId>
<artifactId>bundle-frascati-resources</artifactId>
<version>1.5-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<excludeDependencies>true</excludeDependencies>
<instructions>
<Export-Package>or.ow2.frascati.osgi.resource.pojosr</Export-Package>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project>
<?xml version="1.0"?>
<!--
* OW2 FraSCAti Examples: HelloWorld OSGi
*
* Copyright (c) 2011 INRIA, University of Lille 1
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Contact: frascati@ow2.org
*
* Author: Christophe Munilla
*
* Contributor(s): Philippe Merle
*
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>helloworld-osgi-runtime-parent</artifactId>
<groupId>org.ow2.frascati.examples</groupId>
<version>1.5-SNAPSHOT</version>
</parent>
<groupId>org.ow2.frascati.examples</groupId>
<artifactId>helloworld-osgi-concierge</artifactId>
<name>OW2 FraSCAti Examples: HelloWorld OSGi with Concierge</name>
<dependencies>
<dependency>
<groupId>org.ow2.frascati</groupId>
<artifactId>frascati-implementation-osgi-concierge</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<!-- ================================================ -->
<!-- Copy used OSGi bundles into target/classes -->
<!-- ================================================ -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
/**
* OW2 FraSCAti Examples: HelloWorld OSGi
* Copyright (C) 2011 INRIA, University of Lille 1
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Contact: frascati@ow2.org
*
* Author: Christophe Munilla
*
* Contributor(s):
*
*/
package org.ow2.frascati.examples.helloworld.osgi;
import org.junit.Test;
import org.ow2.frascati.examples.test.FraSCAtiTestCase;
public class HelloWorldTestCase
extends FraSCAtiTestCase
{
@Override
public final String getComposite()
{
return "helloworld-osgi";
}
@Test
public final void testService()
{
getService(Runnable.class, "r").run();
}
}
#
# Concierge 1.0.0
# Configuration file
#
-init
-all
#
# log configuration
#
-Dch.ethz.iks.concierge.debug=false
-Dch.ethz.iks.concierge.log.enabled=true
-Dch.ethz.iks.concierge.log.quiet=false
-Dch.ethz.iks.concierge.log.level=3
\ No newline at end of file
......@@ -45,6 +45,7 @@
<module>felix</module>
<module>knopflerfish</module>
<module>jboss</module>
<module>concierge</module>
</modules>
<properties>
......
<?xml version="1.0"?>
<!--
* OW2 FraSCAti: SCA Implementation OSGi with Concierge
*
* Copyright (c) 2010 INRIA, USTL
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Contact: frascati@ow2.org
*
* Author: Philippe Merle
*
* Contributor(s):
*
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<!-- ===================== -->
<!-- General Information -->
<!-- ===================== -->
<parent>
<groupId>org.ow2.frascati</groupId>
<artifactId>frascati-modules</artifactId>
<version>1.5-SNAPSHOT</version>
</parent>
<groupId>org.ow2.frascati</groupId>
<artifactId>frascati-implementation-osgi-concierge</artifactId>
<name>OW2 FraSCAti: SCA Implementation OSGi with Concierge Module</name>
<url>http://frascati.ow2.org/</url>
<inceptionYear>2007</inceptionYear>
<developers>
<developer>
<id>merle</id>
<name>Philippe Merle</name>
<email>Philippe.Merle@inria.fr</email>
<organization>INRIA</organization>
<organizationUrl>http://www.inria.fr</organizationUrl>
<roles>
<role>Architect</role>
<role>Developer</role>
</roles>
</developer>
</developers>
<!-- ========== -->
<!-- Properties -->
<!-- ========== -->
<properties>
</properties>
<!-- ======= -->
<!-- Build -->
<!-- ======= -->
<build>
<defaultGoal>install</defaultGoal>
<plugins>
</plugins>
</build>
<!-- ============ -->
<!-- Dependencies -->
<!-- ============ -->
<dependencies>
<!-- OW2 FraSCAti SCA Implementation OSGi Module. -->
<dependency>
<groupId>org.ow2.frascati</groupId>
<artifactId>frascati-implementation-osgi</artifactId>
<version>${project.version}</version>
</dependency>
<!-- OW2 Juliac Equinox Runtime. -->
<dependency>
<groupId>org.objectweb.fractal.juliac.osgi</groupId>
<artifactId>juliac-osgi-runtime-concierge</artifactId>
<version>${juliac.version}</version>
</dependency>
</dependencies>
<!-- ============= -->
<!-- Repositories -->
<!-- ============= -->
<repositories>
</repositories>
</project>
......@@ -72,10 +72,10 @@
<build>
<defaultGoal>install</defaultGoal>
<plugins>
</plugins>
</build>
<!-- ============ -->
......
......@@ -65,7 +65,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/ma
<properties>
</properties>
<!-- ======= -->
<!-- Build -->
<!-- ======= -->
......@@ -91,9 +90,9 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/ma
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.ow2.fractal.juliac.osgi</groupId>
<groupId>org.objectweb.fractal.juliac.osgi</groupId>
<artifactId>juliac-osgi-runtime-jboss</artifactId>
<version>2.5-SNAPSHOT</version>
<version>${juliac.version}</version>
</dependency>
</dependencies>
......
......@@ -57,14 +57,14 @@
</roles>
</developer>
</developers>
<!-- ========== -->
<!-- Properties -->
<!-- ========== -->
<properties>
</properties>
<!-- ======= -->
<!-- Build -->
<!-- ======= -->
......
......@@ -249,6 +249,7 @@
<module>frascati-implementation-bpel</module>
<module>frascati-implementation-fractal</module>
<module>frascati-implementation-osgi</module>
<module>frascati-implementation-osgi-concierge</module>
<module>frascati-implementation-osgi-equinox</module>
<module>frascati-implementation-osgi-felix</module>
<module>frascati-implementation-osgi-jboss</module>
......
......@@ -44,6 +44,12 @@
<version>1.5-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.osgi.core</artifactId>
<version>1.0.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
......
......@@ -25,9 +25,6 @@
*/
package org.ow2.frascati.osgi.introspect.api;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
/**
* A service which gives informations about registered bundles in a OSGI Framework
*/
......@@ -41,12 +38,7 @@ public interface IntrospectService
/**
* Return an array of bundles registered in the introspected BundleContext
*/
Bundle[] getBundles() throws Exception;
/**
* Return the introspected BundleContext
*/
BundleContext getBundleContext() throws Exception;
long[] getBundles() throws Exception;
/**
* Start the bundle which identifier is passed on as parameter
......
......@@ -58,7 +58,7 @@ public final class IntrospectImpl implements IntrospectService, BundleListener,
// ---------------------------------------------------------------------------
// Internal state.
// --------------------------------------------------------------------------
private static Logger log = Logger.getLogger(IntrospectImpl.class.getCanonicalName());
private static final Logger LOGGER = Logger.getLogger(IntrospectImpl.class.getCanonicalName());
/**
* The spied BundleContext
*/
......@@ -106,19 +106,16 @@ public final class IntrospectImpl implements IntrospectService, BundleListener,
*
* @see org.ow2.frascati.osgi.introspect.api.IntrospectService#getBundles()
*/
public final Bundle[] getBundles() throws Exception
public final long[] getBundles() throws Exception
{
return context.getBundles();
}
/**
* {@inheritDoc}
*
* @see org.ow2.frascati.osgi.introspect.api.IntrospectService#getBundleContext()
*/
public final BundleContext getBundleContext() throws Exception
{
return context;
Bundle[] bundles = context.getBundles();
long[] bundleIdentifiers = new long[bundles.length];
int identifierIndex = 0;
for(;identifierIndex<bundleIdentifiers.length;identifierIndex++)
{
bundleIdentifiers[identifierIndex] = bundles[identifierIndex].getBundleId();
}
return bundleIdentifiers;
}
/**
......@@ -203,12 +200,11 @@ public final class IntrospectImpl implements IntrospectService, BundleListener,
location = matcher.replaceAll("/");
} catch (PatternSyntaxException e)
{
log.log(Level.WARNING,e.getMessage(),e);
LOGGER.log(Level.WARNING,e.getMessage(),e);
}
location = new StringBuilder(protocol).append(prefix)
.append(location).toString();
}
System.out.println(location);
context.installBundle(location);
}
......
......@@ -47,6 +47,12 @@
<version>${osgi.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<version>${osgi.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
......
......@@ -28,10 +28,13 @@ package org.ow2.frascati.osgi.log.intermediate;
import java.util.ArrayList;
import java.util.List;
import java.util.Dictionary;
import org.osgi.service.log.LogEntry;
import org.osgi.service.log.LogListener;