Commit 50ae5b86 authored by Nicolas Dolet's avatar Nicolas Dolet
Browse files

Add a new intent module: debug intent.

Illustrates usage of this intent in the helloworld-bin/assembly example.
parent 806c7efd
......@@ -51,6 +51,11 @@
<artifactId>helloworld-bin-code</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.ow2.frascati.intent</groupId>
<artifactId>frascati-debug</artifactId>
<version>0.1-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
......@@ -28,7 +28,7 @@
<interface.java interface="java.lang.Runnable" />
</service>
<component name="client">
<component name="client" requires="frascati.debug">
<service name="r">
<interface.java interface="java.lang.Runnable" />
</service>
......
<?xml version="1.0"?>
<!--
* OW2 FraSCAti - Debug Intent.
*
* Copyright (c) 20082009 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
-->
<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.intent</groupId>
<artifactId>frascati-debug</artifactId>
<packaging>jar</packaging>
<name>Debug intent</name>
<version>0.1-SNAPSHOT</version>
<build>
<plugins>
<!-- To compile Java 5.0 source code. -->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.ow2.frascati.factory</groupId>
<artifactId>frascati-factory-tools</artifactId>
<version>0.5-SNAPSHOT</version>
<executions>
<execution>
<id>generate-factory</id>
<phase>generate-sources</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
<configuration>
<factory>GenerateFactory</factory>
<srcs>
<src>src/main/java</src>
<src>src/main/resources</src>
</srcs>
<composite>frascati.debug.composite</composite>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.ow2.frascati.tinfi</groupId>
<artifactId>frascati-tinfi-runtime</artifactId>
<version>0.4.4</version>
</dependency>
</dependencies>
</project>
/***
* OW2 FraSCAti Transaction service
* Copyright (C) 2008-2009 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: Nicolas Dolet
*/
package org.ow2.frascati.intent.debug;
import org.osoa.sca.annotations.Scope;
import org.ow2.frascati.tinfi.control.intent.IntentHandler;
import org.ow2.frascati.tinfi.control.intent.IntentJoinPoint;
@Scope("COMPOSITE")
public class DebugIntentHandler
implements IntentHandler {
// --------------------------------------------------------------------------
// Implementation of the IntentHandler interface
// --------------------------------------------------------------------------
/**
* @see org.ow2.frascati.tinfi.control.intent.IntentHandler#invoke(IntentJoinPoint)
*/
public Object invoke(IntentJoinPoint ijp) throws Throwable {
Object ret;
String methodName = ijp.getMethod().getName();
System.out.println("[FRASCATI-DEBUG] Entering method: " + methodName);
ret = ijp.proceed();
System.out.println("[FRASCATI-DEBUG] Exiting method: " + methodName);
return ret;
}
}
<?xml version="1.0" encoding="ISO-8859-15"?>
<!-- OW2 FraSCAti Debug Intent -->
<!-- Copyright (C) 2009 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: Nicolas Dolet -->
<!-- -->
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" xmlns:hw="http://debug-intent" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="frascati.debug">
<service name="intent" promote="debugIntentHandler/debug">
<interface.java interface="org.ow2.frascati.tinfi.control.intent.IntentHandler"/>
</service>
<component name="debugIntentHandler">
<service name="debug">
<interface.java interface="org.ow2.frascati.tinfi.control.intent.IntentHandler"/>
</service>
<implementation.java class="org.ow2.frascati.intent.debug.DebugIntentHandler"/>
</component>
</composite>
<?xml version="1.0"?>
<!--
* OW2 FraSCAti - Intents.
*
* Copyright (c) 20082009 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
-->
<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.intent</groupId>
<artifactId>parent</artifactId>
<packaging>pom</packaging>
<name>Intent module</name>
<version>0.1-SNAPSHOT</version>
<modules>
<module>debug</module>
</modules>
</project>
......@@ -168,6 +168,7 @@
<module>tinfi</module>
<module>assembly-factory</module>
<module>transaction-service</module>
<module>intents</module>
<!-- <module>sca-1.0</module> -->
</modules>
......
Supports Markdown
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