Commit 8e25d12d authored by Philippe Merle's avatar Philippe Merle
Browse files

Added a new example illustrating how to use <binding.sca> to connect two...

Added a new example illustrating how to use <binding.sca> to connect two components contained into two distinct composites.
parent ef6b0c2b
============================================================================
OW2 FraSCAti Examples: HelloWorld with an SCA binding
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):
============================================================================
HelloWorld with an SCA binding:
-------------------------------
This example illustrate how to use <binding.sca> to connect two components
contained into two distinct composites.
See src/main/resources/helloworld-client.composite where the reference 's'
of the component 'client' is connected to the service 'PrintService' of the
component 'server' contained into the composite 'helloworld-server'.
Compilation with Maven:
-----------------------
mvn install
Execution with Maven:
---------------------
mvn -Prun
mvn -Pexplorer (with FraSCAti Explorer)
mvn -Pexplorer-fscript (with FraSCAti Explorer and FScript plugin)
mvn -Pfscript-console (with FraSCAti FScript Console)
mvn -Pfscript-console-explorer (with FraSCAti Explorer and FScript Console)
mvn -Pexplorer-jdk6 (with FraSCAti Explorer and JDK6)
mvn -Prun,web (with FraSCAti Web Explorer)
<?xml version="1.0"?>
<!--
* OW2 FraSCAti Examples: HelloWorld with an SCA binding
*
* 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>
<groupId>org.ow2.frascati.examples</groupId>
<artifactId>helloworld-binding-sca</artifactId>
<packaging>jar</packaging>
<name>OW2 FraSCAti Examples: HelloWorld with an SCA Binding</name>
<parent>
<groupId>org.ow2.frascati.examples</groupId>
<artifactId>parent</artifactId>
<version>1.5-SNAPSHOT</version>
</parent>
<properties>
<composite.file>helloworld-binding-sca</composite.file>
<service.name>r</service.name>
<method.name>run</method.name>
<distribution.test>true</distribution.test>
</properties>
<dependencies>
<dependency>
<groupId>org.ow2.frascati.examples</groupId>
<artifactId>helloworld-annotations</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.ow2.frascati.examples.test</groupId>
<artifactId>frascati-test</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
<?xml version="1.0" encoding="ISO-8859-15"?>
<!-- OW2 FraSCAti Examples: HelloWorld with an SCA Binding -->
<!-- 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" name="helloworld-binding-sca">
<service name="r" promote="client/r"/>
<component name="client">
<implementation.composite name="helloworld-client"/>
</component>
<component name="server">
<implementation.composite name="helloworld-server"/>
</component>
</composite>
<?xml version="1.0" encoding="ISO-8859-15"?>
<!-- OW2 FraSCAti Examples: HelloWorld with an SCA Binding -->
<!-- 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" name="helloworld-client">
<service name="r" promote="client/Runnable"/>
<component name="client">
<implementation.java class="org.ow2.frascati.examples.helloworld.annotated.Client"/>
<reference name="s">
<binding.sca uri="helloworld-binding-sca/server/server/PrintService"/>
</reference>
</component>
</composite>
<?xml version="1.0" encoding="ISO-8859-15"?>
<!-- OW2 FraSCAti Examples: HelloWorld with an SCA Binding -->
<!-- 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" name="helloworld-server">
<component name="server">
<implementation.java class="org.ow2.frascati.examples.helloworld.annotated.Server"/>
</component>
</composite>
/**
* OW2 FraSCAti Examples: HelloWorld with an SCA Binding
* 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.helloworld.binding_sca.test;
import org.junit.Test;
import org.ow2.frascati.examples.test.FraSCAtiTestCase;
public class HelloWorldFractalTestCase
extends FraSCAtiTestCase
{
public final String getComposite()
{
return "helloworld-binding-sca";
}
@Test
public final void testRun()
{
System.out.println("Calling the 'run' method of the 'r' service...");
getService(Runnable.class, "r").run();
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment