Commit 1e5c9574 authored by Philippe Merle's avatar Philippe Merle
Browse files

Completed the FraSCAti implementation Nuxeo module to obtain a first ready-to-use version.

* Removed all stuff related to a Nuxeo specific Juliac membrane.
* Added JUnit test cases.
* Added two examples:
  - nuxeo: reify core Nuxeo components as SCA components.
  - runnable: a Runnable Nuxeo component.
parent 3e3ae2ba
############################################################
# Default Logging Configuration File
#
# You can use a different file by specifying a filename
# with the java.util.logging.config.file system property.
# For example java -Djava.util.logging.config.file=myfile
############################################################
############################################################
# Global properties
############################################################
# "handlers" specifies a comma separated list of log Handler
# classes. These handlers will be installed during VM startup.
# Note that these classes must be on the system classpath.
# By default we only configure a ConsoleHandler, which will only
# show messages at the INFO and above levels.
handlers= java.util.logging.ConsoleHandler
# To also add the FileHandler, use the following line instead.
#handlers= java.util.logging.FileHandler, java.util.logging.ConsoleHandler
# Default global logging level.
# This specifies which kinds of events are logged across
# all loggers. For any given facility this global level
# can be overridden by a facility specific level
# Note that the ConsoleHandler also has a separate level
# setting to limit messages printed to the console.
.level=INFO
############################################################
# Handler specific properties.
# Describes specific configuration info for Handlers.
############################################################
# default file output is in user's home directory.
java.util.logging.FileHandler.pattern = %h/java%u.log
java.util.logging.FileHandler.limit = 50000
java.util.logging.FileHandler.count = 1
java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter
# Limit the message that are printed on the console to INFO and above.
java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
############################################################
# Facility specific properties.
# Provides extra control for each logger.
############################################################
# org.ow2.frascati.parser.core.level = FINE
<?xml version="1.0"?>
<!--
* OW2 FraSCAti: Nuxeo as SCA Components
*
* Copyright (c) 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: 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.examples.nuxeo</groupId>
<artifactId>parent</artifactId>
<version>1.5-SNAPSHOT</version>
</parent>
<name>OW2 FraSCAti: Nuxeo as SCA Components</name>
<artifactId>nuxeo-as-sca-components</artifactId>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<!-- OW2 FraSCAti: Nuxeo as SCA Components -->
<!-- Copyright (C) 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: Philippe Merle -->
<!-- -->
<!-- Contributor(s): -->
<!-- -->
<!-- -->
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
xmlns:nuxeo="http://frascati.ow2.org/xmlns/nuxeo/1.0"
name="Nuxeo">
<service name="LoginService" promote="LoginComponent/LoginService"/>
<component name="org-nuxeo-runtime-started">
<nuxeo:implementation.nuxeo name="service:org.nuxeo.runtime.started" />
</component>
<component name="EventService">
<nuxeo:implementation.nuxeo name="service:org.nuxeo.runtime.EventService" />
<!-- Following can not work as org.nuxeo.runtime.services.event.EventService is a Java class, not a Java interface !!!
<service name="EventService">
<interface.java interface="org.nuxeo.runtime.services.event.EventService"/>
</service>
-->
</component>
<component name="ResourceService">
<nuxeo:implementation.nuxeo name="service:org.nuxeo.runtime.services.resource.ResourceService" />
<!-- Following can not work as org.nuxeo.runtime.services.resource.ResourceService is a Java class, not a Java interface !!!
<service name="ResourceService">
<interface.java interface="org.nuxeo.runtime.services.resource.ResourceService"/>
</service>
-->
</component>
<component name="DefaultJBossBindings">
<nuxeo:implementation.nuxeo name="service:org.nuxeo.runtime.api.DefaultJBossBindings" />
</component>
<component name="ServiceManagement">
<nuxeo:implementation.nuxeo name="service:org.nuxeo.runtime.api.ServiceManagement" />
<!-- Following can not work as org.nuxeo.runtime.api.ServiceManager is a Java class, not a Java interface !!!
<service name="ServiceManager">
<interface.java interface="org.nuxeo.runtime.api.ServiceManager"/>
</service>
-->
</component>
<component name="LoginComponent">
<nuxeo:implementation.nuxeo name="service:org.nuxeo.runtime.LoginComponent" />
<service name="LoginService">
<interface.java interface="org.nuxeo.runtime.api.login.LoginService"/>
</service>
</component>
</composite>
/**
* OW2 FraSCAti: Nuxeo as SCA components
* Copyright (c) 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): Philippe Merle
*
*/
package org.ow2.frascati.nuxeo.test;
import org.nuxeo.runtime.test.runner.Features;
import org.nuxeo.runtime.test.runner.RuntimeFeature;
import org.nuxeo.runtime.test.runner.SimpleFeature;
@Features(RuntimeFeature.class)
public class MinimalistNuxeoFeature extends SimpleFeature
{
}
/**
* OW2 FraSCAti: Nuxeo as SCA components
* Copyright (C) 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: Philippe Merle
*
* Contributor(s):
*
*/
package org.ow2.frascati.nuxeo.test;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.nuxeo.runtime.api.login.LoginService;
import org.nuxeo.runtime.api.login.SecurityDomain;
import org.nuxeo.runtime.test.runner.Features;
import org.nuxeo.runtime.test.runner.FeaturesRunner;
import org.objectweb.fractal.api.Component;
import org.ow2.frascati.FraSCAti;
/**
* JUnit test case for Nuxeo as SCA components.
*
* @author Philippe Merle.
*/
@RunWith(FeaturesRunner.class)
@Features(MinimalistNuxeoFeature.class)
public class TestNuxeo
{
/**
* Test the Nuxeo composite.
*/
@Test
public void testNuxeoComposite() throws Exception
{
// Instantiate FraSCAti.
FraSCAti frascati = FraSCAti.newFraSCAti();
// Get the Nuxeo composite.
Component nuxeo = frascati.getComposite("Nuxeo");
// Retrieve the LoginService service.
LoginService loginService = frascati.getService(nuxeo, "LoginService", LoginService.class);
// Invoke it.
for(SecurityDomain securityDomain : loginService.getSecurityDomains()) {
System.out.println("* " + securityDomain);
}
}
}
#------------------------------------------------------------------------------
# Logging configuration
#------------------------------------------------------------------------------
log4j.rootCategory=INFO, console
log4j.logger.org.nuxeo=INFO
#------------------------------------------------------------------------------
# Console appender
#------------------------------------------------------------------------------
log4j.appender.console = org.apache.log4j.ConsoleAppender
log4j.appender.console.layout = org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern = %p [%c{1}] %m%n
\ No newline at end of file
<?xml version="1.0"?>
<!--
* OW2 FraSCAti: SCA Implementation Nuxeo Examples
*
* Copyright (c) 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: 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.examples</groupId>
<artifactId>parent</artifactId>
<version>1.5-SNAPSHOT</version>
</parent>
<groupId>org.ow2.frascati.examples.nuxeo</groupId>
<artifactId>parent</artifactId>
<packaging>pom</packaging>
<name>OW2 FraSCAti: SCA Implementation Nuxeo Examples</name>
<!-- ============ -->
<!-- Modules -->
<!-- ============ -->
<modules>
<module>nuxeo</module>
<module>runnable</module>
</modules>
<!-- ========== -->
<!-- Properties -->
<!-- ========== -->
<properties>
<nuxeo.version>5.5</nuxeo.version>
</properties>
<!-- ============ -->
<!-- Dependencies -->
<!-- ============ -->
<dependencies>
<!-- OW2 FraSCAti SCA Implementation Nuxeo Module. -->
<dependency>
<groupId>org.ow2.frascati.nuxeo</groupId>
<artifactId>frascati-implementation-nuxeo</artifactId>
<version>${project.version}</version>
</dependency>
<!-- ============ -->
<!-- For testing -->
<!-- ============ -->
<!-- JUnit Testing Framework. -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.7</version>
<scope>test</scope>
</dependency>
<!-- OW2 FraSCAti Runtime Factory Module. -->
<dependency>
<groupId>org.ow2.frascati</groupId>
<artifactId>frascati-runtime-factory</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<!-- Nuxeo Runtime Testing Framework. -->
<dependency>
<groupId>org.nuxeo.runtime</groupId>
<artifactId>nuxeo-runtime-test</artifactId>
<version>${nuxeo.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<!-- OW2 FraSCAti: SCA Implementation OSGi -->
<!-- Copyright (C) 2010-2011 INRIA, University of Lille 1 -->
<!-- OW2 FraSCAti: Runnable Nuxeo Component Example -->
<!-- Copyright (C) 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 -->
......@@ -14,7 +14,8 @@
<!-- -->
<!-- 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 -->
<!-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -->
<!-- USA -->
<!-- -->
<!-- Contact: frascati@ow2.org -->
<!-- -->
......@@ -22,12 +23,18 @@
<!-- -->
<!-- Contributor(s): -->
<!-- -->
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" xmlns:cf="org/ow2/frascati/component/factory"
name="org.ow2.frascati.component.factory.ComponentFactory">
<component constrainingType="cf:FractalBootstrapClassProviderType" name="nuxeo-provider">
<implementation.java class="org.ow2.frascati.component.factory.impl.MembraneProviderImpl"/>
<property name="membrane-description">OW2 FraSCAti Tinfi Nuxeo Membranes</property>
<property name="membrane-names">nuxeoPrimitive</property>
<property name="membrane-class">org.objectweb.fractal.juliac.nuxeo.JuliacNuxeo</property>
<!-- -->
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
xmlns:nuxeo="http://frascati.ow2.org/xmlns/nuxeo/1.0"
name="RunnableNuxeoComponent">
<service name="Runnable" promote="RunnableNuxeoComponent/Runnable"/>
<component name="RunnableNuxeoComponent">
<nuxeo:implementation.nuxeo name="runnable-nuxeo-component" />
<service name="Runnable">
<interface.java interface="java.lang.Runnable"/>
</service>
</component>
</composite>
<?xml version="1.0"?>
<!--
* OW2 FraSCAti: Runnable Nuxeo Component Example
*
* Copyright (c) 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: 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.examples.nuxeo</groupId>
<artifactId>parent</artifactId>
<version>1.5-SNAPSHOT</version>
</parent>
<name>OW2 FraSCAti: Runnable Nuxeo Component Example</name>
<artifactId>runnable-nuxeo-component</artifactId>
</project>
/**
* OW2 FraSCAti: Runnable Nuxeo Component Example
* Copyright (C) 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: Philippe Merle
*
* Contributor(s):
*
*/
package org.ow2.frascati.examples.nuxeo.runnable;
/**
* A Runnable Nuxeo component.
*
* @author Philippe Merle.
*/
public class RunnableNuxeoComponent implements Runnable
{
public RunnableNuxeoComponent()
{
System.out.println(this + " CREATED");
}
public void run()
{
System.out.println(this + " is running.");
}
}
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Version: 1.5-SNAPSHOT
Bundle-Name: runnable-nuxeo-component
Bundle-SymbolicName: runnable-nuxeo-component;singleton:=true
Bundle-Vendor: Inria
Nuxeo-Component: OSGI-INF/runnable-nuxeo-component.xml
\ No newline at end of file
<?xml version="1.0"?>
<!--
* OW2 FraSCAti: Runnable Nuxeo Component Example
* Copyright (c) 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