Mail Archive Home | gotm-commits List | November 2005 Index
| <-- Date Index --> | <-- Thread Index --> |
Date: Thursday, November 17, 2005 @ 14:04:24
Author: rouvoy
Path: /cvsroot/gotm/gotm/src
Added: java/org/objectweb/gotm/lib/action/Action.java
java/org/objectweb/gotm/lib/action/ActionProvider.java
java/org/objectweb/gotm/lib/action/ActionProviderAbstract.java
java/org/objectweb/gotm/lib/action/NoActionAvailableException.java
java/org/objectweb/gotm/lib/action/RunnableAction.java
java/org/objectweb/gotm/lib/coordination/CoordinationFeatureAbstract.java
java/org/objectweb/gotm/lib/coordination/TransactionAbortedException.java
java/org/objectweb/gotm/lib/coordination/TwoPCActionProvider.java
Modified: fractal/org/objectweb/gotm/lib/coordination/FcCommitEngine.fractal
java/org/objectweb/gotm/api/TransactionService.java
java/org/objectweb/gotm/lib/coordination/AbortFeature.java
java/org/objectweb/gotm/lib/coordination/CommitFeature.java
java/org/objectweb/gotm/lib/coordination/PrepareFeature.java
java/org/objectweb/gotm/lib/coordination/ProbeCommitProtocol.java
java/org/objectweb/gotm/lib/coordination/TimeoutImpl.java
java/org/objectweb/gotm/lib/coordination/TwoPCFeature.java
java/org/objectweb/gotm/lib/current/CurrentManager.java
java/org/objectweb/gotm/lib/current/CurrentManagerThreadLocal.java
java/org/objectweb/gotm/lib/current/CurrentManagerWithReference.java
java/org/objectweb/gotm/lib/factory/Configurable.java
java/org/objectweb/gotm/lib/factory/TransactionFactory.java
java/org/objectweb/gotm/lib/factory/TransactionFactoryAdaptive.java
java/org/objectweb/gotm/lib/factory/TransactionFactoryAttributeController.java
java/org/objectweb/gotm/lib/factory/TransactionFactoryCache.java
java/org/objectweb/gotm/lib/factory/TransactionFactoryImpl.java
java/org/objectweb/gotm/lib/factory/TransactionFactoryObservable.java
java/org/objectweb/gotm/lib/logging/HOWLoggerProvider.java
java/org/objectweb/gotm/lib/message/AbstractEventConverter.java
java/org/objectweb/gotm/lib/message/EventConverter.java
java/org/objectweb/gotm/lib/message/PublishSimple.java
java/org/objectweb/gotm/lib/message/SubscriberPool.java
java/org/objectweb/gotm/lib/probe/ProbeAbstract.java
java/org/objectweb/gotm/lib/reference/ReferenceFeature.java
java/org/objectweb/gotm/lib/reference/ReferenceManager.java
java/org/objectweb/gotm/lib/reference/ReferenceNotFoundException.java
java/org/objectweb/gotm/lib/resource/ResourceManagerASync.java
java/org/objectweb/gotm/lib/resource/ResourceManagerAbstract.java
java/org/objectweb/gotm/lib/resource/ResourceManagerImpl.java
java/org/objectweb/gotm/lib/resource/ResourceManagerWithPool.java
java/org/objectweb/gotm/lib/resource/ResourceManagerWithThread.java
java/org/objectweb/gotm/lib/stat/EventCounter.java
java/org/objectweb/gotm/lib/stat/EventCounterImpl.java
Removed:
java/org/objectweb/gotm/lib/coordination/AbstractCoordinationFeature.java
java/org/objectweb/gotm/lib/resource/Action.java
java/org/objectweb/gotm/lib/resource/ActionProvider.java
java/org/objectweb/gotm/lib/resource/ActionProviderAbstract.java
java/org/objectweb/gotm/lib/resource/NoActionAvailableException.java
java/org/objectweb/gotm/lib/resource/RunnableAction.java
* Cosmetic update to remove french accents in Javadoc.
* Upgrading implementation to respect JTS JUnit tests.
* Updating JTS benchmark.
--------------------------------------------------------------------------------+
fractal/org/objectweb/gotm/lib/coordination/FcCommitEngine.fractal
| 12
java/org/objectweb/gotm/api/TransactionService.java
| 8
java/org/objectweb/gotm/lib/action/Action.java
| 48 +++
java/org/objectweb/gotm/lib/action/ActionProvider.java
| 56 ++++
java/org/objectweb/gotm/lib/action/ActionProviderAbstract.java
| 77 +++++
java/org/objectweb/gotm/lib/action/NoActionAvailableException.java
| 47 +++
java/org/objectweb/gotm/lib/action/RunnableAction.java
| 63 ++++
java/org/objectweb/gotm/lib/coordination/AbortFeature.java
| 10
java/org/objectweb/gotm/lib/coordination/AbstractCoordinationFeature.java
| 96 ------
java/org/objectweb/gotm/lib/coordination/CommitFeature.java
| 12
java/org/objectweb/gotm/lib/coordination/CoordinationFeatureAbstract.java
| 96 ++++++
java/org/objectweb/gotm/lib/coordination/PrepareFeature.java
| 14 -
java/org/objectweb/gotm/lib/coordination/ProbeCommitProtocol.java
| 8
java/org/objectweb/gotm/lib/coordination/TimeoutImpl.java
| 52 +++
java/org/objectweb/gotm/lib/coordination/TransactionAbortedException.java
| 40 ++
java/org/objectweb/gotm/lib/coordination/TwoPCActionProvider.java
| 139 ++++++++++
java/org/objectweb/gotm/lib/coordination/TwoPCFeature.java
| 71 +----
java/org/objectweb/gotm/lib/current/CurrentManager.java
| 8
java/org/objectweb/gotm/lib/current/CurrentManagerThreadLocal.java
| 8
java/org/objectweb/gotm/lib/current/CurrentManagerWithReference.java
| 8
java/org/objectweb/gotm/lib/factory/Configurable.java
| 8
java/org/objectweb/gotm/lib/factory/TransactionFactory.java
| 8
java/org/objectweb/gotm/lib/factory/TransactionFactoryAdaptive.java
| 8
java/org/objectweb/gotm/lib/factory/TransactionFactoryAttributeController.java
| 8
java/org/objectweb/gotm/lib/factory/TransactionFactoryCache.java
| 12
java/org/objectweb/gotm/lib/factory/TransactionFactoryImpl.java
| 8
java/org/objectweb/gotm/lib/factory/TransactionFactoryObservable.java
| 12
java/org/objectweb/gotm/lib/logging/HOWLoggerProvider.java
| 10
java/org/objectweb/gotm/lib/message/AbstractEventConverter.java
| 8
java/org/objectweb/gotm/lib/message/EventConverter.java
| 8
java/org/objectweb/gotm/lib/message/PublishSimple.java
| 14 -
java/org/objectweb/gotm/lib/message/SubscriberPool.java
| 59 ++--
java/org/objectweb/gotm/lib/probe/ProbeAbstract.java
| 8
java/org/objectweb/gotm/lib/reference/ReferenceFeature.java
| 8
java/org/objectweb/gotm/lib/reference/ReferenceManager.java
| 8
java/org/objectweb/gotm/lib/reference/ReferenceNotFoundException.java
| 8
java/org/objectweb/gotm/lib/resource/Action.java
| 47 ---
java/org/objectweb/gotm/lib/resource/ActionProvider.java
| 56 ----
java/org/objectweb/gotm/lib/resource/ActionProviderAbstract.java
| 83 -----
java/org/objectweb/gotm/lib/resource/NoActionAvailableException.java
| 47 ---
java/org/objectweb/gotm/lib/resource/ResourceManagerASync.java
| 11
java/org/objectweb/gotm/lib/resource/ResourceManagerAbstract.java
| 19 -
java/org/objectweb/gotm/lib/resource/ResourceManagerImpl.java
| 9
java/org/objectweb/gotm/lib/resource/ResourceManagerWithPool.java
| 11
java/org/objectweb/gotm/lib/resource/ResourceManagerWithThread.java
| 10
java/org/objectweb/gotm/lib/resource/RunnableAction.java
| 63 ----
java/org/objectweb/gotm/lib/stat/EventCounter.java
| 8
java/org/objectweb/gotm/lib/stat/EventCounterImpl.java
| 8
48 files changed, 818 insertions(+), 622 deletions(-)
Index:
gotm/src/fractal/org/objectweb/gotm/lib/coordination/FcCommitEngine.fractal
diff -u
gotm/src/fractal/org/objectweb/gotm/lib/coordination/FcCommitEngine.fractal:1.3
gotm/src/fractal/org/objectweb/gotm/lib/coordination/FcCommitEngine.fractal:1.4
---
gotm/src/fractal/org/objectweb/gotm/lib/coordination/FcCommitEngine.fractal:1.3
Mon Nov 7 09:50:34 2005
+++
gotm/src/fractal/org/objectweb/gotm/lib/coordination/FcCommitEngine.fractal
Thu Nov 17 14:04:23 2005
@@ -40,6 +40,8 @@
definition="org.objectweb.gotm.lib.coordination.FcTimeoutImpl"/>
<component name="Fc2PC"
definition="org.objectweb.gotm.lib.coordination.FcTwoPCFeature"/>
+ <component name="Fc2PCActions"
+
definition="org.objectweb.gotm.lib.coordination.FcTwoPCActionProvider"/>
<component name="FcPrepare"
definition="org.objectweb.gotm.lib.coordination.FcPrepareFeature"/>
<component name="FcCommit"
@@ -53,9 +55,13 @@
<binding client="this.abort" server="FcAbort.coord-process"/>
<binding client="this.timeout-attr" server="Timeout.timeout-attr"/>
- <binding client="Fc2PC.prepare" server="FcPrepare.coord-process"/>
- <binding client="Fc2PC.commit" server="FcCommit.coord-process"/>
- <binding client="Fc2PC.abort" server="FcAbort.coord-process"/>
+
+ <binding client="Fc2PC.tx-state" server="this.tx-state"/>
+ <binding client="Fc2PC.action-provider"
server="Fc2PCActions.action-provider"/>
+
+ <binding client="Fc2PCActions.prepare" server="FcPrepare.coord-process"/>
+ <binding client="Fc2PCActions.commit" server="FcCommit.coord-process"/>
+ <binding client="Fc2PCActions.abort" server="FcAbort.coord-process"/>
<binding client="FcPrepare.tx-state" server="this.tx-state"/>
<binding client="FcPrepare.publish" server="this.prepare-decision"/>
Index: gotm/src/java/org/objectweb/gotm/api/TransactionService.java
diff -u gotm/src/java/org/objectweb/gotm/api/TransactionService.java:1.2
gotm/src/java/org/objectweb/gotm/api/TransactionService.java:1.3
--- gotm/src/java/org/objectweb/gotm/api/TransactionService.java:1.2 Tue
Sep 6 10:01:47 2005
+++ gotm/src/java/org/objectweb/gotm/api/TransactionService.java Thu
Nov 17 14:04:23 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
- $Id: TransactionService.java,v 1.2 2005/09/06 08:01:47 rouvoy Exp $
+ $Id: TransactionService.java,v 1.3 2005/11/17 13:04:23 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.api;
@@ -31,9 +31,9 @@
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @created 9 août 2005
- * @modified $Date: 2005/09/06 08:01:47 $
- * @version $Revision: 1.2 $
+ * @created 9 aug. 2005
+ * @modified $Date: 2005/11/17 13:04:23 $
+ * @version $Revision: 1.3 $
* @fractal.itf
*/
public interface TransactionService
Index: gotm/src/java/org/objectweb/gotm/lib/action/Action.java
diff -u /dev/null gotm/src/java/org/objectweb/gotm/lib/action/Action.java:1.1
--- /dev/null Thu Nov 17 14:04:24 2005
+++ gotm/src/java/org/objectweb/gotm/lib/action/Action.java Thu Nov 17
14:04:22 2005
@@ -0,0 +1,48 @@
+/*====================================================================
+
+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: Action.java,v 1.1 2005/11/17 13:04:22 rouvoy Exp $
+====================================================================*/
+package org.objectweb.gotm.lib.action;
+
+import java.util.Map;
+
+/**
+ * Interface Action used by the resource to propagate the incoming events.
+ * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
+ * @created 22 avr. 2005
+ * @modified $Date: 2005/11/17 13:04:22 $
+ * @version $Revision: 1.1 $
+ */
+public interface Action
+{
+ /**
+ * Executes the action on the resource object using the context
information.
+ * @param context additional information.
+ * @param resource the resource to apply the action.
+ * @throws Exception error during execution of the action.
+ */
+ void execute(Map context, Object resource) throws Exception;
+}
Index: gotm/src/java/org/objectweb/gotm/lib/action/ActionProvider.java
diff -u /dev/null
gotm/src/java/org/objectweb/gotm/lib/action/ActionProvider.java:1.1
--- /dev/null Thu Nov 17 14:04:24 2005
+++ gotm/src/java/org/objectweb/gotm/lib/action/ActionProvider.java Thu
Nov 17 14:04:22 2005
@@ -0,0 +1,56 @@
+/*====================================================================
+
+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: ActionProvider.java,v 1.1 2005/11/17 13:04:22 rouvoy Exp $
+====================================================================*/
+package org.objectweb.gotm.lib.action;
+
+import org.objectweb.transaction.api.message.Event;
+
+/**
+ * Interface providing all the actions handled by a kind of resource.
+ * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
+ * @created 4 juil. 2005
+ * @modified $Date: 2005/11/17 13:04:22 $
+ * @version $Revision: 1.1 $
+ * @fractal.itf name="action-provider"
+ */
+public interface ActionProvider {
+
+ /** Fractal ADL Identifier for the <code>ActionProvider</code>
interface.*/
+ public static final String ACTION_PROVIDER="action-provider";
+
+ /**
+ * @param name the transaction status identifier.
+ * @return the action associated to the transaction status.
+ */
+ Action action(Event name);
+
+ /**
+ * Provides the list of transaction status handled.
+ * @return the list of handled events.
+ */
+ Event[] events() ;
+}
\ No newline at end of file
Index: gotm/src/java/org/objectweb/gotm/lib/action/ActionProviderAbstract.java
diff -u /dev/null
gotm/src/java/org/objectweb/gotm/lib/action/ActionProviderAbstract.java:1.1
--- /dev/null Thu Nov 17 14:04:24 2005
+++ gotm/src/java/org/objectweb/gotm/lib/action/ActionProviderAbstract.java
Thu Nov 17 14:04:22 2005
@@ -0,0 +1,77 @@
+/*====================================================================
+
+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: ActionProviderAbstract.java,v 1.1 2005/11/17 13:04:22 rouvoy Exp $
+====================================================================*/
+package org.objectweb.gotm.lib.action;
+
+import java.util.Map;
+import java.util.Set;
+
+import org.objectweb.fractal.lib.BindablePrimitive;
+import org.objectweb.transaction.api.message.Event;
+
+/**
+ * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
+ * @created 4 juil. 2005
+ * @modified $Date: 2005/11/17 13:04:22 $
+ * @version $Revision: 1.1 $
+ * @fractal.itf
+ */
+public abstract class ActionProviderAbstract
+ extends BindablePrimitive
+ implements ActionProvider {
+
+ /** list of available actions. */
+ private final Map actions = actions();
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.objectweb.gotm.lib.resource.ActionProvider#getEvents()
+ */
+ public Event[] events() {
+ Set events = this.actions.keySet();
+ if (getLogger().isLoggable(DEBUG)) getLogger().log(DEBUG, "Actions
configured for events: "+events);
+ return (Event[]) events.toArray(new Event[events.size()]);
+ }
+
+ /**
+ * Defines the list of available actions for the associated resource.
+ *
+ * @return the list of labelled actions.
+ */
+ protected abstract Map actions();
+
+ /* (non-Javadoc)
+ * @see org.objectweb.gotm.lib.resource.ActionProvider#getAction(int)
+ */
+ public Action action(Event name) {
+ Action a = (Action) this.actions.get(name);
+// if (getLogger().isLoggable(DEBUG)) getLogger().log(DEBUG, "Loading
Action "+name+" as "+a);
+ if (a == null ) throw new NoActionAvailableException(name);
+ return a;
+ }
+}
\ No newline at end of file
Index:
gotm/src/java/org/objectweb/gotm/lib/action/NoActionAvailableException.java
diff -u /dev/null
gotm/src/java/org/objectweb/gotm/lib/action/NoActionAvailableException.java:1.1
--- /dev/null Thu Nov 17 14:04:24 2005
+++
gotm/src/java/org/objectweb/gotm/lib/action/NoActionAvailableException.java
Thu Nov 17 14:04:22 2005
@@ -0,0 +1,47 @@
+/*====================================================================
+
+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: NoActionAvailableException.java,v 1.1 2005/11/17 13:04:22 rouvoy Exp $
+====================================================================*/
+package org.objectweb.gotm.lib.action;
+
+import org.objectweb.gotm.GoTMException;
+import org.objectweb.transaction.api.message.Event;
+
+/**
+ * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
+ * @created 8 juil. 2005
+ * @modified $Date: 2005/11/17 13:04:22 $
+ * @version $Revision: 1.1 $
+ */
+public class NoActionAvailableException
+ extends GoTMException {
+ /**
+ * @param name the event raising the exception.
+ */
+ public NoActionAvailableException(Event name) {
+ super("No action available for the "+name.label()+" event!");
+ }
+}
Index: gotm/src/java/org/objectweb/gotm/lib/action/RunnableAction.java
diff -u /dev/null
gotm/src/java/org/objectweb/gotm/lib/action/RunnableAction.java:1.1
--- /dev/null Thu Nov 17 14:04:24 2005
+++ gotm/src/java/org/objectweb/gotm/lib/action/RunnableAction.java Thu
Nov 17 14:04:22 2005
@@ -0,0 +1,63 @@
+/*====================================================================
+
+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: RunnableAction.java,v 1.1 2005/11/17 13:04:22 rouvoy Exp $
+====================================================================*/
+package org.objectweb.gotm.lib.action;
+
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
+ * @created 2 mai 2005
+ * @modified $Date: 2005/11/17 13:04:22 $
+ * @version $Revision: 1.1 $
+ */
+public class RunnableAction
+ extends Thread {
+
+ private Action delegate ;
+ private Map context ;
+ private Object resource;
+
+ /**
+ * @param action
+ * @param ctx
+ * @param res
+ */
+ public RunnableAction(Action action, Map ctx, Object res) {
+ this.delegate = action ;
+ this.context = ctx ;
+ this.resource = res ;
+ }
+
+ public void run() {
+ try {
+ this.delegate.execute(this.context, this.resource);
+ }catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+}
Index: gotm/src/java/org/objectweb/gotm/lib/coordination/AbortFeature.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/coordination/AbortFeature.java:1.7
gotm/src/java/org/objectweb/gotm/lib/coordination/AbortFeature.java:1.8
--- gotm/src/java/org/objectweb/gotm/lib/coordination/AbortFeature.java:1.7
Tue Sep 6 10:01:46 2005
+++ gotm/src/java/org/objectweb/gotm/lib/coordination/AbortFeature.java Thu
Nov 17 14:04:23 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
-$Id: AbortFeature.java,v 1.7 2005/09/06 08:01:46 rouvoy Exp $
+$Id: AbortFeature.java,v 1.8 2005/11/17 13:04:23 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.coordination;
@@ -37,11 +37,11 @@
/**
* Implementation of the cancel process.
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @version $Revision: 1.7 $
+ * @version $Revision: 1.8 $
* @fractal.itf name="abort"
signature="org.objectweb.transaction.api.coordination.CoordinationFeature"
*/
public class AbortFeature
- extends AbstractCoordinationFeature
+ extends CoordinationFeatureAbstract
{
/** Fractal ADL Identifier for the <code>Prepare</code> interface. */
public static final String ABORT = "abort";
@@ -50,8 +50,8 @@
* @see
org.objectweb.transaction.api.coordination.CoordinationFeature#process(java.util.Map)
*/
public void execute(Map context) {
-// if (getLogger().isLoggable(DEBUG))
-// getLogger().log(DEBUG,"Processing Abort...");
+ if (getLogger().isLoggable(DEBUG))
+ getLogger().log(DEBUG,"Processing Abort...");
txState().setStatus(TransactionStatusRollingBack.status);
beginLog().log(TransactionStatusRollingBack.status.label().getBytes());
publisher().notify(ResourceEventRollback.event,context);
Index:
gotm/src/java/org/objectweb/gotm/lib/coordination/AbstractCoordinationFeature.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/coordination/AbstractCoordinationFeature.java:1.12
gotm/src/java/org/objectweb/gotm/lib/coordination/AbstractCoordinationFeature.java:removed
---
gotm/src/java/org/objectweb/gotm/lib/coordination/AbstractCoordinationFeature.java:1.12
Mon Nov 7 09:50:33 2005
+++
gotm/src/java/org/objectweb/gotm/lib/coordination/AbstractCoordinationFeature.java
Thu Nov 17 14:04:24 2005
@@ -1,96 +0,0 @@
-/*====================================================================
-
- GoTM: GoTM is an open Transaction Monitor
- Copyright (C) 2000-2004 INRIA & 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: AbstractCoordinationFeature.java,v 1.12 2005/11/07 08:50:33 rouvoy Exp
$
- ====================================================================*/
-
-package org.objectweb.gotm.lib.coordination;
-
-import org.objectweb.transaction.api.coordination.CoordinationFeature;
-import org.objectweb.transaction.api.logging.LoggerFeature;
-import org.objectweb.transaction.api.message.PublishFeature;
-import org.objectweb.transaction.api.transaction.TransactionState;
-
-import org.objectweb.fractal.lib.BindablePrimitive;
-
-/**
- * Abstract implementation of a validation engine.
- * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @created 5 janv. 2005
- * @modified $Date: 2005/11/07 08:50:33 $
- * @version $Revision: 1.12 $
- * @fractal.itf name="publish" role="client"
signature="org.objectweb.transaction.api.message.PublishFeature"
- * @fractal.itf name="tx-state" role="client"
signature="org.objectweb.transaction.api.transaction.TransactionState"
- * @fractal.itf name="begin-log" role="client"
signature="org.objectweb.transaction.api.logging.LoggerFeature"
contingency="optional"
- * @fractal.itf name="end-log" role="client"
signature="org.objectweb.transaction.api.logging.LoggerFeature"
contingency="optional"
- */
-public abstract class AbstractCoordinationFeature
- extends BindablePrimitive
- implements CoordinationFeature
-{
- /** Fractal ADL Identifier for the <code>LoggerFeature</code> interface.
*/
- public static final String BEGIN_LOG = "begin-log" ;
- /** Fractal ADL Identifier for the <code>LoggerFeature</code> interface.
*/
- public static final String END_LOG = "end-log" ;
-
- /* (non-Javadoc)
- * @see org.objectweb.gotm.lib.BindingFeature#clientFc()
- */
- protected String[] clientFc() {
- return new String[] {
- PublishFeature.PUBLISH_FEATURE,
- TransactionState.TRANSACTION_STATE,
- BEGIN_LOG, END_LOG
- };
- }
-
- /**
- * @return Returns the notifier.
- */
- protected final PublishFeature publisher() {
- return (PublishFeature) singletonFc(PublishFeature.PUBLISH_FEATURE);
- }
-
- /**
- * @return the transaction state.
- */
- protected final TransactionState txState() {
- return (TransactionState)
singletonFc(TransactionState.TRANSACTION_STATE);
- }
-
- /**
- * @return the recovery logger.
- */
- protected final LoggerFeature beginLog() {
- return (LoggerFeature) singletonFc(BEGIN_LOG);
- }
-
- /**
- * @return the recovery logger.
- */
- protected final LoggerFeature endLog() {
- return (LoggerFeature) singletonFc(END_LOG);
- }
-}
\ No newline at end of file
Index: gotm/src/java/org/objectweb/gotm/lib/coordination/CommitFeature.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/coordination/CommitFeature.java:1.10
gotm/src/java/org/objectweb/gotm/lib/coordination/CommitFeature.java:1.11
--- gotm/src/java/org/objectweb/gotm/lib/coordination/CommitFeature.java:1.10
Mon Nov 7 09:50:33 2005
+++ gotm/src/java/org/objectweb/gotm/lib/coordination/CommitFeature.java
Thu Nov 17 14:04:22 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
- $Id: CommitFeature.java,v 1.10 2005/11/07 08:50:33 rouvoy Exp $
+ $Id: CommitFeature.java,v 1.11 2005/11/17 13:04:22 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.coordination;
@@ -42,11 +42,11 @@
/**
* One phase validation process.
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @version $Revision: 1.10 $
+ * @version $Revision: 1.11 $
* @fractal.itf name="abort" role="client"
signature="org.objectweb.transaction.api.coordination.CoordinationFeature"
*/
public class CommitFeature
- extends AbstractCoordinationFeature
+ extends CoordinationFeatureAbstract
{
/** Fractal ADL Identifier for the <code>Prepare</code> interface. */
public static final String COMMIT = "commit";
@@ -73,9 +73,9 @@
/* (non-Javadoc)
* @see
org.objectweb.transaction.api.coordination.CoordinationFeature#process(java.util.Map)
*/
- public void execute(Map context) {
-// if (getLogger().isLoggable(DEBUG))
-// getLogger().log(DEBUG,"Processing Commit...");
+ public void execute(Map context) throws Exception {
+ if (getLogger().isLoggable(DEBUG))
+ getLogger().log(DEBUG,"Processing Commit...");
try {
txState().setStatus(TransactionStatusCommitting.status);
beginLog().log(TransactionStatusCommitting.status.label().getBytes());
Index:
gotm/src/java/org/objectweb/gotm/lib/coordination/CoordinationFeatureAbstract.java
diff -u /dev/null
gotm/src/java/org/objectweb/gotm/lib/coordination/CoordinationFeatureAbstract.java:1.1
--- /dev/null Thu Nov 17 14:04:24 2005
+++
gotm/src/java/org/objectweb/gotm/lib/coordination/CoordinationFeatureAbstract.java
Thu Nov 17 14:04:23 2005
@@ -0,0 +1,96 @@
+/*====================================================================
+
+ GoTM: GoTM is an open Transaction Monitor
+ Copyright (C) 2000-2004 INRIA & 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: CoordinationFeatureAbstract.java,v 1.1 2005/11/17 13:04:23 rouvoy Exp $
+ ====================================================================*/
+
+package org.objectweb.gotm.lib.coordination;
+
+import org.objectweb.transaction.api.coordination.CoordinationFeature;
+import org.objectweb.transaction.api.logging.LoggerFeature;
+import org.objectweb.transaction.api.message.PublishFeature;
+import org.objectweb.transaction.api.transaction.TransactionState;
+
+import org.objectweb.fractal.lib.BindablePrimitive;
+
+/**
+ * Abstract implementation of a validation engine.
+ * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
+ * @created 5 janv. 2005
+ * @modified $Date: 2005/11/17 13:04:23 $
+ * @version $Revision: 1.1 $
+ * @fractal.itf name="publish" role="client"
signature="org.objectweb.transaction.api.message.PublishFeature"
+ * @fractal.itf name="tx-state" role="client"
signature="org.objectweb.transaction.api.transaction.TransactionState"
+ * @fractal.itf name="begin-log" role="client"
signature="org.objectweb.transaction.api.logging.LoggerFeature"
contingency="optional"
+ * @fractal.itf name="end-log" role="client"
signature="org.objectweb.transaction.api.logging.LoggerFeature"
contingency="optional"
+ */
+public abstract class CoordinationFeatureAbstract
+ extends BindablePrimitive
+ implements CoordinationFeature
+{
+ /** Fractal ADL Identifier for the <code>LoggerFeature</code> interface.
*/
+ public static final String BEGIN_LOG = "begin-log" ;
+ /** Fractal ADL Identifier for the <code>LoggerFeature</code> interface.
*/
+ public static final String END_LOG = "end-log" ;
+
+ /* (non-Javadoc)
+ * @see org.objectweb.gotm.lib.BindingFeature#clientFc()
+ */
+ protected String[] clientFc() {
+ return new String[] {
+ PublishFeature.PUBLISH_FEATURE,
+ TransactionState.TRANSACTION_STATE,
+ BEGIN_LOG, END_LOG
+ };
+ }
+
+ /**
+ * @return Returns the notifier.
+ */
+ protected final PublishFeature publisher() {
+ return (PublishFeature) singletonFc(PublishFeature.PUBLISH_FEATURE);
+ }
+
+ /**
+ * @return the transaction state.
+ */
+ protected final TransactionState txState() {
+ return (TransactionState)
singletonFc(TransactionState.TRANSACTION_STATE);
+ }
+
+ /**
+ * @return the recovery logger.
+ */
+ protected final LoggerFeature beginLog() {
+ return (LoggerFeature) singletonFc(BEGIN_LOG);
+ }
+
+ /**
+ * @return the recovery logger.
+ */
+ protected final LoggerFeature endLog() {
+ return (LoggerFeature) singletonFc(END_LOG);
+ }
+}
\ No newline at end of file
Index: gotm/src/java/org/objectweb/gotm/lib/coordination/PrepareFeature.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/coordination/PrepareFeature.java:1.1
gotm/src/java/org/objectweb/gotm/lib/coordination/PrepareFeature.java:1.2
--- gotm/src/java/org/objectweb/gotm/lib/coordination/PrepareFeature.java:1.1
Tue Sep 6 10:01:46 2005
+++ gotm/src/java/org/objectweb/gotm/lib/coordination/PrepareFeature.java
Thu Nov 17 14:04:23 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
- $Id: PrepareFeature.java,v 1.1 2005/09/06 08:01:46 rouvoy Exp $
+ $Id: PrepareFeature.java,v 1.2 2005/11/17 13:04:23 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.coordination;
@@ -35,14 +35,14 @@
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @created 30 août 2005
- * @modified $Date: 2005/09/06 08:01:46 $
- * @version $Revision: 1.1 $
+ * @created 30 aug. 2005
+ * @modified $Date: 2005/11/17 13:04:23 $
+ * @version $Revision: 1.2 $
* @fractal.itf name="prepare"
*
signature="org.objectweb.transaction.api.coordination.CoordinationFeature"
*/
public class PrepareFeature
- extends AbstractCoordinationFeature {
+ extends CoordinationFeatureAbstract {
/** Fractal ADL Identifier for the <code>Prepare</code> interface. */
public static final String PREPARE = "prepare";
@@ -51,8 +51,10 @@
* @see
org.objectweb.transaction.api.coordination.CoordinationFeature#execute(java.util.Map)
*/
public void execute(Map context) {
- beginLog().log(TransactionStatusPrepared.status.label().getBytes());
+ if (getLogger().isLoggable(DEBUG))
+ getLogger().log(DEBUG,"Processing Prepare...");
txState().setStatus(TransactionStatusPreparing.status);
+ beginLog().log(TransactionStatusPreparing.status.label().getBytes());
publisher().notify(ResourceEventVote.event, context);
txState().setStatus(TransactionStatusPrepared.status);
//endLog().log(TransactionStatusPrepared.status.label().getBytes());
Index:
gotm/src/java/org/objectweb/gotm/lib/coordination/ProbeCommitProtocol.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/coordination/ProbeCommitProtocol.java:1.4
gotm/src/java/org/objectweb/gotm/lib/coordination/ProbeCommitProtocol.java:1.5
---
gotm/src/java/org/objectweb/gotm/lib/coordination/ProbeCommitProtocol.java:1.4
Mon Nov 7 09:50:33 2005
+++
gotm/src/java/org/objectweb/gotm/lib/coordination/ProbeCommitProtocol.java
Thu Nov 17 14:04:22 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
-$Id: ProbeCommitProtocol.java,v 1.4 2005/11/07 08:50:33 rouvoy Exp $
+$Id: ProbeCommitProtocol.java,v 1.5 2005/11/17 13:04:22 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.coordination;
@@ -39,9 +39,9 @@
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @created 3 août 2005
- * @modified $Date: 2005/11/07 08:50:33 $
- * @version $Revision: 1.4 $
+ * @created 3 aug. 2005
+ * @modified $Date: 2005/11/17 13:04:22 $
+ * @version $Revision: 1.5 $
* @fractal.itf
*/
public class ProbeCommitProtocol
Index: gotm/src/java/org/objectweb/gotm/lib/coordination/TimeoutImpl.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/coordination/TimeoutImpl.java:1.7
gotm/src/java/org/objectweb/gotm/lib/coordination/TimeoutImpl.java:1.8
--- gotm/src/java/org/objectweb/gotm/lib/coordination/TimeoutImpl.java:1.7
Mon Nov 7 09:50:33 2005
+++ gotm/src/java/org/objectweb/gotm/lib/coordination/TimeoutImpl.java Thu
Nov 17 14:04:22 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
- $Id: TimeoutImpl.java,v 1.7 2005/11/07 08:50:33 rouvoy Exp $
+ $Id: TimeoutImpl.java,v 1.8 2005/11/17 13:04:22 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.coordination;
@@ -35,6 +35,7 @@
import javax.swing.Timer;
+import org.objectweb.fractal.api.control.CacheController;
import org.objectweb.gotm.lib.message.SubscribablePrimitive;
import org.objectweb.transaction.api.coordination.CoordinationFeature;
import org.objectweb.transaction.api.message.Event;
@@ -47,14 +48,17 @@
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @version $Revision: 1.7 $
+ * @version $Revision: 1.8 $
* @fractal.itf name="coord-process" role="client"
signature="org.objectweb.transaction.api.coordination.CoordinationFeature"
*/
public class TimeoutImpl
extends SubscribablePrimitive
-implements TimeoutAttribute
+implements TimeoutAttribute, CacheController
{
- private int timeout = 60;
+ /** <code>DEFAULT_TIMEOUT</code> value. */
+ public static final int DEFAULT_TIMEOUT = 0;
+
+ private int timeout = DEFAULT_TIMEOUT;
private Timer daemon ;
@@ -66,10 +70,15 @@
public void actionPerformed(ActionEvent evt) {
if (getLogger().isLoggable(DEBUG))
getLogger().log(DEBUG, "Timeout has expired!");
- TimeoutImpl.this.getTerminator().execute(new HashMap());
+ try {
+ TimeoutImpl.this.getTerminator().execute(new HashMap());
+ } catch (Exception e) {
+ getLogger().log(FATAL, "Timeout abort failed:",e);
+ }
}
};
- this.daemon = new Timer(this.timeout, taskPerformer);
+ this.daemon = new Timer(DEFAULT_TIMEOUT, taskPerformer);
+// Timer.setLogTimers(true);
this.daemon.setRepeats(false);
}
@@ -104,6 +113,8 @@
* @see org.objectweb.gotm.lib.protocol.TimeoutAttribute#setTimeout(int)
*/
public void setTimeout(int delay) {
+ if (getLogger().isLoggable(DEBUG))
+ getLogger().log(DEBUG, "Configuring timeout for "+delay+" sec.");
this.timeout = delay ;
this.daemon.setInitialDelay(this.timeout*1000);
}
@@ -121,12 +132,33 @@
public void notify(Event topic, Map context) {
if (topic == TransactionStatusTransactionActive.status) {
if (getTimeout() != 0) {
- //getTrace().debug("Starting timeout for "+getTimeout()+".");
- this.daemon.start();
+ if (getLogger().isLoggable(DEBUG))
+ getLogger().log(DEBUG, "Starting timeout for
"+getTimeout()+" sec.");
+ this.daemon.restart();
}
} else if (getTimeout() != 0) {
- //getTrace().debug("Stopping timeout.");
- this.daemon.stop();
+ if (getLogger().isLoggable(DEBUG))
+ getLogger().log(DEBUG, "Stopping timeout
(delay="+this.daemon.getDelay()+").");
+ this.daemon.stop();
}
}
+
+ /* (non-Javadoc)
+ * @see org.objectweb.fractal.api.control.CacheController#getCacheState()
+ */
+ public String getCacheState() { return null; }
+
+ /* (non-Javadoc)
+ * @see org.objectweb.fractal.api.control.CacheController#initFc()
+ */
+ public void initFc() {
+ setTimeout(DEFAULT_TIMEOUT);
+ }
+
+ /* (non-Javadoc)
+ * @see org.objectweb.fractal.api.control.CacheController#clearFc()
+ */
+ public void clearFc() {
+ this.daemon.stop();
+ }
}
Index:
gotm/src/java/org/objectweb/gotm/lib/coordination/TransactionAbortedException.java
diff -u /dev/null
gotm/src/java/org/objectweb/gotm/lib/coordination/TransactionAbortedException.java:1.1
--- /dev/null Thu Nov 17 14:04:24 2005
+++
gotm/src/java/org/objectweb/gotm/lib/coordination/TransactionAbortedException.java
Thu Nov 17 14:04:22 2005
@@ -0,0 +1,40 @@
+/*====================================================================
+
+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: TransactionAbortedException.java,v 1.1 2005/11/17 13:04:22 rouvoy Exp $
+====================================================================*/
+package org.objectweb.gotm.lib.coordination;
+
+/**
+ * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
+ * @created 17 nov. 2005
+ * @modified $Date: 2005/11/17 13:04:22 $
+ * @version $Revision: 1.1 $
+ * @fractal.itf
+ */
+public class TransactionAbortedException
+ extends Exception {
+
+}
Index:
gotm/src/java/org/objectweb/gotm/lib/coordination/TwoPCActionProvider.java
diff -u /dev/null
gotm/src/java/org/objectweb/gotm/lib/coordination/TwoPCActionProvider.java:1.1
--- /dev/null Thu Nov 17 14:04:24 2005
+++
gotm/src/java/org/objectweb/gotm/lib/coordination/TwoPCActionProvider.java
Thu Nov 17 14:04:23 2005
@@ -0,0 +1,139 @@
+/*====================================================================
+
+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: TwoPCActionProvider.java,v 1.1 2005/11/17 13:04:23 rouvoy Exp $
+====================================================================*/
+package org.objectweb.gotm.lib.coordination;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Vector;
+
+import org.objectweb.gotm.lib.action.Action;
+import org.objectweb.gotm.lib.action.ActionProviderAbstract;
+import org.objectweb.transaction.api.coordination.CoordinationFeature;
+import org.objectweb.transaction.lib.resource.ResourceVoteCommit;
+import org.objectweb.transaction.lib.resource.ResourceVoteReadOnly;
+import org.objectweb.transaction.lib.resource.ResourceVoteRollback;
+import
org.objectweb.transaction.lib.transaction.TransactionStatusMarkedRollback;
+import org.objectweb.transaction.lib.transaction.TransactionStatusPrepared;
+import
org.objectweb.transaction.lib.transaction.TransactionStatusTransactionActive;
+
+/**
+ * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
+ * @created 17 nov. 2005
+ * @modified $Date: 2005/11/17 13:04:23 $
+ * @version $Revision: 1.1 $
+ * @fractal.itf name="prepare" role="client"
signature="org.objectweb.transaction.api.coordination.CoordinationFeature"
+ * @fractal.itf name="commit" role="client"
signature="org.objectweb.transaction.api.coordination.CoordinationFeature"
+ * @fractal.itf name="abort" role="client"
signature="org.objectweb.transaction.api.coordination.CoordinationFeature"
+ */
+public class TwoPCActionProvider
+ extends ActionProviderAbstract {
+
+ /* (non-Javadoc)
+ * @see org.objectweb.gotm.lib.action.ActionProviderAbstract#actions()
+ */
+ protected Map actions() {
+ Map a = new HashMap();
+ a.put(TransactionStatusMarkedRollback.status, new AbortAction());
+ a.put(TransactionStatusTransactionActive.status, new
PrepareAction());
+ a.put(TransactionStatusPrepared.status, new CommitAction());
+ return a;
+ }
+
+ /* (non-Javadoc)
+ * @see org.objectweb.fractal.lib.BindablePrimitive#clientFc()
+ */
+ protected String[] clientFc() {
+ return new String[] {
+ PrepareFeature.PREPARE,
+ CommitFeature.COMMIT,
+ AbortFeature.ABORT
+ };
+ }
+
+ /**
+ * @return the prepare interface
+ */
+ protected CoordinationFeature prepare() {
+ return (CoordinationFeature) singletonFc(PrepareFeature.PREPARE);
+ }
+
+ /**
+ * @return the validation interface
+ */
+ protected CoordinationFeature commit() {
+ return (CoordinationFeature) singletonFc(CommitFeature.COMMIT);
+ }
+
+ /**
+ * @return the cancel interface
+ */
+ protected final CoordinationFeature abort() {
+ return (CoordinationFeature) singletonFc(AbortFeature.ABORT);
+ }
+
+
+
+
+ private class AbortAction implements Action {
+ /* (non-Javadoc)
+ * @see org.objectweb.gotm.lib.action.Action#execute(java.util.Map,
java.lang.Object)
+ */
+ public void execute(Map context, Object resource) throws Exception {
+ abort().execute(context);
+ throw new TransactionAbortedException();
+ }
+ }
+
+ private class PrepareAction implements Action {
+ /* (non-Javadoc)
+ * @see org.objectweb.gotm.lib.action.Action#execute(java.util.Map,
java.lang.Object)
+ */
+ public void execute(Map context, Object resource) throws Exception {
+ context.put(ResourceVoteRollback.vote, new Vector());
+ context.put(ResourceVoteCommit.vote, new Vector());
+ context.put(ResourceVoteReadOnly.vote, new Vector());
+ prepare().execute(context);
+ }
+ }
+
+ private class CommitAction implements Action {
+ /* (non-Javadoc)
+ * @see org.objectweb.gotm.lib.action.Action#execute(java.util.Map,
java.lang.Object)
+ */
+ public void execute(Map context, Object resource) throws Exception {
+ List aborts = (List) context.get(ResourceVoteRollback.vote);
+ if (aborts.size() == 0) {
+ List commits = (List) context.get(ResourceVoteCommit.vote);
+ if (commits.size() != 0) commit().execute(context);
+ } else {
+ abort().execute(context);
+ }
+ }
+ }
+}
Index: gotm/src/java/org/objectweb/gotm/lib/coordination/TwoPCFeature.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/coordination/TwoPCFeature.java:1.10
gotm/src/java/org/objectweb/gotm/lib/coordination/TwoPCFeature.java:1.11
--- gotm/src/java/org/objectweb/gotm/lib/coordination/TwoPCFeature.java:1.10
Fri Oct 21 15:15:30 2005
+++ gotm/src/java/org/objectweb/gotm/lib/coordination/TwoPCFeature.java Thu
Nov 17 14:04:23 2005
@@ -23,32 +23,28 @@
Contributor(s): .
---------------------------------------------------------------------
- $Id: TwoPCFeature.java,v 1.10 2005/10/21 13:15:30 rouvoy Exp $
+ $Id: TwoPCFeature.java,v 1.11 2005/11/17 13:04:23 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.coordination;
import java.util.Map;
-import java.util.Vector;
import org.objectweb.fractal.lib.BindablePrimitive;
-import org.objectweb.gotm.lib.transaction.InvalidTransitionException;
+import org.objectweb.gotm.lib.action.ActionProvider;
import org.objectweb.transaction.api.coordination.CoordinationFeature;
-import org.objectweb.transaction.lib.resource.ResourceVoteCommit;
-import org.objectweb.transaction.lib.resource.ResourceVoteReadOnly;
-import org.objectweb.transaction.lib.resource.ResourceVoteRollback;
+import org.objectweb.transaction.api.transaction.TransactionState;
/**
* Implementation of a Two-Phase Commit Protocol.
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
* @created 5 janv. 2005
- * @modified $Date: 2005/10/21 13:15:30 $
- * @version $Revision: 1.10 $
+ * @modified $Date: 2005/11/17 13:04:23 $
+ * @version $Revision: 1.11 $
* @fractal.itf name="2pc"
signature="org.objectweb.transaction.api.coordination.CoordinationFeature"
- * @fractal.itf name="prepare" role="client"
signature="org.objectweb.transaction.api.coordination.CoordinationFeature"
- * @fractal.itf name="commit" role="client"
signature="org.objectweb.transaction.api.coordination.CoordinationFeature"
- * @fractal.itf name="abort" role="client"
signature="org.objectweb.transaction.api.coordination.CoordinationFeature"
+ * @fractal.itf name="tx-state" role="client"
signature="org.objectweb.transaction.api.transaction.TransactionState"
+ * @fractal.itf name="action-provider" role="client"
signature="org.objectweb.gotm.lib.action.ActionProvider"
*/
public class TwoPCFeature
extends BindablePrimitive
@@ -60,57 +56,34 @@
*/
protected String[] clientFc() {
return new String[] {
- PrepareFeature.PREPARE,
- CommitFeature.COMMIT,
- AbortFeature.ABORT
+ ActionProvider.ACTION_PROVIDER,
+ TransactionState.TRANSACTION_STATE
};
}
/**
- * @return the prepare interface
+ * @return the action provider.
*/
- protected CoordinationFeature prepare() {
- return (CoordinationFeature) singletonFc(PrepareFeature.PREPARE);
+ protected final ActionProvider actions() {
+ return (ActionProvider) singletonFc(ActionProvider.ACTION_PROVIDER);
}
/**
- * @return the validation interface
+ * @return the transaction state.
*/
- protected CoordinationFeature commit() {
- return (CoordinationFeature) singletonFc(CommitFeature.COMMIT);
- }
-
- /**
- * @return the cancel interface
- */
- protected final CoordinationFeature abort() {
- return (CoordinationFeature) singletonFc(AbortFeature.ABORT);
+ protected final TransactionState txState() {
+ return (TransactionState)
singletonFc(TransactionState.TRANSACTION_STATE);
}
/* (non-Javadoc)
* @see
org.objectweb.transaction.api.coordination.CoordinationFeature#process(java.util.Map)
*/
- public void execute(Map context) {
-// if (getLogger().isLoggable(DEBUG))
-// getLogger().log(DEBUG,"Processing Atomic 2 Phases
Validation...");
- try {
- context.put(ResourceVoteRollback.vote, new Vector());
- context.put(ResourceVoteCommit.vote, new Vector());
- context.put(ResourceVoteReadOnly.vote, new Vector());
- prepare().execute(context);
- Vector enf_rollback = (Vector)
context.get(ResourceVoteRollback.vote);
- if (enf_rollback.size() == 0) {
- Vector enf_commit = (Vector)
context.get(ResourceVoteCommit.vote);
- if (enf_commit.size() != 0)
- commit().execute(context);
- } else {
- abort().execute(context);
- }
- } catch (InvalidTransitionException e) {
-// if (getLogger().isLoggable(DEBUG))
-// getLogger().log(DEBUG,"Prepare Feature: "+e.getMessage());
- abort().execute(context);
- throw e;
- }
+ public void execute(Map context) throws Exception {
+ if (getLogger().isLoggable(DEBUG))
+ getLogger().log(DEBUG,"Processing Atomic 2 Phases
Validation...");
+ //Phase 1
+ actions().action(txState().getStatus()).execute(context, null);
+ //Phase 2
+ actions().action(txState().getStatus()).execute(context, null);
}
}
\ No newline at end of file
Index: gotm/src/java/org/objectweb/gotm/lib/current/CurrentManager.java
diff -u gotm/src/java/org/objectweb/gotm/lib/current/CurrentManager.java:1.2
gotm/src/java/org/objectweb/gotm/lib/current/CurrentManager.java:1.3
--- gotm/src/java/org/objectweb/gotm/lib/current/CurrentManager.java:1.2
Tue Sep 6 10:01:46 2005
+++ gotm/src/java/org/objectweb/gotm/lib/current/CurrentManager.java Thu
Nov 17 14:04:22 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
- $Id: CurrentManager.java,v 1.2 2005/09/06 08:01:46 rouvoy Exp $
+ $Id: CurrentManager.java,v 1.3 2005/11/17 13:04:22 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.current;
@@ -32,9 +32,9 @@
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @created 1 févr. 2005
- * @modified $Date: 2005/09/06 08:01:46 $
- * @version $Revision: 1.2 $
+ * @created 1 febr. 2005
+ * @modified $Date: 2005/11/17 13:04:22 $
+ * @version $Revision: 1.3 $
* @fractal.itf name="current-manager"
*/
public interface CurrentManager extends Feature{
Index:
gotm/src/java/org/objectweb/gotm/lib/current/CurrentManagerThreadLocal.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/current/CurrentManagerThreadLocal.java:1.2
gotm/src/java/org/objectweb/gotm/lib/current/CurrentManagerThreadLocal.java:1.3
---
gotm/src/java/org/objectweb/gotm/lib/current/CurrentManagerThreadLocal.java:1.2
Fri Oct 14 13:43:54 2005
+++
gotm/src/java/org/objectweb/gotm/lib/current/CurrentManagerThreadLocal.java
Thu Nov 17 14:04:22 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
-$Id: CurrentManagerThreadLocal.java,v 1.2 2005/10/14 11:43:54 rouvoy Exp $
+$Id: CurrentManagerThreadLocal.java,v 1.3 2005/11/17 13:04:22 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.current;
@@ -34,9 +34,9 @@
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @created 4 août 2005
- * @modified $Date: 2005/10/14 11:43:54 $
- * @version $Revision: 1.2 $
+ * @created 4 aug. 2005
+ * @modified $Date: 2005/11/17 13:04:22 $
+ * @version $Revision: 1.3 $
* @fractal.itf name="transaction-factory" role="client"
signature="org.objectweb.gotm.lib.factory.TransactionFactory"
*/
public class CurrentManagerThreadLocal
Index:
gotm/src/java/org/objectweb/gotm/lib/current/CurrentManagerWithReference.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/current/CurrentManagerWithReference.java:1.3
gotm/src/java/org/objectweb/gotm/lib/current/CurrentManagerWithReference.java:1.4
---
gotm/src/java/org/objectweb/gotm/lib/current/CurrentManagerWithReference.java:1.3
Tue Nov 15 15:54:43 2005
+++
gotm/src/java/org/objectweb/gotm/lib/current/CurrentManagerWithReference.java
Thu Nov 17 14:04:22 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
-$Id: CurrentManagerWithReference.java,v 1.3 2005/11/15 14:54:43 rouvoy Exp $
+$Id: CurrentManagerWithReference.java,v 1.4 2005/11/17 13:04:22 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.current;
@@ -40,9 +40,9 @@
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @created 31 août 2005
- * @modified $Date: 2005/11/15 14:54:43 $
- * @version $Revision: 1.3 $
+ * @created 31 aug. 2005
+ * @modified $Date: 2005/11/17 13:04:22 $
+ * @version $Revision: 1.4 $
* @fractal.itf
*/
public class CurrentManagerWithReference
Index: gotm/src/java/org/objectweb/gotm/lib/factory/Configurable.java
diff -u gotm/src/java/org/objectweb/gotm/lib/factory/Configurable.java:1.1
gotm/src/java/org/objectweb/gotm/lib/factory/Configurable.java:1.2
--- gotm/src/java/org/objectweb/gotm/lib/factory/Configurable.java:1.1 Fri
Aug 12 14:31:22 2005
+++ gotm/src/java/org/objectweb/gotm/lib/factory/Configurable.java Thu
Nov 17 14:04:23 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
-$Id: Configurable.java,v 1.1 2005/08/12 12:31:22 rouvoy Exp $
+$Id: Configurable.java,v 1.2 2005/11/17 13:04:23 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.factory;
@@ -32,9 +32,9 @@
/**
* Interface to apply dynamic reconfigurable.
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @created 3 août 2005
- * @modified $Date: 2005/08/12 12:31:22 $
- * @version $Revision: 1.1 $
+ * @created 3 aug. 2005
+ * @modified $Date: 2005/11/17 13:04:23 $
+ * @version $Revision: 1.2 $
* @fractal.itf name="configurable"
*/
public interface Configurable
Index: gotm/src/java/org/objectweb/gotm/lib/factory/TransactionFactory.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/factory/TransactionFactory.java:1.1
gotm/src/java/org/objectweb/gotm/lib/factory/TransactionFactory.java:1.2
--- gotm/src/java/org/objectweb/gotm/lib/factory/TransactionFactory.java:1.1
Fri Aug 12 14:31:22 2005
+++ gotm/src/java/org/objectweb/gotm/lib/factory/TransactionFactory.java
Thu Nov 17 14:04:23 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
-$Id: TransactionFactory.java,v 1.1 2005/08/12 12:31:22 rouvoy Exp $
+$Id: TransactionFactory.java,v 1.2 2005/11/17 13:04:23 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.factory;
@@ -32,9 +32,9 @@
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @created 12 août 2005
- * @modified $Date: 2005/08/12 12:31:22 $
- * @version $Revision: 1.1 $
+ * @created 12 aug. 2005
+ * @modified $Date: 2005/11/17 13:04:23 $
+ * @version $Revision: 1.2 $
* @fractal.itf name="transaction-factory"
*/
public interface TransactionFactory
Index:
gotm/src/java/org/objectweb/gotm/lib/factory/TransactionFactoryAdaptive.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/factory/TransactionFactoryAdaptive.java:1.2
gotm/src/java/org/objectweb/gotm/lib/factory/TransactionFactoryAdaptive.java:1.3
---
gotm/src/java/org/objectweb/gotm/lib/factory/TransactionFactoryAdaptive.java:1.2
Tue Sep 6 10:01:47 2005
+++
gotm/src/java/org/objectweb/gotm/lib/factory/TransactionFactoryAdaptive.java
Thu Nov 17 14:04:23 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
-$Id: TransactionFactoryAdaptive.java,v 1.2 2005/09/06 08:01:47 rouvoy Exp $
+$Id: TransactionFactoryAdaptive.java,v 1.3 2005/11/17 13:04:23 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.factory;
@@ -39,9 +39,9 @@
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @created 12 août 2005
- * @modified $Date: 2005/09/06 08:01:47 $
- * @version $Revision: 1.2 $
+ * @created 12 aug. 2005
+ * @modified $Date: 2005/11/17 13:04:23 $
+ * @version $Revision: 1.3 $
* @fractal.itf
*/
public class TransactionFactoryAdaptive
Index:
gotm/src/java/org/objectweb/gotm/lib/factory/TransactionFactoryAttributeController.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/factory/TransactionFactoryAttributeController.java:1.1
gotm/src/java/org/objectweb/gotm/lib/factory/TransactionFactoryAttributeController.java:1.2
---
gotm/src/java/org/objectweb/gotm/lib/factory/TransactionFactoryAttributeController.java:1.1
Fri Aug 12 14:31:22 2005
+++
gotm/src/java/org/objectweb/gotm/lib/factory/TransactionFactoryAttributeController.java
Thu Nov 17 14:04:23 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
-$Id: TransactionFactoryAttributeController.java,v 1.1 2005/08/12 12:31:22
rouvoy Exp $
+$Id: TransactionFactoryAttributeController.java,v 1.2 2005/11/17 13:04:23
rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.factory;
@@ -31,9 +31,9 @@
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @created 10 août 2005
- * @modified $Date: 2005/08/12 12:31:22 $
- * @version $Revision: 1.1 $
+ * @created 10 aug. 2005
+ * @modified $Date: 2005/11/17 13:04:23 $
+ * @version $Revision: 1.2 $
* @fractal.controller
*/
public interface TransactionFactoryAttributeController
Index:
gotm/src/java/org/objectweb/gotm/lib/factory/TransactionFactoryCache.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/factory/TransactionFactoryCache.java:1.4
gotm/src/java/org/objectweb/gotm/lib/factory/TransactionFactoryCache.java:1.5
---
gotm/src/java/org/objectweb/gotm/lib/factory/TransactionFactoryCache.java:1.4
Tue Nov 15 17:12:33 2005
+++ gotm/src/java/org/objectweb/gotm/lib/factory/TransactionFactoryCache.java
Thu Nov 17 14:04:23 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
- $Id: TransactionFactoryCache.java,v 1.4 2005/11/15 16:12:33 rouvoy Exp $
+ $Id: TransactionFactoryCache.java,v 1.5 2005/11/17 13:04:23 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.factory;
@@ -35,9 +35,9 @@
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @created 12 août 2005
- * @modified $Date: 2005/11/15 16:12:33 $
- * @version $Revision: 1.4 $
+ * @created 12 aug. 2005
+ * @modified $Date: 2005/11/17 13:04:23 $
+ * @version $Revision: 1.5 $
* @fractal.itf
*/
public class TransactionFactoryCache
@@ -100,13 +100,13 @@
* @see org.objectweb.fractal.api.control.CacheController#initFc()
*/
public void initFc() {
- this.txStack.push(super.createTransaction());
+// this.txStack.push(super.createTransaction());
}
/* (non-Javadoc)
* @see org.objectweb.fractal.api.control.CacheController#clearFc()
*/
public void clearFc() {
- this.txStack.clear();
+// this.txStack.clear();
}
}
\ No newline at end of file
Index:
gotm/src/java/org/objectweb/gotm/lib/factory/TransactionFactoryImpl.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/factory/TransactionFactoryImpl.java:1.5
gotm/src/java/org/objectweb/gotm/lib/factory/TransactionFactoryImpl.java:1.6
---
gotm/src/java/org/objectweb/gotm/lib/factory/TransactionFactoryImpl.java:1.5
Tue Nov 15 17:12:33 2005
+++ gotm/src/java/org/objectweb/gotm/lib/factory/TransactionFactoryImpl.java
Thu Nov 17 14:04:23 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
-$Id: TransactionFactoryImpl.java,v 1.5 2005/11/15 16:12:33 rouvoy Exp $
+$Id: TransactionFactoryImpl.java,v 1.6 2005/11/17 13:04:23 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.factory;
@@ -41,9 +41,9 @@
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @created 12 août 2005
- * @modified $Date: 2005/11/15 16:12:33 $
- * @version $Revision: 1.5 $
+ * @created 12 aug. 2005
+ * @modified $Date: 2005/11/17 13:04:23 $
+ * @version $Revision: 1.6 $
* @fractal.itf name="tx-model" role="client" contingency="optional"
signature="org.objectweb.fractal.api.Component"
* @fractal.itf name="loaded-tx" role="client"
signature="java.util.Collection"
* @fractal.attr name="descriptor" argument="descriptor"
Index:
gotm/src/java/org/objectweb/gotm/lib/factory/TransactionFactoryObservable.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/factory/TransactionFactoryObservable.java:1.3
gotm/src/java/org/objectweb/gotm/lib/factory/TransactionFactoryObservable.java:1.4
---
gotm/src/java/org/objectweb/gotm/lib/factory/TransactionFactoryObservable.java:1.3
Mon Nov 7 09:50:33 2005
+++
gotm/src/java/org/objectweb/gotm/lib/factory/TransactionFactoryObservable.java
Thu Nov 17 14:04:23 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
- $Id: TransactionFactoryObservable.java,v 1.3 2005/11/07 08:50:33 rouvoy Exp
$
+ $Id: TransactionFactoryObservable.java,v 1.4 2005/11/17 13:04:23 rouvoy Exp
$
====================================================================*/
package org.objectweb.gotm.lib.factory;
@@ -36,12 +36,10 @@
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @created 29 août 2005
- * @modified $Date: 2005/11/07 08:50:33 $
- * @version $Revision: 1.3 $
- * @fractal.itf name="publish" role="client"
- *
signature="org.objectweb.transaction.api.message.PublishFeature"
- * cardinality="collection" contingency="optional"
+ * @created 29 aug. 2005
+ * @modified $Date: 2005/11/17 13:04:23 $
+ * @version $Revision: 1.4 $
+ * @fractal.itf name="publish" role="client" cardinality="collection"
contingency="optional"
signature="org.objectweb.transaction.api.message.PublishFeature"
*/
public class TransactionFactoryObservable
extends TransactionFactoryCache {
Index: gotm/src/java/org/objectweb/gotm/lib/logging/HOWLoggerProvider.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/logging/HOWLoggerProvider.java:1.4
gotm/src/java/org/objectweb/gotm/lib/logging/HOWLoggerProvider.java:1.5
--- gotm/src/java/org/objectweb/gotm/lib/logging/HOWLoggerProvider.java:1.4
Fri Aug 5 17:06:28 2005
+++ gotm/src/java/org/objectweb/gotm/lib/logging/HOWLoggerProvider.java Thu
Nov 17 14:04:23 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
-$Id: HOWLoggerProvider.java,v 1.4 2005/08/05 15:06:28 rouvoy Exp $
+$Id: HOWLoggerProvider.java,v 1.5 2005/11/17 13:04:23 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.logging;
@@ -43,8 +43,8 @@
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
* @created 7 juil. 2005
- * @modified $Date: 2005/08/05 15:06:28 $
- * @version $Revision: 1.4 $
+ * @modified $Date: 2005/11/17 13:04:23 $
+ * @version $Revision: 1.5 $
* @fractal.itf
*/
public class HOWLoggerProvider
@@ -57,12 +57,12 @@
/**
* @fractal.attr argument="file"
*/
- protected String filename ;
+ protected String filename ="gotm.log";
/**
* @fractal.attr argument="dir"
*/
- protected String dirpath ;
+ protected String dirpath ="tmp/";
protected Logger logger ;
Index:
gotm/src/java/org/objectweb/gotm/lib/message/AbstractEventConverter.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/message/AbstractEventConverter.java:1.1
gotm/src/java/org/objectweb/gotm/lib/message/AbstractEventConverter.java:1.2
---
gotm/src/java/org/objectweb/gotm/lib/message/AbstractEventConverter.java:1.1
Mon Nov 7 09:50:32 2005
+++ gotm/src/java/org/objectweb/gotm/lib/message/AbstractEventConverter.java
Thu Nov 17 14:04:22 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
- $Id: AbstractEventConverter.java,v 1.1 2005/11/07 08:50:32 rouvoy Exp $
+ $Id: AbstractEventConverter.java,v 1.2 2005/11/17 13:04:22 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.message;
@@ -35,9 +35,9 @@
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @created 1 févr. 2005
- * @modified $Date: 2005/11/07 08:50:32 $
- * @version $Revision: 1.1 $
+ * @created 1 febr. 2005
+ * @modified $Date: 2005/11/17 13:04:22 $
+ * @version $Revision: 1.2 $
* @fractal.itf
*/
public abstract class AbstractEventConverter
Index: gotm/src/java/org/objectweb/gotm/lib/message/EventConverter.java
diff -u gotm/src/java/org/objectweb/gotm/lib/message/EventConverter.java:1.1
gotm/src/java/org/objectweb/gotm/lib/message/EventConverter.java:1.2
--- gotm/src/java/org/objectweb/gotm/lib/message/EventConverter.java:1.1
Mon Nov 7 09:50:32 2005
+++ gotm/src/java/org/objectweb/gotm/lib/message/EventConverter.java Thu
Nov 17 14:04:22 2005
@@ -22,7 +22,7 @@
Contributor(s): ______________________________________.
---------------------------------------------------------------------
- $Id: EventConverter.java,v 1.1 2005/11/07 08:50:32 rouvoy Exp $
+ $Id: EventConverter.java,v 1.2 2005/11/17 13:04:22 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.message;
@@ -33,9 +33,9 @@
/**
* Implementation of an Event type converter.
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @created 22 déc. 2004
- * @modified $Date: 2005/11/07 08:50:32 $
- * @version $Revision: 1.1 $
+ * @created 22 dec. 2004
+ * @modified $Date: 2005/11/17 13:04:22 $
+ * @version $Revision: 1.2 $
* @fractal.itf name="event-converter"
*/
public interface EventConverter
Index: gotm/src/java/org/objectweb/gotm/lib/message/PublishSimple.java
diff -u gotm/src/java/org/objectweb/gotm/lib/message/PublishSimple.java:1.1
gotm/src/java/org/objectweb/gotm/lib/message/PublishSimple.java:1.2
--- gotm/src/java/org/objectweb/gotm/lib/message/PublishSimple.java:1.1 Mon
Nov 7 09:50:32 2005
+++ gotm/src/java/org/objectweb/gotm/lib/message/PublishSimple.java Thu
Nov 17 14:04:22 2005
@@ -23,10 +23,11 @@
Contributor(s): .
---------------------------------------------------------------------
- $Id: PublishSimple.java,v 1.1 2005/11/07 08:50:32 rouvoy Exp $
+ $Id: PublishSimple.java,v 1.2 2005/11/17 13:04:22 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.message;
+import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
@@ -37,8 +38,8 @@
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
* @created 12 janv. 2005
- * @modified $Date: 2005/11/07 08:50:32 $
- * @version $Revision: 1.1 $
+ * @modified $Date: 2005/11/17 13:04:22 $
+ * @version $Revision: 1.2 $
* @fractal.itf name="subscriber-provider" role="client"
signature="org.objectweb.gotm.lib.message.SubscriberProvider"
*/
public class PublishSimple
@@ -66,9 +67,10 @@
* java.util.Map)
*/
public void notify(Event topic, Map context) {
- if (getLogger().isLoggable(DEBUG))
- getLogger().log(DEBUG, "Notifying of topic " + topic + " to
"+getProvider().getTopic(topic).size()+" subscriber(s)");
- for (Iterator i = getProvider().getTopic(topic).iterator();
i.hasNext();)
+ Collection listeners = getProvider().getTopic(topic);
+// if (getLogger().isLoggable(DEBUG) && listeners.size()>0)
+// getLogger().log(DEBUG, "Notifying of topic " + topic + " to
"+listeners.size()+" subscriber(s)");
+ for (Iterator i = listeners.iterator(); i.hasNext();)
((PublishFeature) i.next()).notify(topic, context);
}
Index: gotm/src/java/org/objectweb/gotm/lib/message/SubscriberPool.java
diff -u gotm/src/java/org/objectweb/gotm/lib/message/SubscriberPool.java:1.1
gotm/src/java/org/objectweb/gotm/lib/message/SubscriberPool.java:1.2
--- gotm/src/java/org/objectweb/gotm/lib/message/SubscriberPool.java:1.1
Mon Nov 7 09:50:32 2005
+++ gotm/src/java/org/objectweb/gotm/lib/message/SubscriberPool.java Thu
Nov 17 14:04:22 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
-$Id: SubscriberPool.java,v 1.1 2005/11/07 08:50:32 rouvoy Exp $
+$Id: SubscriberPool.java,v 1.2 2005/11/17 13:04:22 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.message;
@@ -33,7 +33,6 @@
import java.util.Map;
import java.util.Set;
-import org.objectweb.fractal.api.control.CacheController;
import org.objectweb.fractal.lib.LoggablePrimitive;
import org.objectweb.transaction.api.message.Event;
import org.objectweb.transaction.api.message.PublishFeature;
@@ -42,38 +41,38 @@
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
* @created 11 juil. 2005
- * @modified $Date: 2005/11/07 08:50:32 $
- * @version $Revision: 1.1 $
+ * @modified $Date: 2005/11/17 13:04:22 $
+ * @version $Revision: 1.2 $
* @fractal.itf
*/
public class SubscriberPool
extends LoggablePrimitive
- implements SubscriberProvider, SubscribeFeature, CacheController {
+ implements SubscriberProvider, SubscribeFeature {
/**
* Map containing all the available <code>topics</code>.
*/
private final Map topics = new HashMap();
- /* (non-Javadoc)
- * @see org.objectweb.fractal.api.control.CacheController#getCacheState()
- */
- public String getCacheState() { return null; }
-
- /* (non-Javadoc)
- * @see org.objectweb.fractal.api.control.CacheController#initFc()
- */
- public void initFc() {
- // Ignored
- }
-
- /* (non-Javadoc)
- * @see org.objectweb.fractal.api.control.CacheController#clearFc()
- */
- public void clearFc() {
- if (getLogger().isLoggable(DEBUG))
- getLogger().log(DEBUG, "Clearing the Subscribers enlisted");
- this.topics.clear() ;
- }
+// /* (non-Javadoc)
+// * @see
org.objectweb.fractal.api.control.CacheController#getCacheState()
+// */
+// public String getCacheState() { return null; }
+//
+// /* (non-Javadoc)
+// * @see org.objectweb.fractal.api.control.CacheController#initFc()
+// */
+// public void initFc() {
+// // Ignored
+// }
+//
+// /* (non-Javadoc)
+// * @see org.objectweb.fractal.api.control.CacheController#clearFc()
+// */
+// public void clearFc() {
+// if (getLogger().isLoggable(DEBUG))
+// getLogger().log(DEBUG, "Clearing the Subscribers enlisted");
+// this.topics.clear() ;
+// }
/* (non-Javadoc)
* @see
org.objectweb.gotm.lib.message.SubscriberProvider#getTopic(org.objectweb.transaction.api.message.Event)
@@ -83,8 +82,6 @@
if (set != null) return set;
set = new ArrayList();
this.topics.put(topic,set);
- if (getLogger().isLoggable(DEBUG))
- getLogger().log(DEBUG, "getTopic("+topic+") provides
"+set.size()+" elements");
return set;
}
@@ -100,8 +97,8 @@
* @see
org.objectweb.transaction.api.message.SubscribeFeature#subscribe(org.objectweb.transaction.api.message.Event,
org.objectweb.transaction.api.message.PublishFeature)
*/
public void subscribe(Event topic, PublishFeature subscriber) {
- if (getLogger().isLoggable(DEBUG))
- getLogger().log(DEBUG, subscriber+" subcribes to "+topic);
+// if (getLogger().isLoggable(DEBUG))
+// getLogger().log(DEBUG, subscriber.getClass().getName()+"
subcribes to "+topic);
getTopic(topic).add(subscriber);
}
@@ -109,8 +106,8 @@
* @see
org.objectweb.transaction.api.message.SubscribeFeature#unsubscribe(org.objectweb.transaction.api.message.Event,
org.objectweb.transaction.api.message.PublishFeature)
*/
public void unsubscribe(Event topic, PublishFeature subscriber) {
- if (getLogger().isLoggable(DEBUG))
- getLogger().log(DEBUG, subscriber+" unsubcribes from "+topic);
+// if (getLogger().isLoggable(DEBUG))
+// getLogger().log(DEBUG, subscriber.getClass().getName()+"
unsubcribes from "+topic);
getTopic(topic).remove(subscriber);
}
Index: gotm/src/java/org/objectweb/gotm/lib/probe/ProbeAbstract.java
diff -u gotm/src/java/org/objectweb/gotm/lib/probe/ProbeAbstract.java:1.4
gotm/src/java/org/objectweb/gotm/lib/probe/ProbeAbstract.java:1.5
--- gotm/src/java/org/objectweb/gotm/lib/probe/ProbeAbstract.java:1.4 Mon
Nov 7 09:50:33 2005
+++ gotm/src/java/org/objectweb/gotm/lib/probe/ProbeAbstract.java Thu
Nov 17 14:04:23 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
-$Id: ProbeAbstract.java,v 1.4 2005/11/07 08:50:33 rouvoy Exp $
+$Id: ProbeAbstract.java,v 1.5 2005/11/17 13:04:23 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.probe;
@@ -37,9 +37,9 @@
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @created 3 août 2005
- * @modified $Date: 2005/11/07 08:50:33 $
- * @version $Revision: 1.4 $
+ * @created 3 aug. 2005
+ * @modified $Date: 2005/11/17 13:04:23 $
+ * @version $Revision: 1.5 $
* @fractal.itf name="configurable" role="client"
signature="org.objectweb.gotm.lib.factory.Configurable"
*/
public abstract class ProbeAbstract
Index: gotm/src/java/org/objectweb/gotm/lib/reference/ReferenceFeature.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/reference/ReferenceFeature.java:1.1
gotm/src/java/org/objectweb/gotm/lib/reference/ReferenceFeature.java:1.2
--- gotm/src/java/org/objectweb/gotm/lib/reference/ReferenceFeature.java:1.1
Tue Sep 6 10:01:47 2005
+++ gotm/src/java/org/objectweb/gotm/lib/reference/ReferenceFeature.java
Thu Nov 17 14:04:23 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
-$Id: ReferenceFeature.java,v 1.1 2005/09/06 08:01:47 rouvoy Exp $
+$Id: ReferenceFeature.java,v 1.2 2005/11/17 13:04:23 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.reference;
@@ -31,9 +31,9 @@
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @created 31 août 2005
- * @modified $Date: 2005/09/06 08:01:47 $
- * @version $Revision: 1.1 $
+ * @created 31 aug. 2005
+ * @modified $Date: 2005/11/17 13:04:23 $
+ * @version $Revision: 1.2 $
* @fractal.itf
*/
public interface ReferenceFeature
Index: gotm/src/java/org/objectweb/gotm/lib/reference/ReferenceManager.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/reference/ReferenceManager.java:1.1
gotm/src/java/org/objectweb/gotm/lib/reference/ReferenceManager.java:1.2
--- gotm/src/java/org/objectweb/gotm/lib/reference/ReferenceManager.java:1.1
Tue Sep 6 10:01:47 2005
+++ gotm/src/java/org/objectweb/gotm/lib/reference/ReferenceManager.java
Thu Nov 17 14:04:23 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
-$Id: ReferenceManager.java,v 1.1 2005/09/06 08:01:47 rouvoy Exp $
+$Id: ReferenceManager.java,v 1.2 2005/11/17 13:04:23 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.reference;
@@ -32,9 +32,9 @@
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @created 31 août 2005
- * @modified $Date: 2005/09/06 08:01:47 $
- * @version $Revision: 1.1 $
+ * @created 31 aug. 2005
+ * @modified $Date: 2005/11/17 13:04:23 $
+ * @version $Revision: 1.2 $
* @fractal.itf name="reference-manager"
*/
public interface ReferenceManager
Index:
gotm/src/java/org/objectweb/gotm/lib/reference/ReferenceNotFoundException.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/reference/ReferenceNotFoundException.java:1.1
gotm/src/java/org/objectweb/gotm/lib/reference/ReferenceNotFoundException.java:1.2
---
gotm/src/java/org/objectweb/gotm/lib/reference/ReferenceNotFoundException.java:1.1
Tue Sep 6 10:01:47 2005
+++
gotm/src/java/org/objectweb/gotm/lib/reference/ReferenceNotFoundException.java
Thu Nov 17 14:04:23 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
-$Id: ReferenceNotFoundException.java,v 1.1 2005/09/06 08:01:47 rouvoy Exp $
+$Id: ReferenceNotFoundException.java,v 1.2 2005/11/17 13:04:23 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.reference;
@@ -31,9 +31,9 @@
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @created 31 août 2005
- * @modified $Date: 2005/09/06 08:01:47 $
- * @version $Revision: 1.1 $
+ * @created 31 aug. 2005
+ * @modified $Date: 2005/11/17 13:04:23 $
+ * @version $Revision: 1.2 $
* @fractal.itf
*/
public class ReferenceNotFoundException
Index: gotm/src/java/org/objectweb/gotm/lib/resource/Action.java
diff -u gotm/src/java/org/objectweb/gotm/lib/resource/Action.java:1.1
gotm/src/java/org/objectweb/gotm/lib/resource/Action.java:removed
--- gotm/src/java/org/objectweb/gotm/lib/resource/Action.java:1.1 Mon
May 23 13:20:55 2005
+++ gotm/src/java/org/objectweb/gotm/lib/resource/Action.java Thu Nov 17
14:04:25 2005
@@ -1,47 +0,0 @@
-/*====================================================================
-
-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: Action.java,v 1.1 2005/05/23 11:20:55 rouvoy Exp $
-====================================================================*/
-package org.objectweb.gotm.lib.resource;
-
-import java.util.Map;
-
-/**
- * Interface Action used by the resource to propagate the incoming events.
- * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @created 22 avr. 2005
- * @modified $Date: 2005/05/23 11:20:55 $
- * @version $Revision: 1.1 $
- */
-public interface Action
-{
- /**
- * @param context
- * @param resource
- * @throws Exception
- */
- void execute(Map context, Object resource) throws Exception;
-}
Index: gotm/src/java/org/objectweb/gotm/lib/resource/ActionProvider.java
diff -u gotm/src/java/org/objectweb/gotm/lib/resource/ActionProvider.java:1.5
gotm/src/java/org/objectweb/gotm/lib/resource/ActionProvider.java:removed
--- gotm/src/java/org/objectweb/gotm/lib/resource/ActionProvider.java:1.5
Mon Nov 7 09:50:33 2005
+++ gotm/src/java/org/objectweb/gotm/lib/resource/ActionProvider.java Thu
Nov 17 14:04:25 2005
@@ -1,56 +0,0 @@
-/*====================================================================
-
-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: ActionProvider.java,v 1.5 2005/11/07 08:50:33 rouvoy Exp $
-====================================================================*/
-package org.objectweb.gotm.lib.resource;
-
-import org.objectweb.transaction.api.message.Event;
-
-/**
- * Interface providing all the actions handled by a kind of resource.
- * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @created 4 juil. 2005
- * @modified $Date: 2005/11/07 08:50:33 $
- * @version $Revision: 1.5 $
- * @fractal.itf name="action-provider"
- */
-public interface ActionProvider {
-
- /** Fractal ADL Identifier for the <code>ActionProvider</code>
interface.*/
- public static final String ACTION_PROVIDER="action-provider";
-
- /**
- * @param name the transaction status identifier.
- * @return the action associated to the transaction status.
- */
- Action action(Event name);
-
- /**
- * Provides the list of transaction status handled.
- * @return the list of handled events.
- */
- Event[] events() ;
-}
\ No newline at end of file
Index:
gotm/src/java/org/objectweb/gotm/lib/resource/ActionProviderAbstract.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/resource/ActionProviderAbstract.java:1.5
gotm/src/java/org/objectweb/gotm/lib/resource/ActionProviderAbstract.java:removed
---
gotm/src/java/org/objectweb/gotm/lib/resource/ActionProviderAbstract.java:1.5
Mon Nov 7 09:50:33 2005
+++ gotm/src/java/org/objectweb/gotm/lib/resource/ActionProviderAbstract.java
Thu Nov 17 14:04:25 2005
@@ -1,83 +0,0 @@
-/*====================================================================
-
-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: ActionProviderAbstract.java,v 1.5 2005/11/07 08:50:33 rouvoy Exp $
-====================================================================*/
-package org.objectweb.gotm.lib.resource;
-
-import java.util.Map;
-import java.util.Set;
-
-import org.objectweb.fractal.lib.BindablePrimitive;
-import org.objectweb.transaction.api.message.Event;
-
-/**
- * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @created 4 juil. 2005
- * @modified $Date: 2005/11/07 08:50:33 $
- * @version $Revision: 1.5 $
- * @fractal.itf
- */
-public abstract class ActionProviderAbstract
- extends BindablePrimitive
- implements ActionProvider {
-
- /** list of available actions. */
- private final Map actions;
-
- /**
- * Default constructor.
- */
- protected ActionProviderAbstract() {
- actions = declareActions();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.objectweb.gotm.lib.resource.ActionProvider#getEvents()
- */
- public Event[] events() {
- Set events = this.actions.keySet();
- return (Event[]) events.toArray(new Event[events.size()]);
- }
-
- /**
- * Defines the list of available actions for the associated resource.
- *
- * @return the list of labelled actions.
- */
- protected abstract Map declareActions();
-
- /* (non-Javadoc)
- * @see org.objectweb.gotm.lib.resource.ActionProvider#getAction(int)
- */
- public Action action(Event name) {
- Action a = (Action) this.actions.get(name);
-// if (getLogger().isLoggable(DEBUG)) getLogger().log(DEBUG, "Loading
Action "+name+" as "+a);
- if (a == null ) throw new NoActionAvailableException(name);
- return a;
- }
-}
\ No newline at end of file
Index:
gotm/src/java/org/objectweb/gotm/lib/resource/NoActionAvailableException.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/resource/NoActionAvailableException.java:1.3
gotm/src/java/org/objectweb/gotm/lib/resource/NoActionAvailableException.java:removed
---
gotm/src/java/org/objectweb/gotm/lib/resource/NoActionAvailableException.java:1.3
Mon Nov 7 09:50:33 2005
+++
gotm/src/java/org/objectweb/gotm/lib/resource/NoActionAvailableException.java
Thu Nov 17 14:04:25 2005
@@ -1,47 +0,0 @@
-/*====================================================================
-
-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: NoActionAvailableException.java,v 1.3 2005/11/07 08:50:33 rouvoy Exp $
-====================================================================*/
-package org.objectweb.gotm.lib.resource;
-
-import org.objectweb.gotm.GoTMException;
-import org.objectweb.transaction.api.message.Event;
-
-/**
- * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @created 8 juil. 2005
- * @modified $Date: 2005/11/07 08:50:33 $
- * @version $Revision: 1.3 $
- */
-public class NoActionAvailableException
- extends GoTMException {
- /**
- * @param name the event raising the exception.
- */
- public NoActionAvailableException(Event name) {
- super("No action available for the "+name.label()+" event!");
- }
-}
Index: gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerASync.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerASync.java:1.3
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerASync.java:1.4
---
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerASync.java:1.3
Fri Aug 5 17:06:29 2005
+++ gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerASync.java
Thu Nov 17 14:04:22 2005
@@ -23,20 +23,23 @@
Contributor(s): .
---------------------------------------------------------------------
- $Id: ResourceManagerASync.java,v 1.3 2005/08/05 15:06:29 rouvoy Exp $
+ $Id: ResourceManagerASync.java,v 1.4 2005/11/17 13:04:22 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.resource;
import java.util.Map;
+import org.objectweb.gotm.lib.action.Action;
+import org.objectweb.gotm.lib.action.RunnableAction;
+
/**
* Implementation of a wrapper.
*
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @created 22 déc. 2004
- * @modified $Date: 2005/08/05 15:06:29 $
- * @version $Revision: 1.3 $
+ * @created 22 dec. 2004
+ * @modified $Date: 2005/11/17 13:04:22 $
+ * @version $Revision: 1.4 $
* @fractal.itf
*/
public class ResourceManagerASync
Index:
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerAbstract.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerAbstract.java:1.8
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerAbstract.java:1.9
---
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerAbstract.java:1.8
Tue Nov 15 17:12:33 2005
+++
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerAbstract.java
Thu Nov 17 14:04:22 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
-$Id: ResourceManagerAbstract.java,v 1.8 2005/11/15 16:12:33 rouvoy Exp $
+$Id: ResourceManagerAbstract.java,v 1.9 2005/11/17 13:04:22 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.resource;
@@ -34,6 +34,9 @@
import java.util.Map;
import org.objectweb.fractal.api.control.CacheController;
+import org.objectweb.gotm.lib.action.Action;
+import org.objectweb.gotm.lib.action.ActionProvider;
+import org.objectweb.gotm.lib.action.NoActionAvailableException;
import org.objectweb.gotm.lib.message.SubscribablePrimitive;
import org.objectweb.gotm.lib.transaction.InvalidStateException;
import org.objectweb.transaction.api.message.Event;
@@ -45,9 +48,9 @@
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
* @created 4 juil. 2005
- * @modified $Date: 2005/11/15 16:12:33 $
- * @version $Revision: 1.8 $
- * @fractal.itf name="action-provider" role="client"
signature="org.objectweb.gotm.lib.resource.ActionProvider"
+ * @modified $Date: 2005/11/17 13:04:22 $
+ * @version $Revision: 1.9 $
+ * @fractal.itf name="action-provider" role="client"
signature="org.objectweb.gotm.lib.action.ActionProvider"
* @fractal.itf name="tx-state" role="client"
signature="org.objectweb.transaction.api.transaction.TransactionState"
*/
public abstract class ResourceManagerAbstract
@@ -137,7 +140,7 @@
*/
public void clearFc() {
if (getLogger().isLoggable(DEBUG))
- getLogger().log(DEBUG, "Clearing the resources enlisted");
+ getLogger().log(DEBUG, "Clearing the participant list");
this.added.clear();
this.removed.clear();
}
@@ -150,7 +153,7 @@
public void addResource(final Object wrapped) {
if
(txState().checkStatus(TransactionStatusTransactionActive.status)) {
if (getLogger().isLoggable(DEBUG) && enlist != null)
- getLogger().log(DEBUG, "Enlisting a resource with action
"+enlist);
+ getLogger().log(DEBUG, "Enlisting a participant with action
"+enlist);
synchronized (this.added) {
this.added.add(wrapped);
}
@@ -167,7 +170,7 @@
public void delResource(final Object wrapped) {
if
(txState().checkStatus(TransactionStatusTransactionActive.status)) {
if (getLogger().isLoggable(DEBUG) && delist != null)
- getLogger().log(DEBUG, "Delisting a resource with action
"+delist);
+ getLogger().log(DEBUG, "Delisting a participant with action
"+delist);
synchronized (this.added) {
this.added.remove(wrapped);
}
@@ -192,7 +195,7 @@
public synchronized void notify(Event topic, Map context1) {
Action action = actionProvider().action(topic);
if (getLogger().isLoggable(DEBUG))
- getLogger().log(DEBUG, "Executing topic "+topic+" on resources
("+this.added.size()+", "+this.removed.size()+") with action "+action);
+ getLogger().log(DEBUG, "Executing topic "+topic+" on
participants(+"+this.added.size()+", -"+this.removed.size()+") with action
"+action);
for (Iterator i = this.added.iterator() ; i.hasNext() ;)
execute(action, i.next(), context1);
for (Iterator i = this.removed.iterator() ; i.hasNext() ;)
Index: gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerImpl.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerImpl.java:1.5
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerImpl.java:1.6
---
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerImpl.java:1.5
Mon Nov 7 09:50:33 2005
+++ gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerImpl.java
Thu Nov 17 14:04:22 2005
@@ -23,19 +23,20 @@
Contributor(s): .
---------------------------------------------------------------------
- $Id: ResourceManagerImpl.java,v 1.5 2005/11/07 08:50:33 rouvoy Exp $
+ $Id: ResourceManagerImpl.java,v 1.6 2005/11/17 13:04:22 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.resource;
import java.util.Map;
import org.objectweb.gotm.GoTMException;
+import org.objectweb.gotm.lib.action.Action;
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @created 1 févr. 2005
- * @modified $Date: 2005/11/07 08:50:33 $
- * @version $Revision: 1.5 $
+ * @created 1 febr. 2005
+ * @modified $Date: 2005/11/17 13:04:22 $
+ * @version $Revision: 1.6 $
* @fractal.itf
*/
public class ResourceManagerImpl
Index:
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerWithPool.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerWithPool.java:1.4
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerWithPool.java:1.5
---
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerWithPool.java:1.4
Mon Nov 7 09:50:33 2005
+++
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerWithPool.java
Thu Nov 17 14:04:22 2005
@@ -23,22 +23,25 @@
Contributor(s): .
---------------------------------------------------------------------
-$Id: ResourceManagerWithPool.java,v 1.4 2005/11/07 08:50:33 rouvoy Exp $
+$Id: ResourceManagerWithPool.java,v 1.5 2005/11/17 13:04:22 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.resource;
import java.util.Map;
+import org.objectweb.gotm.lib.action.Action;
+import org.objectweb.gotm.lib.action.ActionProvider;
+import org.objectweb.gotm.lib.action.RunnableAction;
import org.objectweb.transaction.api.message.SubscribeFeature;
import org.objectweb.util.thread.api.RunnableManager;
/**
* Implementation of a wrapper.
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @created 22 déc. 2004
- * @modified $Date: 2005/11/07 08:50:33 $
- * @version $Revision: 1.4 $
+ * @created 22 dec. 2004
+ * @modified $Date: 2005/11/17 13:04:22 $
+ * @version $Revision: 1.5 $
* @fractal.itf name="runnable-manager" role="client"
signature="org.objectweb.util.thread.api.RunnableManager"
*/
public class ResourceManagerWithPool
Index:
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerWithThread.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerWithThread.java:1.4
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerWithThread.java:1.5
---
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerWithThread.java:1.4
Mon Nov 7 09:50:33 2005
+++
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerWithThread.java
Thu Nov 17 14:04:22 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
- $Id: ResourceManagerWithThread.java,v 1.4 2005/11/07 08:50:33 rouvoy Exp $
+ $Id: ResourceManagerWithThread.java,v 1.5 2005/11/17 13:04:22 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.resource;
@@ -33,15 +33,17 @@
import java.util.Iterator;
import java.util.Map;
+import org.objectweb.gotm.lib.action.Action;
+import org.objectweb.gotm.lib.action.RunnableAction;
import org.objectweb.transaction.api.message.Event;
/**
* Implementation of a wrapper.
*
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @created 22 déc. 2004
- * @modified $Date: 2005/11/07 08:50:33 $
- * @version $Revision: 1.4 $
+ * @created 22 dec. 2004
+ * @modified $Date: 2005/11/17 13:04:22 $
+ * @version $Revision: 1.5 $
* @fractal.itf
*/
public class ResourceManagerWithThread
Index: gotm/src/java/org/objectweb/gotm/lib/resource/RunnableAction.java
diff -u gotm/src/java/org/objectweb/gotm/lib/resource/RunnableAction.java:1.1
gotm/src/java/org/objectweb/gotm/lib/resource/RunnableAction.java:removed
--- gotm/src/java/org/objectweb/gotm/lib/resource/RunnableAction.java:1.1
Mon May 23 13:20:55 2005
+++ gotm/src/java/org/objectweb/gotm/lib/resource/RunnableAction.java Thu
Nov 17 14:04:25 2005
@@ -1,63 +0,0 @@
-/*====================================================================
-
-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: RunnableAction.java,v 1.1 2005/05/23 11:20:55 rouvoy Exp $
-====================================================================*/
-package org.objectweb.gotm.lib.resource;
-
-import java.util.Map;
-
-/**
- * @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @created 2 mai 2005
- * @modified $Date: 2005/05/23 11:20:55 $
- * @version $Revision: 1.1 $
- */
-public class RunnableAction
- extends Thread {
-
- private Action delegate ;
- private Map context ;
- private Object resource;
-
- /**
- * @param action
- * @param ctx
- * @param res
- */
- public RunnableAction(Action action, Map ctx, Object res) {
- this.delegate = action ;
- this.context = ctx ;
- this.resource = res ;
- }
-
- public void run() {
- try {
- this.delegate.execute(this.context, this.resource);
- }catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-}
Index: gotm/src/java/org/objectweb/gotm/lib/stat/EventCounter.java
diff -u gotm/src/java/org/objectweb/gotm/lib/stat/EventCounter.java:1.2
gotm/src/java/org/objectweb/gotm/lib/stat/EventCounter.java:1.3
--- gotm/src/java/org/objectweb/gotm/lib/stat/EventCounter.java:1.2 Mon
Nov 7 09:50:33 2005
+++ gotm/src/java/org/objectweb/gotm/lib/stat/EventCounter.java Thu Nov 17
14:04:23 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
-$Id: EventCounter.java,v 1.2 2005/11/07 08:50:33 rouvoy Exp $
+$Id: EventCounter.java,v 1.3 2005/11/17 13:04:23 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.stat;
@@ -32,9 +32,9 @@
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @created 29 août 2005
- * @modified $Date: 2005/11/07 08:50:33 $
- * @version $Revision: 1.2 $
+ * @created 29 aug. 2005
+ * @modified $Date: 2005/11/17 13:04:23 $
+ * @version $Revision: 1.3 $
* @fractal.itf name="event-counter"
*/
public interface EventCounter
Index: gotm/src/java/org/objectweb/gotm/lib/stat/EventCounterImpl.java
diff -u gotm/src/java/org/objectweb/gotm/lib/stat/EventCounterImpl.java:1.2
gotm/src/java/org/objectweb/gotm/lib/stat/EventCounterImpl.java:1.3
--- gotm/src/java/org/objectweb/gotm/lib/stat/EventCounterImpl.java:1.2 Mon
Nov 7 09:50:33 2005
+++ gotm/src/java/org/objectweb/gotm/lib/stat/EventCounterImpl.java Thu
Nov 17 14:04:23 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
-$Id: EventCounterImpl.java,v 1.2 2005/11/07 08:50:33 rouvoy Exp $
+$Id: EventCounterImpl.java,v 1.3 2005/11/17 13:04:23 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.stat;
@@ -41,9 +41,9 @@
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @created 29 août 2005
- * @modified $Date: 2005/11/07 08:50:33 $
- * @version $Revision: 1.2 $
+ * @created 29 aug. 2005
+ * @modified $Date: 2005/11/17 13:04:23 $
+ * @version $Revision: 1.3 $
* @fractal.itf
*/
public class EventCounterImpl
| <-- Date Index --> | <-- Thread Index --> |
Powered by MHonArc.
Copyright © 2006-2007, OW2 Consortium | contact | webmaster.