Mail Archive Home | gotm-commits List | March 2005 Index
| <-- Date Index --> | <-- Thread Index --> |
Date: Monday, March 14, 2005 @ 13:42:02
Author: rouvoy
Path: /cvsroot/gotm/gotm-ots
Added: examples/service/.cvsignore examples/service/build.xml
examples/service/src/fractal/org/objectweb/gotm/lib/FcExplorerImpl.fractal
examples/service/src/fractal/org/objectweb/gotm/ots/service/FcApplication.fractal
examples/service/src/fractal/org/objectweb/gotm/ots/service/FcExplorer.fractal
src/java/org/objectweb/gotm/lib/CosTransactions/ControlImpl.java
src/java/org/objectweb/gotm/lib/CosTransactions/ResourceImpl.java
src/java/org/objectweb/gotm/lib/CosTransactions/TransactionFactoryImpl.java
Modified: .classpath .settings/org.eclipse.core.resources.prefs build.xml
src/java/org/objectweb/gotm/lib/CosTransactions/CurrentImpl.java
src/java/org/objectweb/gotm/lib/CosTransactions/StatusConverter.java
src/java/org/objectweb/gotm/lib/CosTransactions/TransactionImpl.java
* Integrating JacORB with Fractal to provide CORBA-based support for Fractal
components.
* Adding new Xdoclet tag @julia.controller desc="" to specify a particular
controller descriptor to use.
* Updating the cache-controller to be supported correctly by composite
components.
* Adding fractal-corba module helloworld example.
* Fractal-explorer library moved from gotm-explorer to fractal-import module.
-----------------------------------------------------------------------------------+
.classpath
| 4
.settings/org.eclipse.core.resources.prefs
| 18 +
build.xml
| 13 -
examples/service/.cvsignore
| 1
examples/service/build.xml
| 117 ++++++++++
examples/service/src/fractal/org/objectweb/gotm/lib/FcExplorerImpl.fractal
| 14 +
examples/service/src/fractal/org/objectweb/gotm/ots/service/FcApplication.fractal
| 9
examples/service/src/fractal/org/objectweb/gotm/ots/service/FcExplorer.fractal
| 14 +
src/java/org/objectweb/gotm/lib/CosTransactions/ControlImpl.java
| 78 ++++++
src/java/org/objectweb/gotm/lib/CosTransactions/CurrentImpl.java
| 28 --
src/java/org/objectweb/gotm/lib/CosTransactions/ResourceImpl.java
| 64 +++++
src/java/org/objectweb/gotm/lib/CosTransactions/StatusConverter.java
| 7
src/java/org/objectweb/gotm/lib/CosTransactions/TransactionFactoryImpl.java
| 94 ++++++++
src/java/org/objectweb/gotm/lib/CosTransactions/TransactionImpl.java
| 62 -----
14 files changed, 432 insertions(+), 91 deletions(-)
Index: gotm-ots/.classpath
diff -u gotm-ots/.classpath:1.1 gotm-ots/.classpath:1.2
--- gotm-ots/.classpath:1.1 Wed Mar 2 17:45:21 2005
+++ gotm-ots/.classpath Mon Mar 14 13:42:01 2005
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/java"/>
+ <classpathentry kind="src" path="examples/service/src/fractal"/>
<classpathentry kind="src" path="output/build/java"/>
<classpathentry kind="src" path="src/fractal"/>
<classpathentry kind="src" path="src/idl"/>
@@ -13,5 +14,8 @@
<classpathentry kind="lib"
path="/fractal-import/lib/utils/ow_util_trace.jar"/>
<classpathentry kind="lib"
path="/fractal-import/lib/monolog/ow_monolog.jar"/>
<classpathentry kind="src" path="/fractal-corba"/>
+ <classpathentry kind="src" path="/fractal-template"/>
+ <classpathentry kind="lib"
path="/fractal-corba/lib/jacorb/jacorb.jar"/>
+ <classpathentry kind="lib"
path="examples/service/output/build/lib/fractal-corba.jar"/>
<classpathentry kind="output" path="output/eclipse"/>
</classpath>
Index: gotm-ots/.settings/org.eclipse.core.resources.prefs
diff -u gotm-ots/.settings/org.eclipse.core.resources.prefs:1.1
gotm-ots/.settings/org.eclipse.core.resources.prefs:1.2
--- gotm-ots/.settings/org.eclipse.core.resources.prefs:1.1 Wed Mar 2
17:45:21 2005
+++ gotm-ots/.settings/org.eclipse.core.resources.prefs Mon Mar 14 13:42:02
2005
@@ -1,5 +1,15 @@
-#Mon Feb 21 18:32:19 CET 2005
+#Wed Mar 09 12:03:59 CET 2005
+encoding//src/fractal/org/objectweb/gotm/lib/TpTransactionImpl.fractal=ISO-8859-1
+encoding//examples/service/src/fractal/org/objectweb/gotm/lib/FcExplorerImpl.fractal=ISO-8859-1
+encoding//src/fractal/org/objectweb/gotm/lib/TpManagerImpl.fractal=ISO-8859-1
+encoding//examples/service/src/fractal/org/objectweb/gotm/ots/service/FcApplication.fractal=ISO-8859-1
+encoding//src/fractal/org/objectweb/gotm/lib/TpCoordinatorImpl.fractal=ISO-8859-1
+encoding//output/build/class/org/omg/CosTransactions/FcTransactionFactorySkeleton.fractal=ISO-8859-1
+encoding//src/fractal/org/objectweb/gotm/lib/TpResourceImpl.fractal=ISO-8859-1
+encoding//output/build/class/org/omg/CosTransactions/FcControlSkeleton.fractal=ISO-8859-1
eclipse.preferences.version=1
-encoding//src/fractal/org/omg/CosTransactions/FcControl.fractal=ISO-8859-1
-encoding//src/fractal/org/omg/CosTransactions/FcTerminator.fractal=ISO-8859-1
-encoding//src/fractal/org/omg/CosTransactions/FcCoordinator.fractal=ISO-8859-1
+encoding//src/fractal/org/objectweb/gotm/lib/TpActivationImpl.fractal=ISO-8859-1
+encoding//output/build/class/org/omg/CosTransactions/FcCoordinatorSkeleton.fractal=ISO-8859-1
+encoding//src/fractal/org/objectweb/gotm/lib/TpOTSImpl.fractal=ISO-8859-1
+encoding//src/fractal/org/objectweb/gotm/lib/FcTransactionManagerImpl.fractal=ISO-8859-1
+encoding//examples/service/src/fractal/org/objectweb/gotm/ots/service/FcExplorer.fractal=ISO-8859-1
Index: gotm-ots/build.xml
diff -u gotm-ots/build.xml:1.1 gotm-ots/build.xml:1.2
--- gotm-ots/build.xml:1.1 Wed Mar 2 17:45:21 2005
+++ gotm-ots/build.xml Mon Mar 14 13:42:01 2005
@@ -21,7 +21,7 @@
<!-- Initial developer(s): Romain Rouvoy. -->
<!-- Contributor(s): ______________________________________. -->
-<!-- $Id: build.xml,v 1.1 2005/03/02 16:45:21 rouvoy Exp $ -->
+<!-- $Id: build.xml,v 1.2 2005/03/14 12:42:01 rouvoy Exp $ -->
<!-- ==================================================================== -->
<project name="GoTM OTS" default="all">
@@ -51,7 +51,8 @@
<antcall target="import"/>
</target>
- <target name="ots-idl" depends="-fractal.corba,-fc.corba">
+ <target name="ots-idl" depends="-fractal.corba,-fc.corba"
+ description="Generates java files.">
<idl2java compiler="jacorb2" force="true" checkAll="false"
verbose="basic" targetDir="${build.dir}/${java.dir}"
dependsDir="${build.dir}">
<classpath>
@@ -66,21 +67,23 @@
<package prefix="org.omg"/>
</idl2java>
<idl2fc destdir="${build.dir}/${java.dir}">
- <fileset dir="${build.dir}/${java.dir}"
includes="**/*Operations.java"/>
+ <fileset dir="${build.dir}/${java.dir}" includes="**/*POATie.java"/>
</idl2fc>
</target>
<target name="ots-compile" depends="-gotm.explorer,ots-idl">
<mkdir dir="${build.dir}/${class.dir}"/>
<java.c srcdir="${build.dir}/${java.dir}"/>
- <!--<java.c srcdir="${basedir}/${src.dir}/${java.dir}" />-->
+ <java.c srcdir="${basedir}/${src.dir}/${java.dir}" />
</target>
<target name="ots-build" depends="ots-compile,fractal-adl">
+ <fc.xdoclet>
+ <fileset dir="${build.dir}/${java.dir}" includes="**/*.java"/>
+ </fc.xdoclet>
<jar destfile="${build.dir}/${lib.dir}/${ots.jar}">
<fileset dir="${build.dir}/${class.dir}"/>
</jar>
- <delete dir="${build.dir}/${class.dir}"/>
</target>
<target name="import" depends="ots-build,clear"/>
Index: gotm-ots/examples/service/.cvsignore
diff -u /dev/null gotm-ots/examples/service/.cvsignore:1.1
--- /dev/null Mon Mar 14 13:42:02 2005
+++ gotm-ots/examples/service/.cvsignore Mon Mar 14 13:42:02 2005
@@ -0,0 +1 @@
+output
Index: gotm-ots/examples/service/build.xml
diff -u /dev/null gotm-ots/examples/service/build.xml:1.1
--- /dev/null Mon Mar 14 13:42:02 2005
+++ gotm-ots/examples/service/build.xml Mon Mar 14 13:42:02 2005
@@ -0,0 +1,117 @@
+<!-- ==================================================================== -->
+
+<!-- ObjectWeb GoTM is an open Tx Monitor Project -->
+<!-- Contact: http://www.objectweb.org -->
+
+<!-- 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.1 of the License, or 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 -->
+
+<!-- Initial developer(s): Romain Rouvoy. -->
+<!-- Contributor(s): ______________________________________. -->
+
+<!-- $Id: build.xml,v 1.1 2005/03/14 12:42:02 rouvoy Exp $ -->
+<!-- ==================================================================== -->
+
+<project name="OTS Example" default="all">
+ <description>GoTM OTS Examples [gotm.objectweb.org] - GoTM is an open
Transaction Monitor</description>
+
+ <!-- ==================== -->
+ <!-- PROPERTY DEFINITIONS -->
+ <!-- ==================== -->
+ <import file="${basedir}/../../../fractal-import/build.xml"/>
+ <property name="examples.jar" value="ow_gotm_ots_examples.jar"/>
+ <property name="examples.version" value="0.1a"/>
+ <property name="dist.name" value="GoTM-OTS-Examples"/>
+
+ <!-- ================ -->
+ <!-- PATH DEFINITIONS -->
+ <!-- ================ -->
+ <path id="classpath">
+ <fileset dir="${build.dir}/${lib.dir}" includes="**/*.jar"/>
+ </path>
+
+ <path id="bootclasspath">
+ <fileset dir="${build.dir}/${lib.dir}/endorsed" includes="**/*.jar"/>
+ <fileset dir="${java.home}/${lib.dir}" includes="rt.jar"/>
+ </path>
+
+ <!-- ================== -->
+ <!-- TARGET DEFINITIONS -->
+ <!-- ================== -->
+ <target name="all" description="clean + execute">
+ <antcall target="clean"/>
+ <antcall target="execute"/>
+ </target>
+
+ <target name="local-compile" depends="-gotm.ots">
+ <mkdir dir="${build.dir}/${class.dir}"/>
+ <!--<java.c srcdir="${basedir}/${src.dir}/${java.dir}"/>
+ <copy todir="${build.dir}/${class.dir}">
+ <fileset dir="${basedir}/${src.dir}/${cfg.dir}" includes="**/*.*"/>
+ </copy>
+ <copy todir="${build.dir}/${class.dir}">
+ <fileset dir="${basedir}/${bu.dir}/${cfg.dir}" includes="**/*.*"/>
+ </copy>-->
+ </target>
+
+ <target name="local-build" depends="local-compile,fractal-adl">
+ <copy todir="${build.dir}/${class.dir}">
+ <fileset dir="${build.dir}/${cfg.dir}" includes="*.properties"/>
+ </copy>
+ <mkdir dir="${build.dir}/${lib.dir}"/>
+ <jar destfile="${build.dir}/${lib.dir}/${examples.jar}">
+ <fileset dir="${build.dir}/${class.dir}" includes="**/*.*"/>
+ </jar>
+ </target>
+
+ <target name="import" depends="local-build,clear"/>
+
+ <target name="bootstrap" depends="import" description="bootstrap the
service.">
+ <ant dir="${build.dir}" target="start.ns" inheritrefs="true">
+ <property name="ior" value="${build.dir}/NS.ior"/>
+ </ant>
+ </target>
+
+ <target name="gui" description="bootstrap the service.">
+ <ant dir="${build.dir}" target="start.ns.gui" inheritrefs="true">
+ <property name="ior" value="file:/${build.dir}/NS.ior"/>
+ </ant>
+ </target>
+
+ <target name="ts" description="starts the Transaction Service.">
+ <ant dir="${build.dir}" target="start.ts" inheritrefs="true">
+ <property name="ior" value="file:/${build.dir}/NS.ior"/>
+ </ant>
+ </target>
+
+ <target name="deploy"
+ description="run local JTS example">
+ <property name="julia.cfg" value="${build.dir}/${cfg.dir}/julia.cfg"/>
+ <property name="cache.cfg" value="${build.dir}/${cfg.dir}/cache.cfg"/>
+ <java classname="org.objectweb.fractal.adl.Launcher"
+ fork="yes" failonerror="yes">
+ <classpath refid="classpath"/>
+ <bootclasspath refid="bootclasspath"/>
+ <sysproperty key="fractal.provider"
+ value="org.objectweb.fractal.julia.Julia"/>
+ <sysproperty key="julia.loader"
+ value="org.objectweb.fractal.julia.loader.DynamicLoader" />
+ <sysproperty key="julia.config"
+ value="${julia.cfg},${cache.cfg}" />
+ <sysproperty key="ORBInitRef.NameService"
value="file:/${build.dir}/NS.ior"/>
+ <arg line="-fractal org.objectweb.gotm.ots.service.FcExplorer r"/>
+ </java>
+ </target>
+</project>
\ No newline at end of file
Index:
gotm-ots/examples/service/src/fractal/org/objectweb/gotm/lib/FcExplorerImpl.fractal
diff -u /dev/null
gotm-ots/examples/service/src/fractal/org/objectweb/gotm/lib/FcExplorerImpl.fractal:1.1
--- /dev/null Mon Mar 14 13:42:02 2005
+++
gotm-ots/examples/service/src/fractal/org/objectweb/gotm/lib/FcExplorerImpl.fractal
Mon Mar 14 13:42:02 2005
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE definition PUBLIC "-//objectweb.org//DTD Fractal ADL 2.0//EN"
"classpath://org/objectweb/fractal/adl/xml/standard.dtd">
+<!--<!DOCTYPE definition PUBLIC "-//objectweb.org//DTD Fractal ADL 2.0//EN"
"classpath://org/objectweb/fractal/adl/xml/basic.dtd">-->
+
+<definition name="org.objectweb.gotm.lib.FcExplorerImpl">
+ <interface name="fcAppl" role="client"
+ signature="org.objectweb.fractal.api.Component" />
+
+ <content class="BrowserImpl"/>
+
+ <attributes signature="BrowserAttributes">
+ <attribute value="fractalProperties.xml" name="ConfigFiles"/>
+ </attributes>
+</definition>
Index:
gotm-ots/examples/service/src/fractal/org/objectweb/gotm/ots/service/FcApplication.fractal
diff -u /dev/null
gotm-ots/examples/service/src/fractal/org/objectweb/gotm/ots/service/FcApplication.fractal:1.1
--- /dev/null Mon Mar 14 13:42:02 2005
+++
gotm-ots/examples/service/src/fractal/org/objectweb/gotm/ots/service/FcApplication.fractal
Mon Mar 14 13:42:02 2005
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE definition PUBLIC
+ "-//objectweb.org//DTD Fractal ADL 2.0//EN"
+ "classpath://org/objectweb/fractal/adl/xml/basic.dtd">
+
+<definition name="org.objectweb.gotm.ots.service.FcApplication">
+ <component name="FcTransactionManager"
+ definition="org.objectweb.gotm.lib.FcTransactionManagerImpl"/>
+</definition>
\ No newline at end of file
Index:
gotm-ots/examples/service/src/fractal/org/objectweb/gotm/ots/service/FcExplorer.fractal
diff -u /dev/null
gotm-ots/examples/service/src/fractal/org/objectweb/gotm/ots/service/FcExplorer.fractal:1.1
--- /dev/null Mon Mar 14 13:42:02 2005
+++
gotm-ots/examples/service/src/fractal/org/objectweb/gotm/ots/service/FcExplorer.fractal
Mon Mar 14 13:42:02 2005
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE definition PUBLIC
+ "-//objectweb.org//DTD Fractal ADL 2.0//EN"
+ "classpath://org/objectweb/fractal/adl/xml/basic.dtd">
+
+<definition name="org.objectweb.gotm.ots.service.FcExplorer">
+ <component name="FcExplorer"
+ definition="org.objectweb.gotm.lib.FcExplorerImpl"/>
+ <component name="FcApplication"
+ definition="org.objectweb.gotm.ots.service.FcApplication"/>
+
+ <binding client="FcExplorer.fcAppl"
+ server="FcApplication.component"/>
+</definition>
\ No newline at end of file
Index:
gotm-ots/src/java/org/objectweb/gotm/lib/CosTransactions/ControlImpl.java
diff -u /dev/null
gotm-ots/src/java/org/objectweb/gotm/lib/CosTransactions/ControlImpl.java:1.1
--- /dev/null Mon Mar 14 13:42:02 2005
+++ gotm-ots/src/java/org/objectweb/gotm/lib/CosTransactions/ControlImpl.java
Mon Mar 14 13:42:01 2005
@@ -0,0 +1,78 @@
+/*====================================================================
+
+GoTM: GoTM is an open Transaction Monitor
+Copyright (C) 2003-2005 INRIA - Jacquard & USTL - LIFL - GOAL
+Contact: gotm-team@xxxxxxxxxxxxx
+
+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.1 of the License, or 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
+
+Initial developer(s): Romain Rouvoy.
+Contributor(s): .
+
+---------------------------------------------------------------------
+$Id: ControlImpl.java,v 1.1 2005/03/14 12:42:01 rouvoy Exp $
+====================================================================*/
+package org.objectweb.gotm.lib.CosTransactions;
+
+import org.objectweb.fractal.api.NoSuchInterfaceException;
+import org.objectweb.fractal.lib.BindablePrimitive;
+import org.omg.CosTransactions.ControlOperations;
+import org.omg.CosTransactions.Coordinator;
+import org.omg.CosTransactions.Terminator;
+import org.omg.CosTransactions.Unavailable;
+
+/**
+ * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
+ * @created 3 mars 2005
+ * @modified $Date: 2005/03/14 12:42:01 $
+ * @version $Revision: 1.1 $
+ * @fractal.itf name="control"
signature="org.omg.CosTransactions.ControlOperations"
+ * @fractal.itf name="terminator" role="client"
signature="org.omg.CosTransactions.TerminatorOperations"
+ * @fractal.itf name="coordinator" role="client"
signature="org.omg.CosTransactions.CoordinatorOperations"
+ */
+public class ControlImpl
+ extends BindablePrimitive
+ implements ControlOperations {
+
+ /* (non-Javadoc)
+ * @see org.objectweb.fractal.lib.BindablePrimitive#clientFc()
+ */
+ protected String[] clientFc() {
+ return new String[] {"terminator","coordinator"};
+ }
+
+ /* (non-Javadoc)
+ * @see org.omg.CosTransactions.ControlOperations#get_terminator()
+ */
+ public Terminator get_terminator() throws Unavailable {
+ try {
+ return (Terminator) lookupFc("terminator");
+ } catch (NoSuchInterfaceException e) {
+ throw new Unavailable(e.getMessage());
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.omg.CosTransactions.ControlOperations#get_coordinator()
+ */
+ public Coordinator get_coordinator() throws Unavailable {
+ try {
+ return (Coordinator) lookupFc("coordinator");
+ } catch (NoSuchInterfaceException e) {
+ throw new Unavailable(e.getMessage());
+ }
+ }
+}
Index:
gotm-ots/src/java/org/objectweb/gotm/lib/CosTransactions/CurrentImpl.java
diff -u
gotm-ots/src/java/org/objectweb/gotm/lib/CosTransactions/CurrentImpl.java:1.1
gotm-ots/src/java/org/objectweb/gotm/lib/CosTransactions/CurrentImpl.java:1.2
---
gotm-ots/src/java/org/objectweb/gotm/lib/CosTransactions/CurrentImpl.java:1.1
Wed Mar 2 17:45:21 2005
+++ gotm-ots/src/java/org/objectweb/gotm/lib/CosTransactions/CurrentImpl.java
Mon Mar 14 13:42:01 2005
@@ -23,17 +23,14 @@
Contributor(s): .
---------------------------------------------------------------------
- $Id: CurrentImpl.java,v 1.1 2005/03/02 16:45:21 rouvoy Exp $
+ $Id: CurrentImpl.java,v 1.2 2005/03/14 12:42:01 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.CosTransactions;
import org.objectweb.fractal.api.NoSuchInterfaceException;
-import org.objectweb.fractal.corba.api.Poa;
import org.objectweb.gotm.lib.CurrentHandler;
import org.omg.CosTransactions.Control;
-import org.omg.CosTransactions.ControlHelper;
import org.omg.CosTransactions.ControlOperations;
-import org.omg.CosTransactions.ControlPOATie;
import org.omg.CosTransactions.CoordinatorOperations;
import org.omg.CosTransactions.CurrentOperations;
import org.omg.CosTransactions.HeuristicHazard;
@@ -43,14 +40,12 @@
import org.omg.CosTransactions.Status;
import org.omg.CosTransactions.TerminatorOperations;
import org.omg.CosTransactions.Unavailable;
-import org.omg.PortableServer.POAPackage.ServantNotActive;
-import org.omg.PortableServer.POAPackage.WrongPolicy;
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy </a>
* @created 1 févr. 2005
- * @modified $Date: 2005/03/02 16:45:21 $
- * @version $Revision: 1.1 $
+ * @modified $Date: 2005/03/14 12:42:01 $
+ * @version $Revision: 1.2 $
* @fractal.itf name="corba" role="client"
* signature="org.objectweb.gotm.lib.CosTransactions.Corba"
*/
@@ -58,15 +53,6 @@
extends CurrentHandler
implements CurrentOperations {
- protected Poa getPoa() {
- try {
- return (Poa) lookupFc(Poa.POA_ITF);
- } catch (NoSuchInterfaceException e) {
- getTrace().error(e.getMessage());
- return null;
- }
- }
-
protected ControlOperations getControl() {
try {
return (ControlOperations)
getCurrentFc().getFcInterface("control");
@@ -190,13 +176,7 @@
* @see org.omg.CosTransactions.CurrentOperations#get_control()
*/
public Control get_control() {
- try {
- return
ControlHelper.narrow(getCorba().getPOA().servant_to_reference(new
ControlPOATie(getControl())));
- } catch (ServantNotActive e) {
- getTrace().error(e.getMessage());
- } catch (WrongPolicy e) {
- getTrace().error(e.getMessage());
- }
+ // TODO: return the remote interface.
return null;
}
Index:
gotm-ots/src/java/org/objectweb/gotm/lib/CosTransactions/ResourceImpl.java
diff -u /dev/null
gotm-ots/src/java/org/objectweb/gotm/lib/CosTransactions/ResourceImpl.java:1.1
--- /dev/null Mon Mar 14 13:42:02 2005
+++
gotm-ots/src/java/org/objectweb/gotm/lib/CosTransactions/ResourceImpl.java
Mon Mar 14 13:42:01 2005
@@ -0,0 +1,64 @@
+/*====================================================================
+
+GoTM: GoTM is an open Transaction Monitor
+Copyright (C) 2003-2005 INRIA - Jacquard & USTL - LIFL - GOAL
+Contact: gotm-team@xxxxxxxxxxxxx
+
+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.1 of the License, or 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
+
+Initial developer(s): Romain Rouvoy.
+Contributor(s): .
+
+---------------------------------------------------------------------
+$Id: ResourceImpl.java,v 1.1 2005/03/14 12:42:01 rouvoy Exp $
+====================================================================*/
+package org.objectweb.gotm.lib.CosTransactions;
+
+import java.util.Map;
+
+import org.objectweb.transaction.lib.resource.ResourceEventCommit;
+import org.objectweb.transaction.lib.resource.ResourceEventRollback;
+import org.objectweb.transaction.lib.resource.ResourceEventVote;
+
+/**
+ * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
+ * @created 3 mars 2005
+ * @modified $Date: 2005/03/14 12:42:01 $
+ * @version $Revision: 1.1 $
+ * @fractal.itf
+ */
+public class ResourceImpl
+ extends org.objectweb.gotm.lib.resource.ResourceImpl {
+
+ /* (non-Javadoc)
+ * @see
org.objectweb.gotm.lib.resource.ResourceImpl#configureAction(java.lang.String,
java.util.Map, java.lang.Object)
+ */
+ protected Runnable configureAction(String topic, Map context,
+ Object resource) {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.objectweb.gotm.lib.event.SubscribablePrimitive#getEvents()
+ */
+ protected String[] getEvents() {
+ return new String[] {
+ ResourceEventVote.event.getLabel(),
+ ResourceEventCommit.event.getLabel(),
+ ResourceEventRollback.event.getLabel()
+ };
+ }
+}
Index:
gotm-ots/src/java/org/objectweb/gotm/lib/CosTransactions/StatusConverter.java
diff -u
gotm-ots/src/java/org/objectweb/gotm/lib/CosTransactions/StatusConverter.java:1.1
gotm-ots/src/java/org/objectweb/gotm/lib/CosTransactions/StatusConverter.java:1.2
---
gotm-ots/src/java/org/objectweb/gotm/lib/CosTransactions/StatusConverter.java:1.1
Wed Mar 2 17:45:21 2005
+++
gotm-ots/src/java/org/objectweb/gotm/lib/CosTransactions/StatusConverter.java
Mon Mar 14 13:42:01 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
-$Id: StatusConverter.java,v 1.1 2005/03/02 16:45:21 rouvoy Exp $
+$Id: StatusConverter.java,v 1.2 2005/03/14 12:42:01 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.CosTransactions;
@@ -44,8 +44,9 @@
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
* @created 1 févr. 2005
- * @modified $Date: 2005/03/02 16:45:21 $
- * @version $Revision: 1.1 $
+ * @modified $Date: 2005/03/14 12:42:01 $
+ * @version $Revision: 1.2 $
+ * @fractal.itf
*/
public class StatusConverter
extends AbstractEventConverter {
Index:
gotm-ots/src/java/org/objectweb/gotm/lib/CosTransactions/TransactionFactoryImpl.java
diff -u /dev/null
gotm-ots/src/java/org/objectweb/gotm/lib/CosTransactions/TransactionFactoryImpl.java:1.1
--- /dev/null Mon Mar 14 13:42:02 2005
+++
gotm-ots/src/java/org/objectweb/gotm/lib/CosTransactions/TransactionFactoryImpl.java
Mon Mar 14 13:42:01 2005
@@ -0,0 +1,94 @@
+/*====================================================================
+
+GoTM: GoTM is an open Transaction Monitor
+Copyright (C) 2003-2005 INRIA - Jacquard & USTL - LIFL - GOAL
+Contact: gotm-team@xxxxxxxxxxxxx
+
+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.1 of the License, or 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
+
+Initial developer(s): Romain Rouvoy.
+Contributor(s): .
+
+---------------------------------------------------------------------
+$Id: TransactionFactoryImpl.java,v 1.1 2005/03/14 12:42:01 rouvoy Exp $
+====================================================================*/
+package org.objectweb.gotm.lib.CosTransactions;
+
+import org.objectweb.fractal.api.Component;
+import org.objectweb.fractal.api.NoSuchInterfaceException;
+import org.objectweb.fractal.api.factory.Factory;
+import org.objectweb.fractal.api.factory.InstantiationException;
+import org.objectweb.fractal.lib.BindablePrimitive;
+import org.omg.CosTransactions.Control;
+import org.omg.CosTransactions.PropagationContext;
+import org.omg.CosTransactions.TransactionFactoryOperations;
+
+/**
+ * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
+ * @created 3 mars 2005
+ * @modified $Date: 2005/03/14 12:42:01 $
+ * @version $Revision: 1.1 $
+ * @fractal.itf name="transaction-factory"
signature="org.omg.CosTransactions.TransactionFactoryOperations"
+ * @fractal.itf name="factory" role="client"
signature="org.objectweb.fractal.api.Component"
+ */
+public class TransactionFactoryImpl
+ extends BindablePrimitive
+ implements TransactionFactoryOperations {
+
+ /** Fractal ADL Identifier for the <code>FACTORY</code> interface. */
+ public static final String FACTORY = "factory";
+
+ /* (non-Javadoc)
+ * @see org.objectweb.fractal.lib.BindablePrimitive#clientFc()
+ */
+ protected String[] clientFc() {
+ return new String[] {FACTORY};
+ }
+
+ /**
+ * @return the transaction factory.
+ */
+ private Factory getFactory() {
+ try {
+ Component cpt = (Component) lookupFc(FACTORY);
+ return (Factory) cpt.getFcInterface("factory");
+ } catch (NoSuchInterfaceException e) {
+ getTrace().error(e.getMessage());
+ return null ;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.omg.CosTransactions.TransactionFactoryOperations#create(int)
+ */
+ public Control create(int time_out) {
+ try {
+ return (Control)
getFactory().newFcInstance().getFcInterface("control");
+ } catch (InstantiationException e) {
+ e.printStackTrace();
+ } catch (NoSuchInterfaceException e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see
org.omg.CosTransactions.TransactionFactoryOperations#recreate(org.omg.CosTransactions.PropagationContext)
+ */
+ public Control recreate(PropagationContext ctx) {
+ return create(ctx.timeout);
+ }
+}
Index:
gotm-ots/src/java/org/objectweb/gotm/lib/CosTransactions/TransactionImpl.java
diff -u
gotm-ots/src/java/org/objectweb/gotm/lib/CosTransactions/TransactionImpl.java:1.1
gotm-ots/src/java/org/objectweb/gotm/lib/CosTransactions/TransactionImpl.java:1.2
---
gotm-ots/src/java/org/objectweb/gotm/lib/CosTransactions/TransactionImpl.java:1.1
Wed Mar 2 17:45:21 2005
+++
gotm-ots/src/java/org/objectweb/gotm/lib/CosTransactions/TransactionImpl.java
Mon Mar 14 13:42:01 2005
@@ -23,12 +23,11 @@
Contributor(s): .
---------------------------------------------------------------------
-$Id: TransactionImpl.java,v 1.1 2005/03/02 16:45:21 rouvoy Exp $
+$Id: TransactionImpl.java,v 1.2 2005/03/14 12:42:01 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.CosTransactions;
import org.objectweb.fractal.api.NoSuchInterfaceException;
-import org.objectweb.fractal.corba.Corba;
import org.objectweb.fractal.lib.BindablePrimitive;
import org.objectweb.gotm.lib.event.EventConverter;
import org.objectweb.transaction.api.coordination.CoordinationFeature;
@@ -38,47 +37,36 @@
import org.objectweb.transaction.api.transaction.TransactionState;
import org.objectweb.transaction.api.transaction.TransactionStatusFeature;
import org.omg.CosTransactions.Control;
-import org.omg.CosTransactions.ControlOperations;
import org.omg.CosTransactions.Coordinator;
-import org.omg.CosTransactions.CoordinatorHelper;
import org.omg.CosTransactions.CoordinatorOperations;
-import org.omg.CosTransactions.CoordinatorPOATie;
import org.omg.CosTransactions.PropagationContext;
import org.omg.CosTransactions.RecoveryCoordinator;
import org.omg.CosTransactions.Resource;
import org.omg.CosTransactions.Status;
import org.omg.CosTransactions.SubtransactionAwareResource;
import org.omg.CosTransactions.Synchronization;
-import org.omg.CosTransactions.Terminator;
-import org.omg.CosTransactions.TerminatorHelper;
import org.omg.CosTransactions.TerminatorOperations;
-import org.omg.CosTransactions.TerminatorPOATie;
-import org.omg.CosTransactions.Unavailable;
-import org.omg.PortableServer.POAPackage.ServantNotActive;
-import org.omg.PortableServer.POAPackage.WrongPolicy;
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
* @created 1 févr. 2005
- * @modified $Date: 2005/03/02 16:45:21 $
- * @version $Revision: 1.1 $
- * @fractal.itf name="control"
signature="org.omg.CosTransactions.ControlOperations"
+ * @modified $Date: 2005/03/14 12:42:01 $
+ * @version $Revision: 1.2 $
* @fractal.itf name="coordinator"
signature="org.omg.CosTransactions.CoordinatorOperations"
* @fractal.itf name="terminator"
signature="org.omg.CosTransactions.TerminatorOperations"
* @fractal.itf name="commit" role="client"
signature="org.objectweb.transaction.api.coordination.CoordinationFeature"
* @fractal.itf name="rollback" role="client"
signature="org.objectweb.transaction.api.coordination.CoordinationFeature"
* @fractal.itf name="synchronization" role="client"
signature="org.objectweb.gotm.lib.resource.Resource"
- * @fractal.itf name="res-subscribe" role="client"
signature="org.objectweb.transaction.api.event.SubscribeFeature"
+ * @fractal.itf name="resource" role="client"
signature="org.objectweb.gotm.lib.resource.Resource"
* @fractal.itf name="tx-status" role="client"
signature="org.objectweb.transaction.api.transaction.TransactionStatusFeature"
* @fractal.itf name="tx-activation" role="client"
signature="org.objectweb.transaction.api.transaction.TransactionActivationFeature"
* @fractal.itf name="tx-interruption" role="client"
signature="org.objectweb.transaction.api.transaction.TransactionInterruptionFeature"
* @fractal.itf name="tx-state" role="client"
signature="org.objectweb.transaction.api.transaction.TransactionState"
* @fractal.itf name="status-converter" role="client"
signature="org.objectweb.gotm.lib.event.EventConverter"
- * @fractal.itf name="corba" role="client"
signature="org.objectweb.gotm.lib.CosTransactions.Corba"
*/
public class TransactionImpl
extends BindablePrimitive
- implements ControlOperations, TerminatorOperations,
+ implements TerminatorOperations,
CoordinatorOperations
{
/** Fractal ADL Identifier for the <code>COMMIT</code> interface. */
@@ -88,7 +76,7 @@
/** Fractal ADL Identifier for the <code>SYNCHRONIZATION</code>
interface. */
public static final String SYNCHRONIZATION ="synchronization" ;
/** Fractal ADL Identifier for the <code>RESOURCE</code> interface. */
- public static final String RESOURCE = "res-subscribe";
+ public static final String RESOURCE = "resource";
/** Fractal ADL Identifier for the <code>STATUS_CONVERTER</code>
interface. */
public static final String STATUS_CONVERTER = "status-converter";
@@ -104,20 +92,10 @@
TransactionState.TRANSACTION_STATE,
SYNCHRONIZATION,
RESOURCE,
- STATUS_CONVERTER,
- Corba.CORBA
+ STATUS_CONVERTER
};
}
- protected Corba getCorba() {
- try {
- return (Corba) lookupFc(Corba.CORBA);
- } catch (NoSuchInterfaceException e) {
- getTrace().error(e.getMessage());
- return null;
- }
- }
-
/**
* @return Returns the txStatus.
*/
@@ -223,32 +201,6 @@
}
}
- /* (non-Javadoc)
- * @see org.omg.CosTransactions.ControlOperations#get_terminator()
- */
- public Terminator get_terminator() throws Unavailable {
- try {
- return
TerminatorHelper.narrow(getCorba().getPOA().servant_to_reference(new
TerminatorPOATie(this)));
- } catch (ServantNotActive e) {
- throw new Unavailable(e.getMessage());
- } catch (WrongPolicy e) {
- throw new Unavailable(e.getMessage());
- }
- }
-
- /* (non-Javadoc)
- * @see org.omg.CosTransactions.ControlOperations#get_coordinator()
- */
- public Coordinator get_coordinator() throws Unavailable {
- try {
- return
CoordinatorHelper.narrow(getCorba().getPOA().servant_to_reference(new
CoordinatorPOATie(this)));
- } catch (ServantNotActive e) {
- throw new Unavailable(e.getMessage());
- } catch (WrongPolicy e) {
- throw new Unavailable(e.getMessage());
- }
- }
-
/* (non-Javadoc)
* @see org.omg.CosTransactions.TerminatorOperations#commit(boolean)
*/
| <-- Date Index --> | <-- Thread Index --> |
Powered by MHonArc.
Copyright © 2006-2007, OW2 Consortium | contact | webmaster.