Add FraSCAti Archetype

parent bd1bcbb5
<?xml version="1.0" encoding="UTF-8"?>
<!--
* OW2 FraSCAti Archetype
*
* 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: Antonio Souza Neto
*
* 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.ow2.frascati.mojo</groupId>
<artifactId>maven-plugins-parent</artifactId>
<version>1.5-SNAPSHOT</version>
</parent>
<groupId>org.ow2.frascati.mojo</groupId>
<artifactId>frascati-archetype</artifactId>
<packaging>maven-archetype</packaging>
<name>FraSCAti Archetype</name>
<build>
<extensions>
<extension>
<groupId>org.apache.maven.archetype</groupId>
<artifactId>archetype-packaging</artifactId>
<version>2.0</version>
</extension>
</extensions>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-archetype-plugin</artifactId>
<version>2.0</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
<!--
* OW2 FraSCAti Archetype
*
* 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: Antonio Souza Neto
*
* Contributor(s):
-->
<archetype>
<id>frascati-archetype</id>
<resources>
<resource>README.txt</resource>
<resource>src/main/resources/helloworld-wired.composite</resource>
<resource>config/frascati-cxf.xml</resource>
<resource>config/logging.properties</resource>
</resources>
<sources>
<source>src/main/java/Client.java</source>
<source>src/main/java/Server.java</source>
<source>src/main/java/PrintService.java</source>
</sources>
<testSources>
<source>src/test/java/HelloworldTestCase.java</source>
</testSources>
</archetype>
The structure of this application has been created automatically by FraSCAti Archetype and contains the basic needs to construct an SCA application executing on FraSCAti.
Install your application doing "mvn clean install" in the command line.
To execute the application, do "mvn -Prun" in the command line or open the pom.xml file to see the available profiles.
A helloworld application has been created to help beginners to understand how a simple application works on FraSCAti.
A composite file describes the architecture and must to be changed to be adapted to your application.
The java files can be changed or simply deleted.
More about FraSCAti including an user guide in: http://frascati.ow2.org
<?xml version="1.0"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<!-- This is an empty Apache CXF configuration. -->
<!-- See at http://cxf.apache.org/docs/configuration.html for details on how to configure Apache CXF. -->
</beans>
############################################################
# 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.level = INFO
org.ow2.frascati.assembly.factory.level = INFO
# org.ow2.frascati.assembly.factory.manager.level = OFF
# org.ow2.frascati.assembly.factory.manager.AssemblyFactoryManager.level = OFF
org.ow2.frascati.assembly.factory.processor.level = INFO
# org.ow2.frascati.assembly.factory.processor.ScaBindingProcessor.level = OFF
# org.ow2.frascati.assembly.factory.processor.ScaBindingScaProcessor.level = OFF
# org.ow2.frascati.assembly.factory.processor.ScaComponentProcessor.level = OFF
# org.ow2.frascati.assembly.factory.processor.ScaComponentPropertyProcessor.level = OFF
# org.ow2.frascati.assembly.factory.processor.ScaComponentReferenceProcessor.level = OFF
# org.ow2.frascati.assembly.factory.processor.ScaComponentServiceProcessor.level = OFF
# org.ow2.frascati.assembly.factory.processor.ScaCompositeProcessor.level = OFF
# org.ow2.frascati.assembly.factory.processor.ScaCompositePropertyProcessor.level = OFF
# org.ow2.frascati.assembly.factory.processor.ScaCompositeReferenceProcessor.level = OFF
# org.ow2.frascati.assembly.factory.processor.ScaCompositeServiceProcessor.level = OFF
# org.ow2.frascati.assembly.factory.processor.ScaImplementationCompositeProcessor.level = OFF
# org.ow2.frascati.assembly.factory.processor.ScaImplementationJavaProcessor.level = OFF
# org.ow2.frascati.assembly.factory.processor.ScaImplementationProcessor.level = OFF
# org.ow2.frascati.assembly.factory.processor.ScaInterfaceJavaProcessor.level = OFF
# org.ow2.frascati.assembly.factory.processor.ScaInterfaceProcessor.level = OFF
# org.ow2.frascati.assembly.factory.processor.ScaPropertyTypeJavaProcessor.level = OFF
org.ow2.frascati.component.factory.level = INFO
org.ow2.frascati.component.factory.juliac.level = INFO
org.ow2.frascati.property.jaxb.level = INFO
org.ow2.frascati.binding.level = INFO
org.ow2.frascati.binding.factory.level = INFO
org.ow2.frascati.binding.jms.level = INFO
org.objectweb.fractal.bf.connectors.jms.level = INFO
org.ow2.frascati.implementation.level = INFO
org.ow2.frascati.implementation.bpel.level = INFO
org.ow2.frascati.implementation.bpel.easybpel.level = INFO
org.ow2.frascati.parser.level = INFO
org.ow2.frascati.tinfi.level = INFO
org.ow2.frascati.wsdl.level = INFO
com.ebmwebsourcing.level = INFO
com.sun.level = INFO
/**
* This class has been generated automaticaly by FraSCAty Archetype
*
*
* Author:
*
* Contributor(s):
*
*/
package ${groupId};
import org.osoa.sca.annotations.Reference;
import org.osoa.sca.annotations.Service;
/** A print service client. */
@Service(Runnable.class)
public class Client
implements Runnable
{
@Reference(required = true)
private PrintService s;
/** Default constructor. */
public Client() {
System.out.println("CLIENT created.");
}
/** Run the client. */
public final void run() {
s.print("Hello World!");
}
}
/**
* This class has been generated automaticaly by FraSCAty Archetype
*
*
* Author:
*
* Contributor(s):
*
*/
package ${groupId};
import org.osoa.sca.annotations.Service;
/**
* A basic service used to print messages.
*/
@Service
public interface PrintService {
void print(String msg);
}
/**
* This class has been generated automaticaly by FraSCAty Archetype
*
*
* Author:
*
* Contributor(s):
*
*/
package ${groupId};
import org.osoa.sca.annotations.Property;
/** The print service implementation. */
public class Server
implements PrintService
{
@Property
private String header = "->";
private int count = 1;
/** Default constructor. */
public Server() {
System.out.println("SERVER created.");
}
/** PrintService implementation. */
public final void print(final String msg) {
System.out.println("SERVER: begin printing...");
for (int i = 0; i < count; ++i) {
System.out.println(header + msg);
}
System.out.println("SERVER: print done.");
}
}
<?xml version="1.0" encoding="ISO-8859-15"?>
<!-- This composite has been generated automaticaly by FraSCAty Archetype -->
<!-- Contact: frascati@ow2.org -->
<!-- -->
<!-- ${artifactId} -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- Author: -->
<!-- -->
<!-- -->
<!-- Contributor(s): -->
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" name="helloworld-wired">
<service name="r" promote="client/Runnable"/>
<component name="client">
<implementation.java class="${groupId}.Client"/>
</component>
<component name="server">
<implementation.java class="${groupId}.Server"/>
</component>
<wire source="client/s" target="server/PrintService"/>
</composite>
/**
* This class has been generated automaticaly by FraSCAty Archetype
*
*
* Author:
*
* Contributor(s):
*
*/
package ${groupId};
import org.junit.Test;
import org.junit.After;
import org.junit.Before;
import org.objectweb.fractal.api.Component;
import org.ow2.frascati.FraSCAti;
import org.ow2.frascati.util.FrascatiException;
public class HelloworldTestCase
{
private FraSCAti frascati;
/**
* The SCA composite to test
*/
private Component scaComposite;
/**
* Load a composite
*
* @param name
* the composite name
* @throws FrascatiException
*/
@Before
public final void loadComposite() throws FrascatiException
{
String compositeName = getComposite();
System.out.println("Loading SCA composite '" + compositeName + "'...");
frascati = FraSCAti.newFraSCAti();
scaComposite = frascati.getComposite(compositeName);
}
/**
* Get a service on the SCA composite
*
* @param <T>
* the class type for the return
* @param serviceName
* the name of the service
* @return the service named <code>serviceName</code> or null
*/
protected final <T> T getService(Class<T> cl, String serviceName)
{
System.out.println("Getting SCA service '" + serviceName + "'...");
try {
return frascati.getService(scaComposite, serviceName, cl);
} catch (Exception e) {
System.err.println("No such SCA service: " + serviceName);
return null;
}
}
/**
* Close the SCA domain
*
* @throws IllegalLifeCycleException
* if the domain cannot be closed
* @throws NoSuchInterfaceException
* if the lifecycle controller of the component is not found
*/
@After
public final void close() throws FrascatiException
{
if(scaComposite != null) {
frascati.close(scaComposite);
}
}
public final String getComposite()
{
return "helloworld-wired";
}
@Test
public final void testService()
{
getService(Runnable.class, "r").run();
}
}
<!--
* OW2 FraSCAti Archetype
*
* 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: Antonio Souza Neto
*
* Contributor(s):
-->
<archetype>
<id>frascati-archetype</id>
<resources>
<resource>README.txt</resource>
<resource>src/main/resources/helloworld-wired.composite</resource>
<resource>config/frascati-cxf.xml</resource>
<resource>config/logging.properties</resource>
</resources>
<sources>
<source>src/main/java/Client.java</source>
<source>src/main/java/Server.java</source>
<source>src/main/java/PrintService.java</source>
</sources>
<testSources>
<source>src/test/java/HelloworldTestCase.java</source>
</testSources>
</archetype>
The structure of this application has been created automatically by FraSCAti Archetype and contains the basic needs to construct an SCA application executing on FraSCAti.
Install your application doing "mvn clean install" in the command line.
To execute the application, do "mvn -Prun" in the command line or open the pom.xml file to see the available profiles.
A helloworld application has been created to help beginners to understand how a simple application works on FraSCAti.
A composite file describes the architecture and must to be changed to be adapted to your application.
The java files can be changed or simply deleted.
More about FraSCAti including an user guide in: http://frascati.ow2.org
<?xml version="1.0"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<!-- This is an empty Apache CXF configuration. -->
<!-- See at http://cxf.apache.org/docs/configuration.html for details on how to configure Apache CXF. -->
</beans>
############################################################
# 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.level = INFO
org.ow2.frascati.assembly.factory.level = INFO
# org.ow2.frascati.assembly.factory.manager.level = OFF
# org.ow2.frascati.assembly.factory.manager.AssemblyFactoryManager.level = OFF
org.ow2.frascati.assembly.factory.processor.level = INFO
# org.ow2.frascati.assembly.factory.processor.ScaBindingProcessor.level = OFF
# org.ow2.frascati.assembly.factory.processor.ScaBindingScaProcessor.level = OFF
# org.ow2.frascati.assembly.factory.processor.ScaComponentProcessor.level = OFF
# org.ow2.frascati.assembly.factory.processor.ScaComponentPropertyProcessor.level = OFF
# org.ow2.frascati.assembly.factory.processor.ScaComponentReferenceProcessor.level = OFF
# org.ow2.frascati.assembly.factory.processor.ScaComponentServiceProcessor.level = OFF
# org.ow2.frascati.assembly.factory.processor.ScaCompositeProcessor.level = OFF
# org.ow2.frascati.assembly.factory.processor.ScaCompositePropertyProcessor.level = OFF
# org.ow2.frascati.assembly.factory.processor.ScaCompositeReferenceProcessor.level = OFF
# org.ow2.frascati.assembly.factory.processor.ScaCompositeServiceProcessor.level = OFF
# org.ow2.frascati.assembly.factory.processor.ScaImplementationCompositeProcessor.level = OFF
# org.ow2.frascati.assembly.factory.processor.ScaImplementationJavaProcessor.level = OFF
# org.ow2.frascati.assembly.factory.processor.ScaImplementationProcessor.level = OFF
# org.ow2.frascati.assembly.factory.processor.ScaInterfaceJavaProcessor.level = OFF
# org.ow2.frascati.assembly.factory.processor.ScaInterfaceProcessor.level = OFF
# org.ow2.frascati.assembly.factory.processor.ScaPropertyTypeJavaProcessor.level = OFF
org.ow2.frascati.component.factory.level = INFO
org.ow2.frascati.component.factory.juliac.level = INFO
org.ow2.frascati.property.jaxb.level = INFO
org.ow2.frascati.binding.level = INFO
org.ow2.frascati.binding.factory.level = INFO
org.ow2.frascati.binding.jms.level = INFO
org.objectweb.fractal.bf.connectors.jms.level = INFO
org.ow2.frascati.implementation.level = INFO
org.ow2.frascati.implementation.bpel.level = INFO
org.ow2.frascati.implementation.bpel.easybpel.level = INFO
org.ow2.frascati.parser.level = INFO
org.ow2.frascati.tinfi.level = INFO
org.ow2.frascati.wsdl.level = INFO
com.ebmwebsourcing.level = INFO
com.sun.level = INFO
/**
* This class has been generated automaticaly by FraSCAty Archetype
*
*
* Author:
*
* Contributor(s):
*
*/
package ${groupId};
import org.osoa.sca.annotations.Reference;
import org.osoa.sca.annotations.Service;
/** A print service client. */
@Service(Runnable.class)
public class Client
implements Runnable
{
@Reference(required = true)
private PrintService s;
/** Default constructor. */
public Client() {
System.out.println("CLIENT created.");
}
/** Run the client. */
public final void run() {
s.print("Hello World!");
}
}
/**
* This class has been generated automaticaly by FraSCAty Archetype
*
*
* Author:
*
* Contributor(s):
*