Mail Archive Home | gotm-commits List | July 2005 Index
| <-- Date Index --> | <-- Thread Index --> |
Date: Monday, July 18, 2005 @ 16:33:36
Author: rouvoy
Path: /cvsroot/gotm/gotm/src
Modified: fractal/org/objectweb/gotm/lib/coordination/Tp2PC.fractal
fractal/org/objectweb/gotm/lib/coordination/TpCommitEngine.fractal
java/org/objectweb/gotm/lib/coordination/AbortFeature.java
java/org/objectweb/gotm/lib/coordination/AbstractCoordinationFeature.java
java/org/objectweb/gotm/lib/coordination/CommitFeature.java
java/org/objectweb/gotm/lib/coordination/TwoPCFeature.java
java/org/objectweb/gotm/lib/event/PublishSimple.java
java/org/objectweb/gotm/lib/event/SubscribablePrimitive.java
java/org/objectweb/gotm/lib/logging/HOWLoggerProvider.java
java/org/objectweb/gotm/lib/resource/ActionProviderAbstract.java
java/org/objectweb/gotm/lib/resource/ResourceDelistEvent.java
java/org/objectweb/gotm/lib/resource/ResourceEnlistEvent.java
java/org/objectweb/gotm/lib/resource/ResourceManagerAbstract.java
* Correcting a bug in resource event propagations,
* Renaming leaving events.
---------------------------------------------------------------------------+
fractal/org/objectweb/gotm/lib/coordination/Tp2PC.fractal |
23 +++---
fractal/org/objectweb/gotm/lib/coordination/TpCommitEngine.fractal |
36 +++++-----
java/org/objectweb/gotm/lib/coordination/AbortFeature.java |
10 +-
java/org/objectweb/gotm/lib/coordination/AbstractCoordinationFeature.java |
27 +++++--
java/org/objectweb/gotm/lib/coordination/CommitFeature.java |
13 +--
java/org/objectweb/gotm/lib/coordination/TwoPCFeature.java |
19 +----
java/org/objectweb/gotm/lib/event/PublishSimple.java |
8 +-
java/org/objectweb/gotm/lib/event/SubscribablePrimitive.java |
7 +
java/org/objectweb/gotm/lib/logging/HOWLoggerProvider.java |
21 +++--
java/org/objectweb/gotm/lib/resource/ActionProviderAbstract.java |
7 +
java/org/objectweb/gotm/lib/resource/ResourceDelistEvent.java |
16 ++--
java/org/objectweb/gotm/lib/resource/ResourceEnlistEvent.java |
18 ++---
java/org/objectweb/gotm/lib/resource/ResourceManagerAbstract.java |
19 +++--
13 files changed, 120 insertions(+), 104 deletions(-)
Index: gotm/src/fractal/org/objectweb/gotm/lib/coordination/Tp2PC.fractal
diff -u
gotm/src/fractal/org/objectweb/gotm/lib/coordination/Tp2PC.fractal:1.4
gotm/src/fractal/org/objectweb/gotm/lib/coordination/Tp2PC.fractal:1.5
--- gotm/src/fractal/org/objectweb/gotm/lib/coordination/Tp2PC.fractal:1.4
Mon Jul 18 09:30:10 2005
+++ gotm/src/fractal/org/objectweb/gotm/lib/coordination/Tp2PC.fractal Mon
Jul 18 16:33:35 2005
@@ -9,33 +9,36 @@
<interface name="abort" role="server"
signature="org.objectweb.transaction.api.coordination.CoordinationFeature"/>
+ <interface name="tx-state" role="client"
+
signature="org.objectweb.transaction.api.transaction.TransactionState"/>
<interface name="sync-publish" role="client"
signature="org.objectweb.transaction.api.event.PublishFeature"/>
<interface name="async-publish" role="client"
signature="org.objectweb.transaction.api.event.PublishFeature"/>
- <interface name="tx-state" role="client"
-
signature="org.objectweb.transaction.api.transaction.TransactionState"/>
- <interface name="xid-provider" role="client"
- signature="org.objectweb.gotm.lib.xid.XidFeature"/>
+ <interface name="force" role="client"
+ signature="org.objectweb.transaction.api.logging.LoggerFeature"/>
+ <interface name="no-force" role="client"
+ signature="org.objectweb.transaction.api.logging.LoggerFeature"/>
+ <interface name="empty" role="client"
+ signature="org.objectweb.transaction.api.logging.LoggerFeature"/>
<component name="FcCommitEngine"
definition="org.objectweb.gotm.lib.coordination.TpCommitEngine"/>
- <component name="FcLogger"
- definition="org.objectweb.gotm.lib.logging.TpLoggingHOWL"/>
<binding client="this.commit" server="FcCommitEngine.commit"/>
<binding client="this.abort" server="FcCommitEngine.abort"/>
<binding client="FcCommitEngine.tx-state" server="this.tx-state"/>
- <binding client="FcLogger.xid-provider"
server="this.xid-provider"/>
<binding client="FcCommitEngine.commit-decision"
server="this.sync-publish"/>
<binding client="FcCommitEngine.prepare-decision"
server="this.sync-publish"/>
<binding client="FcCommitEngine.abort-decision"
server="this.sync-publish"/>
- <binding client="FcCommitEngine.prepare-log" server="FcLogger.empty"/>
- <binding client="FcCommitEngine.commit-log" server="FcLogger.empty"/>
- <binding client="FcCommitEngine.abort-log" server="FcLogger.empty"/>
+ <binding client="FcCommitEngine.init-log" server="this.empty"/>
+ <binding client="FcCommitEngine.commit-log" server="this.empty"/>
+ <binding client="FcCommitEngine.abort-log" server="this.empty"/>
+ <binding client="FcCommitEngine.commit-end-log" server="this.empty"/>
+ <binding client="FcCommitEngine.abort-end-log" server="this.empty"/>
<template-controller desc="compositeTemplate" />
</definition>
Index:
gotm/src/fractal/org/objectweb/gotm/lib/coordination/TpCommitEngine.fractal
diff -u
gotm/src/fractal/org/objectweb/gotm/lib/coordination/TpCommitEngine.fractal:1.1
gotm/src/fractal/org/objectweb/gotm/lib/coordination/TpCommitEngine.fractal:1.2
---
gotm/src/fractal/org/objectweb/gotm/lib/coordination/TpCommitEngine.fractal:1.1
Mon Jul 11 10:27:04 2005
+++
gotm/src/fractal/org/objectweb/gotm/lib/coordination/TpCommitEngine.fractal
Mon Jul 18 16:33:35 2005
@@ -9,20 +9,24 @@
<interface name="abort" role="server"
signature="org.objectweb.transaction.api.coordination.CoordinationFeature"/>
+ <interface name="tx-state" role="client"
+
signature="org.objectweb.transaction.api.transaction.TransactionState"/>
<interface name="prepare-decision" role="client"
signature="org.objectweb.transaction.api.event.PublishFeature"/>
<interface name="commit-decision" role="client"
signature="org.objectweb.transaction.api.event.PublishFeature"/>
<interface name="abort-decision" role="client"
signature="org.objectweb.transaction.api.event.PublishFeature"/>
- <interface name="tx-state" role="client"
-
signature="org.objectweb.transaction.api.transaction.TransactionState"/>
- <interface name="prepare-log" role="client"
+ <interface name="init-log" role="client"
signature="org.objectweb.transaction.api.logging.LoggerFeature"/>
<interface name="commit-log" role="client"
signature="org.objectweb.transaction.api.logging.LoggerFeature"/>
<interface name="abort-log" role="client"
signature="org.objectweb.transaction.api.logging.LoggerFeature"/>
+ <interface name="commit-end-log" role="client"
+ signature="org.objectweb.transaction.api.logging.LoggerFeature"/>
+ <interface name="abort-end-log" role="client"
+ signature="org.objectweb.transaction.api.logging.LoggerFeature"/>
<component name="Fc2PC"
definition="org.objectweb.gotm.lib.coordination.TpTwoPCFeature"/>
@@ -34,20 +38,22 @@
<binding client="this.commit" server="Fc2PC.coord-process"/>
<binding client="this.abort" server="FcAbort.coord-process"/>
- <binding client="Fc2PC.commit" server="FcCommit.coord-process"/>
- <binding client="Fc2PC.tx-state" server="this.tx-state"/>
- <binding client="Fc2PC.abort" server="FcAbort.coord-process"/>
- <binding client="Fc2PC.publish" server="this.prepare-decision"/>
- <binding client="Fc2PC.log" server="this.prepare-log"/>
+ <binding client="Fc2PC.commit" server="FcCommit.coord-process"/>
+ <binding client="Fc2PC.tx-state" server="this.tx-state"/>
+ <binding client="Fc2PC.abort" server="FcAbort.coord-process"/>
+ <binding client="Fc2PC.publish" server="this.prepare-decision"/>
+ <binding client="Fc2PC.begin-log" server="this.init-log"/>
- <binding client="FcCommit.tx-state" server="this.tx-state"/>
- <binding client="FcCommit.abort" server="FcAbort.coord-process"/>
- <binding client="FcCommit.publish" server="this.commit-decision"/>
- <binding client="FcCommit.log" server="this.commit-log"/>
+ <binding client="FcCommit.tx-state" server="this.tx-state"/>
+ <binding client="FcCommit.abort" server="FcAbort.coord-process"/>
+ <binding client="FcCommit.publish" server="this.commit-decision"/>
+ <binding client="FcCommit.begin-log" server="this.commit-log"/>
+ <binding client="FcCommit.end-log" server="this.commit-end-log"/>
- <binding client="FcAbort.tx-state" server="this.tx-state"/>
- <binding client="FcAbort.publish" server="this.abort-decision"/>
- <binding client="FcAbort.log" server="this.abort-log"/>
+ <binding client="FcAbort.tx-state" server="this.tx-state"/>
+ <binding client="FcAbort.publish" server="this.abort-decision"/>
+ <binding client="FcAbort.begin-log" server="this.abort-log"/>
+ <binding client="FcAbort.end-log" server="this.abort-end-log"/>
<template-controller desc="compositeTemplate" />
</definition>
Index: gotm/src/java/org/objectweb/gotm/lib/coordination/AbortFeature.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/coordination/AbortFeature.java:1.3
gotm/src/java/org/objectweb/gotm/lib/coordination/AbortFeature.java:1.4
--- gotm/src/java/org/objectweb/gotm/lib/coordination/AbortFeature.java:1.3
Mon Jul 18 09:30:11 2005
+++ gotm/src/java/org/objectweb/gotm/lib/coordination/AbortFeature.java Mon
Jul 18 16:33:36 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
-$Id: AbortFeature.java,v 1.3 2005/07/18 07:30:11 rouvoy Exp $
+$Id: AbortFeature.java,v 1.4 2005/07/18 14:33:36 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.coordination;
@@ -37,7 +37,7 @@
/**
* Implementation of the cancel process.
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
* @fractal.itf
*/
public class AbortFeature
@@ -49,12 +49,10 @@
public void process(Map context) {
if (getLogger().isLoggable(DEBUG))
getLogger().log(DEBUG,"Processing Abort...");
+
getBeginLog().log(TransactionStatusRollingBack.status.getLabel().getBytes());
getTxState().setStatus(TransactionStatusRollingBack.status);
-// if (getLogger().isLoggable(DEBUG))
-// getLogger().log(DEBUG,"Sending abort decision...");
-
getLog().log(TransactionStatusRollingBack.status.getLabel().getBytes());
getPublisher().notify(ResourceEventRollback.event,context);
-//
getLog().log(TransactionStatusRolledBack.status.getLabel().getBytes());
+
getEndLog().log(TransactionStatusRolledBack.status.getLabel().getBytes());
getTxState().setStatus(TransactionStatusRolledBack.status);
}
}
Index:
gotm/src/java/org/objectweb/gotm/lib/coordination/AbstractCoordinationFeature.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/coordination/AbstractCoordinationFeature.java:1.7
gotm/src/java/org/objectweb/gotm/lib/coordination/AbstractCoordinationFeature.java:1.8
---
gotm/src/java/org/objectweb/gotm/lib/coordination/AbstractCoordinationFeature.java:1.7
Mon Jul 11 10:27:04 2005
+++
gotm/src/java/org/objectweb/gotm/lib/coordination/AbstractCoordinationFeature.java
Mon Jul 18 16:33:36 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
- $Id: AbstractCoordinationFeature.java,v 1.7 2005/07/11 08:27:04 rouvoy Exp $
+ $Id: AbstractCoordinationFeature.java,v 1.8 2005/07/18 14:33:36 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.coordination;
@@ -39,16 +39,22 @@
* Abstract implementation of a validation engine.
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
* @created 5 janv. 2005
- * @modified $Date: 2005/07/11 08:27:04 $
- * @version $Revision: 1.7 $
+ * @modified $Date: 2005/07/18 14:33:36 $
+ * @version $Revision: 1.8 $
* @fractal.itf name="publish" role="client"
signature="org.objectweb.transaction.api.event.PublishFeature"
* @fractal.itf name="tx-state" role="client"
signature="org.objectweb.transaction.api.transaction.TransactionState"
- * @fractal.itf name="log" role="client"
signature="org.objectweb.transaction.api.logging.LoggerFeature"
+ * @fractal.itf name="begin-log" role="client"
signature="org.objectweb.transaction.api.logging.LoggerFeature"
+ * @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()
*/
@@ -56,7 +62,7 @@
return new String[] {
PublishFeature.PUBLISH_FEATURE,
TransactionState.TRANSACTION_STATE,
- LoggerFeature.LOGGER
+ BEGIN_LOG, END_LOG
};
}
@@ -77,7 +83,14 @@
/**
* @return the recovery logger.
*/
- protected final LoggerFeature getLog() {
- return (LoggerFeature) fcBindings.get(LoggerFeature.LOGGER);
+ protected final LoggerFeature getBeginLog() {
+ return (LoggerFeature) fcBindings.get(BEGIN_LOG);
+ }
+
+ /**
+ * @return the recovery logger.
+ */
+ protected final LoggerFeature getEndLog() {
+ return (LoggerFeature) fcBindings.get(END_LOG);
}
}
Index: gotm/src/java/org/objectweb/gotm/lib/coordination/CommitFeature.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/coordination/CommitFeature.java:1.4
gotm/src/java/org/objectweb/gotm/lib/coordination/CommitFeature.java:1.5
--- gotm/src/java/org/objectweb/gotm/lib/coordination/CommitFeature.java:1.4
Mon Jul 18 09:30:11 2005
+++ gotm/src/java/org/objectweb/gotm/lib/coordination/CommitFeature.java
Mon Jul 18 16:33:36 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
- $Id: CommitFeature.java,v 1.4 2005/07/18 07:30:11 rouvoy Exp $
+ $Id: CommitFeature.java,v 1.5 2005/07/18 14:33:36 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.coordination;
@@ -33,7 +33,6 @@
import org.objectweb.gotm.lib.transaction.InvalidTransitionException;
import org.objectweb.transaction.api.coordination.CoordinationFeature;
import org.objectweb.transaction.api.event.PublishFeature;
-import org.objectweb.transaction.api.logging.LoggerFeature;
import org.objectweb.transaction.api.transaction.TransactionState;
import org.objectweb.transaction.lib.resource.ResourceEventCommit;
import org.objectweb.transaction.lib.transaction.TransactionStatusCommitted;
@@ -43,7 +42,7 @@
/**
* One phase validation process.
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.5 $
* @fractal.itf name="abort" role="client"
signature="org.objectweb.transaction.api.coordination.CoordinationFeature"
*/
public class CommitFeature
@@ -59,7 +58,7 @@
return new String[] {
PublishFeature.PUBLISH_FEATURE,
TransactionState.TRANSACTION_STATE,
- LoggerFeature.LOGGER,
+ BEGIN_LOG, END_LOG,
ABORT
};
}
@@ -79,11 +78,9 @@
getLogger().log(DEBUG,"Processing Commit...");
try {
getTxState().setStatus(TransactionStatusCommitting.status);
-
getLog().log(TransactionStatusCommitting.status.getLabel().getBytes());
-// if (getLogger().isLoggable(DEBUG))
-// getLogger().log(DEBUG,"Sending commit decision...");
+
getBeginLog().log(TransactionStatusCommitting.status.getLabel().getBytes());
getPublisher().notify(ResourceEventCommit.event,context);
-//
getLog().log(TransactionStatusCommitted.status.getLabel().getBytes());
+
getEndLog().log(TransactionStatusCommitted.status.getLabel().getBytes());
getTxState().setStatus(TransactionStatusCommitted.status);
} catch (InvalidTransitionException e) {
if (getLogger().isLoggable(DEBUG))
Index: gotm/src/java/org/objectweb/gotm/lib/coordination/TwoPCFeature.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/coordination/TwoPCFeature.java:1.4
gotm/src/java/org/objectweb/gotm/lib/coordination/TwoPCFeature.java:1.5
--- gotm/src/java/org/objectweb/gotm/lib/coordination/TwoPCFeature.java:1.4
Mon Jul 18 09:30:11 2005
+++ gotm/src/java/org/objectweb/gotm/lib/coordination/TwoPCFeature.java Mon
Jul 18 16:33:36 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
- $Id: TwoPCFeature.java,v 1.4 2005/07/18 07:30:11 rouvoy Exp $
+ $Id: TwoPCFeature.java,v 1.5 2005/07/18 14:33:36 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.coordination;
@@ -36,7 +36,6 @@
import org.objectweb.gotm.lib.transaction.InvalidTransitionException;
import org.objectweb.transaction.api.coordination.CoordinationFeature;
import org.objectweb.transaction.api.event.PublishFeature;
-import org.objectweb.transaction.api.logging.LoggerFeature;
import org.objectweb.transaction.api.transaction.TransactionState;
import org.objectweb.transaction.lib.resource.ResourceEventVote;
import org.objectweb.transaction.lib.resource.ResourceVoteCommit;
@@ -50,8 +49,8 @@
* Implementation of a Two-Phase Commit Protocol.
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
* @created 5 janv. 2005
- * @modified $Date: 2005/07/18 07:30:11 $
- * @version $Revision: 1.4 $
+ * @modified $Date: 2005/07/18 14:33:36 $
+ * @version $Revision: 1.5 $
* @fractal.itf name="commit" role="client"
signature="org.objectweb.transaction.api.coordination.CoordinationFeature"
*/
public class TwoPCFeature
@@ -67,7 +66,7 @@
return new String[] {
PublishFeature.PUBLISH_FEATURE,
TransactionState.TRANSACTION_STATE,
- LoggerFeature.LOGGER,
+ BEGIN_LOG, END_LOG,
COMMIT,
ABORT
};
@@ -87,21 +86,15 @@
if (getLogger().isLoggable(DEBUG))
getLogger().log(DEBUG,"Processing Atomic 2 Phases
Validation...");
try {
+
getBeginLog().log(TransactionStatusPrepared.status.getLabel().getBytes());
getTxState().setStatus(TransactionStatusPreparing.status);
context.put(ResourceVoteRollback.vote,
Collections.synchronizedList(new ArrayList()));
context.put(ResourceVoteCommit.vote,
Collections.synchronizedList(new ArrayList()));
context.put(ResourceVoteReadOnly.vote,
Collections.synchronizedList(new ArrayList()));
-
-//
getLog().log(TransactionStatusPreparing.status.getLabel().getBytes());
getPublisher().notify(ResourceEventVote.event, context);
List enf_rollback = (List)
context.get(ResourceVoteRollback.vote);
- boolean decision = (enf_rollback.size() == 0);
getTxState().setStatus(TransactionStatusPrepared.status);
-
getLog().log(TransactionStatusPrepared.status.getLabel().getBytes());
-
-// if (getLogger().isLoggable(DEBUG))
-// getLogger().log(DEBUG,"Commit decision = "+decision);
- if (decision) {
+ if (enf_rollback.size() == 0) {
commit().process(context);
} else {
abort().process(context);
Index: gotm/src/java/org/objectweb/gotm/lib/event/PublishSimple.java
diff -u gotm/src/java/org/objectweb/gotm/lib/event/PublishSimple.java:1.1
gotm/src/java/org/objectweb/gotm/lib/event/PublishSimple.java:1.2
--- gotm/src/java/org/objectweb/gotm/lib/event/PublishSimple.java:1.1 Mon
Jul 11 10:27:04 2005
+++ gotm/src/java/org/objectweb/gotm/lib/event/PublishSimple.java Mon
Jul 18 16:33:35 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
- $Id: PublishSimple.java,v 1.1 2005/07/11 08:27:04 rouvoy Exp $
+ $Id: PublishSimple.java,v 1.2 2005/07/18 14:33:35 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.event;
@@ -37,8 +37,8 @@
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
* @created 12 janv. 2005
- * @modified $Date: 2005/07/11 08:27:04 $
- * @version $Revision: 1.1 $
+ * @modified $Date: 2005/07/18 14:33:35 $
+ * @version $Revision: 1.2 $
* @fractal.itf name="subscriber-provider" role="client"
signature="org.objectweb.gotm.lib.event.SubscriberProvider"
*/
public class PublishSimple
@@ -67,7 +67,7 @@
*/
public void notify(Event topic, Map context) {
if (getLogger().isLoggable(DEBUG))
- getLogger().log(DEBUG, "Notifying of topic " + topic);
+ getLogger().log(DEBUG, "Notifying of topic " + topic + " to
"+getProvider().getTopic(topic).size()+" subscriber(s)");
for (Iterator i = getProvider().getTopic(topic).iterator();
i.hasNext();)
((PublishFeature) i.next()).notify(topic, context);
}
Index: gotm/src/java/org/objectweb/gotm/lib/event/SubscribablePrimitive.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/event/SubscribablePrimitive.java:1.3
gotm/src/java/org/objectweb/gotm/lib/event/SubscribablePrimitive.java:1.4
--- gotm/src/java/org/objectweb/gotm/lib/event/SubscribablePrimitive.java:1.3
Mon Jul 11 10:27:04 2005
+++ gotm/src/java/org/objectweb/gotm/lib/event/SubscribablePrimitive.java
Mon Jul 18 16:33:35 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
-$Id: SubscribablePrimitive.java,v 1.3 2005/07/11 08:27:04 rouvoy Exp $
+$Id: SubscribablePrimitive.java,v 1.4 2005/07/18 14:33:35 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.event;
@@ -37,8 +37,8 @@
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
* @created 12 janv. 2005
- * @modified $Date: 2005/07/11 08:27:04 $
- * @version $Revision: 1.3 $
+ * @modified $Date: 2005/07/18 14:33:35 $
+ * @version $Revision: 1.4 $
* @fractal.itf name="subscribe" role="client"
signature="org.objectweb.transaction.api.event.SubscribeFeature"
*/
public abstract class SubscribablePrimitive
@@ -68,6 +68,7 @@
* @see org.objectweb.fractal.api.control.CacheController#loadFc()
*/
public void initFc() {
+ if (getLogger().isLoggable(DEBUG)) getLogger().log(DEBUG,
"Subscribing to "+getEvents());
getSubscriber().subscribe(getEvents(), this);
}
Index: gotm/src/java/org/objectweb/gotm/lib/logging/HOWLoggerProvider.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/logging/HOWLoggerProvider.java:1.2
gotm/src/java/org/objectweb/gotm/lib/logging/HOWLoggerProvider.java:1.3
--- gotm/src/java/org/objectweb/gotm/lib/logging/HOWLoggerProvider.java:1.2
Mon Jul 18 09:30:10 2005
+++ gotm/src/java/org/objectweb/gotm/lib/logging/HOWLoggerProvider.java Mon
Jul 18 16:33:36 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
-$Id: HOWLoggerProvider.java,v 1.2 2005/07/18 07:30:10 rouvoy Exp $
+$Id: HOWLoggerProvider.java,v 1.3 2005/07/18 14:33:36 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.logging;
@@ -41,8 +41,8 @@
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
* @created 7 juil. 2005
- * @modified $Date: 2005/07/18 07:30:10 $
- * @version $Revision: 1.2 $
+ * @modified $Date: 2005/07/18 14:33:36 $
+ * @version $Revision: 1.3 $
* @fractal.itf
*/
public class HOWLoggerProvider
@@ -59,7 +59,7 @@
*/
protected String dirpath ;
- protected Logger logger ;
+ protected static Logger logger ;
/* (non-Javadoc)
@@ -103,8 +103,8 @@
cfg.setLogFileName(this.filename);
cfg.setLogFileDir(this.dirpath);
try {
- this.logger = new Logger(cfg);
-// this.open() ;
+ HOWLoggerProvider.logger = new Logger(cfg);
+ //HOWLoggerProvider.logger.open() ;
} catch (Exception e) {
throw new IllegalLifeCycleException(e.getMessage());
}
@@ -115,31 +115,32 @@
*/
public void stopFc() throws IllegalLifeCycleException {
try {
- this.close() ;
+ HOWLoggerProvider.logger.close() ;
} catch (Exception e) {
throw new IllegalLifeCycleException(e.getMessage());
}
+ HOWLoggerProvider.logger = null;
}
/* (non-Javadoc)
* @see org.objectweb.gotm.lib.logging.LoggerManager#close()
*/
public void close() throws IOException, InterruptedException {
- this.logger.close() ;
+ HOWLoggerProvider.logger.close() ;
}
/* (non-Javadoc)
* @see org.objectweb.gotm.lib.logging.LoggerManager#open()
*/
public void open() throws InvalidFileSetException, IOException,
LogConfigurationException, InvalidLogBufferException, InterruptedException {
- this.logger.open() ;
+ HOWLoggerProvider.logger.open() ;
}
/* (non-Javadoc)
* @see org.objectweb.gotm.lib.logging.LoggerProvider#getLogging()
*/
public Logger getLogging() {
- return this.logger;
+ return HOWLoggerProvider.logger;
}
/* (non-Javadoc)
Index:
gotm/src/java/org/objectweb/gotm/lib/resource/ActionProviderAbstract.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/resource/ActionProviderAbstract.java:1.1
gotm/src/java/org/objectweb/gotm/lib/resource/ActionProviderAbstract.java:1.2
---
gotm/src/java/org/objectweb/gotm/lib/resource/ActionProviderAbstract.java:1.1
Mon Jul 18 09:30:10 2005
+++ gotm/src/java/org/objectweb/gotm/lib/resource/ActionProviderAbstract.java
Mon Jul 18 16:33:35 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
-$Id: ActionProviderAbstract.java,v 1.1 2005/07/18 07:30:10 rouvoy Exp $
+$Id: ActionProviderAbstract.java,v 1.2 2005/07/18 14:33:35 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.resource;
@@ -36,8 +36,8 @@
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
* @created 4 juil. 2005
- * @modified $Date: 2005/07/18 07:30:10 $
- * @version $Revision: 1.1 $
+ * @modified $Date: 2005/07/18 14:33:35 $
+ * @version $Revision: 1.2 $
* @fractal.itf
*/
public abstract class ActionProviderAbstract
@@ -76,6 +76,7 @@
*/
public Action getAction(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;
}
Index: gotm/src/java/org/objectweb/gotm/lib/resource/ResourceDelistEvent.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceDelistEvent.java:1.1
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceDelistEvent.java:1.2
---
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceDelistEvent.java:1.1
Mon Jul 18 09:30:10 2005
+++ gotm/src/java/org/objectweb/gotm/lib/resource/ResourceDelistEvent.java
Mon Jul 18 16:33:35 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
-$Id: ResourceDelistEvent.java,v 1.1 2005/07/18 07:30:10 rouvoy Exp $
+$Id: ResourceDelistEvent.java,v 1.2 2005/07/18 14:33:35 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.resource;
@@ -33,19 +33,19 @@
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
* @created 13 juil. 2005
- * @modified $Date: 2005/07/18 07:30:10 $
- * @version $Revision: 1.1 $
+ * @modified $Date: 2005/07/18 14:33:35 $
+ * @version $Revision: 1.2 $
*/
public class ResourceDelistEvent
extends EventAbstract {
/** Object value for the event <i>Resource Delistment</i>. */
- public final static Event event = new ResourceDelistEvent();
+ public final static Event event = new ResourceDelistEvent("Resource
delistment");
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
+ /**
+ * @param string
*/
- public String toString() {
- return "Resource delistment" ;
+ public ResourceDelistEvent(String string) {
+ super(string);
}
/* (non-Javadoc)
Index: gotm/src/java/org/objectweb/gotm/lib/resource/ResourceEnlistEvent.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceEnlistEvent.java:1.1
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceEnlistEvent.java:1.2
---
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceEnlistEvent.java:1.1
Mon Jul 18 09:30:10 2005
+++ gotm/src/java/org/objectweb/gotm/lib/resource/ResourceEnlistEvent.java
Mon Jul 18 16:33:35 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
-$Id: ResourceEnlistEvent.java,v 1.1 2005/07/18 07:30:10 rouvoy Exp $
+$Id: ResourceEnlistEvent.java,v 1.2 2005/07/18 14:33:35 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.resource;
@@ -33,21 +33,21 @@
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
* @created 13 juil. 2005
- * @modified $Date: 2005/07/18 07:30:10 $
- * @version $Revision: 1.1 $
+ * @modified $Date: 2005/07/18 14:33:35 $
+ * @version $Revision: 1.2 $
*/
public class ResourceEnlistEvent
extends EventAbstract {
/** Object value for the event <i>Resource Enlistment</i>. */
- public final static Event event = new ResourceEnlistEvent();
+ public final static Event event = new ResourceEnlistEvent("Resource
enlistment");
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
+ /**
+ * @param string
*/
- public String toString() {
- return "Resource enlistment" ;
+ public ResourceEnlistEvent(String string) {
+ super(string);
}
-
+
/* (non-Javadoc)
* @see org.objectweb.transaction.lib.event.EventAbstract#getEvent()
*/
Index:
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerAbstract.java
diff -u
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerAbstract.java:1.1
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerAbstract.java:1.2
---
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerAbstract.java:1.1
Mon Jul 18 09:30:10 2005
+++
gotm/src/java/org/objectweb/gotm/lib/resource/ResourceManagerAbstract.java
Mon Jul 18 16:33:35 2005
@@ -23,7 +23,7 @@
Contributor(s): .
---------------------------------------------------------------------
-$Id: ResourceManagerAbstract.java,v 1.1 2005/07/18 07:30:10 rouvoy Exp $
+$Id: ResourceManagerAbstract.java,v 1.2 2005/07/18 14:33:35 rouvoy Exp $
====================================================================*/
package org.objectweb.gotm.lib.resource;
@@ -44,8 +44,8 @@
/**
* @author <a href="mailto:Romain.Rouvoy@xxxxxxx">Romain Rouvoy</a>
* @created 4 juil. 2005
- * @modified $Date: 2005/07/18 07:30:10 $
- * @version $Revision: 1.1 $
+ * @modified $Date: 2005/07/18 14:33:35 $
+ * @version $Revision: 1.2 $
* @fractal.itf name="action-provider" role="client"
signature="org.objectweb.gotm.lib.resource.ActionProvider"
* @fractal.itf name="tx-state" role="client"
signature="org.objectweb.transaction.api.transaction.TransactionState"
*/
@@ -59,7 +59,6 @@
public static final String RESOURCE_REMOVED = "resource-removed";
/** list of registered added for this kind of wrapper. */
-// protected final Collection added =
Collections.synchronizedCollection(new ArrayList());
protected final Collection added = new ArrayList();
protected final Collection removed = new ArrayList();
protected final Map context = new HashMap();
@@ -107,6 +106,7 @@
* @see org.objectweb.fractal.api.control.CacheController#initFc()
*/
public void initFc() {
+ super.initFc();
try {
this.enlist =
actionProvider().getAction(ResourceEnlistEvent.event);
} catch (NoActionAvailableException e) {
@@ -125,6 +125,7 @@
* @see org.objectweb.fractal.api.control.CacheController#clearFc()
*/
public void clearFc() {
+ super.clearFc();
this.added.clear();
this.removed.clear();
}
@@ -136,8 +137,8 @@
*/
public void addResource(final Object wrapped) {
if
(txState().getStatus()==TransactionStatusTransactionActive.status) {
-// if (getLogger().isLoggable(DEBUG))
-// getLogger().log(DEBUG, "Enlisting a resource.");
+ if (getLogger().isLoggable(DEBUG))
+ getLogger().log(DEBUG, "Enlisting a resource with action
"+enlist);
synchronized (this.added) {
this.added.add(wrapped);
}
@@ -153,8 +154,8 @@
*/
public void delResource(final Object wrapped) {
if
(txState().getStatus()==TransactionStatusTransactionActive.status) {
-// if (getLogger().isLoggable(DEBUG))
-// getLogger().log(DEBUG, "Delisting a resource.");
+ if (getLogger().isLoggable(DEBUG))
+ getLogger().log(DEBUG, "Delisting a resource with action
"+delist);
synchronized (this.added) {
this.added.remove(wrapped);
}
@@ -171,6 +172,8 @@
*/
public void notify(Event topic, Map context1) {
Action action = actionProvider().getAction(topic);
+ if (getLogger().isLoggable(DEBUG))
+ getLogger().log(DEBUG, "Executing topic "+topic+" on resources
("+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() ;)
| <-- Date Index --> | <-- Thread Index --> |
Powered by MHonArc.
Copyright © 2006-2007, OW2 Consortium | contact | webmaster.