Commit 1d1e5f56 authored by Munilla Christophe's avatar Munilla Christophe

add osgi sub-modules

parent bd1df4cb
============================================================================
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
============================================================================
FraSCAti & OSGi:
----------------
Knopflerfish, Felix, Equinox and JBoss-osgi are the functional OSGi implementations
Compilation with Maven:
-----------------------
mvn install
Binding OSGi use:
----------------
"filter" attribute for binded interface :
syntax :
cf. http://www.ietf.org/rfc/rfc1960.txt
[&,|,!] have to be respectively replaced by [and,or,not]
"properties" attribute for exported interface :
syntax :
properties := property[,properties]
property := <key>=<value>
OSGi in FraSCAti:
----------------
Execution with Maven:
---------------------
See osgi-in-frascati/osgi tests to use it
FraSCAti in OSGi:
----------------
The frascati-modules subproject contains bindings and implementations bundles usable with FraSCAti
in OSGi. The frascati-core bundle contains shared artifacts and FraSCati core libraries. It is
needed to launch a FraSCati instance in an OSGi environment. To define which bundles are deployed
use the install_bundles.xml file which can be found in the osgi framework implementation's resources
directory. A property entry is jar file name and boolean value colon-separated. The boolean value
define if the bundle has to be installed (look at the install_bundles.xml file as an example).
implementation-osgi and binding-osgi have been added to the FraSCAti core libraries and are
automatically available;
POM headers :
-------------
Eight new pom headers have been defined :
Frascati-Fragment : Is the bundle a FraSCAti Fragment (true) ?
Frascati-Bootstrap : Define a bootstrap class name
Frascati-BootstrapOverwrite : Define overwritten bootstrap class name(s)
Frascati-FragmentNeed : Needed FraSCAti's fragment(s)
Frascati-BundleNeed : Needed Bundle(s)
Frascati-Unmanaged : List of embedded resources to not handle
Frascati-JTCompil : List of embedded resources to cache for compilation process
Frascati-Process : List of embedded composite files names to process
Available bundles are :
----------------------------
- binding-rmi
- binding-jsonrpc
- binding-ws
- binding-http
- binding-jms
- binding-rest
- frascati-explorer
- frascati-introspection
- frascati-velocity
- frascati-web-explorer
- implementation-scripts
- implementation-xquery
- implementation-spring
- implementation-bpel
Some bundles are still in progress :
----------------------------------
- frascati-fscript
- frascati-introspection-fscript
Problems exist using bundles together :
-------------------------------------
- implementation-xquery cannot be used with implementation-bpel because of
incompatible net-sf-saxon libraries
- frascati-introspection used with the frascati-explorer causes explorer's frame
not shown
- implementation-bpel interfere with implementation-script : if the bpel engine has
been instantiated (explorer selection or example loaded) the script example causes
an error
Todo :
- finish unusable bundles (fscripts,..)
- complete frascati-modules bundles (module-gcs, module-upnp, module-native,...)
- add Concierge to the list of functional OSGi implementations
Execution with Maven:
---------------------
See frascati-in-osgi/osgi tests to use it
ps : put the boolean value of the install_bundles.xml file's entry to true
<?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</groupId>
<artifactId>parent</artifactId>
<version>1.5-SNAPSHOT</version>
</parent>
<artifactId>frascati-osgi-api-service</artifactId>
<name>frascati-osgi-api-service</name>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>org.ow2.frascati.osgi</groupId>
<artifactId>frascati-osgi-resources</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
/**
* 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):
*
*/
package org.ow2.frascati.osgi.api.service;
/**
* Thrown if an error occured while looking for a Component
*/
public class FraSCAtiOSGiNotFoundCompositeException extends Exception
{
/**
* Generated serial ID
*/
private static final long serialVersionUID = 4463123423065271523L;
}
/**
* 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):
*
*/
package org.ow2.frascati.osgi.api.service;
/**
* Thrown if an error occurred while looking for a service in a component
*/
public class FraSCAtiOSGiNotFoundServiceException extends Exception
{
/**
* Generated serial ID
*/
private static final long serialVersionUID = 4498543017716082887L;
}
/**
* 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):
*
*/
package org.ow2.frascati.osgi.api.service;
/**
* Thrown if an error occured while trying to run a service
*/
public class FraSCAtiOSGiNotRunnableServiceException extends Exception
{
/**
* Generated serial ID
*/
private static final long serialVersionUID = -783487930216228411L;
}
/**
* 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):
*
*/
package org.ow2.frascati.osgi.api.service;
import java.io.File;
import java.net.URL;
//import org.ow2.frascati.util.resource.AbstractResource;
/**
* The FraSCAtiOSGiService interface
*/
public interface FraSCAtiOSGiService
{
// /**
// * Load an SCA component embedded in the AbstractResource passed on as a
// * parameter
// *
// * @param resource
// * the AbstractResource containing the composite file to load
// * @param compositeName
// * the composite file name
// * @throws FraSCAtiOSGiNotFoundCompositeException;
// * if no component can be loaded
// *
// */
// String loadSCA(AbstractResource resource, String compositeName)
// throws FraSCAtiOSGiNotFoundCompositeException;
/**
* Load an SCA component embedded in the resource which URL is passed on as a
* parameter
*
* @param resourceURL
* @param compositeName
* the composite file name
* @throws FraSCAtiOSGiNotFoundCompositeException
* ; if no component can be loaded
*/
String loadSCA(URL resourceURL, String compositeName)
throws FraSCAtiOSGiNotFoundCompositeException;
/**
* @param bundleId
*/
void unloadSCA(long bundleId);
/**
* Launch a Runnable service of a component beforehand registered with the suitable
* loadSCA method
*
* @param compositeName
* the name of the component
* @param serviceName
* the name of the service
* @throws FraSCAtiOSGiNotFoundCompositeException
* ; if the component cannot be found
* @throws FraSCAtiOSGiNotFoundServiceException
* ; if the service cannot be found
* @throws FraSCAtiOSGiNotRunnableServiceException
* ; if the service is not a Runnable one
*/
void launch(String compositeName, String serviceName)
throws FraSCAtiOSGiNotFoundCompositeException,
FraSCAtiOSGiNotFoundServiceException,
FraSCAtiOSGiNotRunnableServiceException;
/**
* Launch a Runnable service if it exists and beforehand registered with the suitable
* loadSCA method
*
* @param compositeName
* the name of the component
* @throws FraSCAtiOSGiNotFoundCompositeException
* ; if the component cannot be found
* @throws FraSCAtiOSGiNotFoundServiceException
* ; if no service can be found in the component
* @throws FraSCAtiOSGiNotRunnableServiceException
* ; if no Runnable service can be found
*/
void launch(String compositeName)
throws FraSCAtiOSGiNotFoundCompositeException,
FraSCAtiOSGiNotRunnableServiceException,
FraSCAtiOSGiNotFoundServiceException;
/**
* Return the cache directory used by the service
*
* @return The cache directory
*/
File getCacheDir();
}
<?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</groupId>
<artifactId>parent</artifactId>
<version>1.5-SNAPSHOT</version>
</parent>