User: starksm
Date: 01/11/20 01:42:56
Modified: src/main/org/jboss/tm Tag: Branch_2_4
TransactionManagerService.java TxCapsule.java
TxManager.java
Log:
Change to the unified log4j based org.jboss.logging.Logger class.
Revision Changes Path
No revision
No revision
1.11.4.1 +3 -5 jboss/src/main/org/jboss/tm/TransactionManagerService.java
Index: TransactionManagerService.java
===================================================================
RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/tm/TransactionManagerService.java,v
retrieving revision 1.11
retrieving revision 1.11.4.1
diff -u -r1.11 -r1.11.4.1
--- TransactionManagerService.java 2001/05/08 07:22:06 1.11
+++ TransactionManagerService.java 2001/11/20 09:42:56 1.11.4.1
@@ -24,10 +24,8 @@
import javax.management.MBeanServer;
import javax.management.ObjectName;
-
import javax.transaction.TransactionManager;
-import org.jboss.logging.Log;
import org.jboss.util.ServiceMBeanSupport;
/**
@@ -38,7 +36,7 @@
* @author Rickard �berg ([EMAIL PROTECTED])
* @author <a href="mailto:[EMAIL PROTECTED]">Ole Husgaard</a>
* @author Toby Allsopp ([EMAIL PROTECTED])
- * @version $Revision: 1.11 $
+ * @version $Revision: 1.11.4.1 $
*/
public class TransactionManagerService
extends ServiceMBeanSupport
@@ -79,7 +77,7 @@
{
// Initialize the Xid constructor.
if (xidClassName != null) {
- log.log("Using Xid class '" + xidClassName + "'");
+ log.info("Using Xid class '" + xidClassName + "'");
Class cls = Class.forName(xidClassName);
TxCapsule.xidConstructor = cls.getConstructor(
@@ -111,7 +109,7 @@
ctx.unbind(JNDI_IMPORTER);
ctx.unbind(JNDI_EXPORTER);
} catch (Exception e) {
- log.exception(e);
+ log.error("stopService error", e);
}
}
1.27.4.1 +60 -59 jboss/src/main/org/jboss/tm/TxCapsule.java
Index: TxCapsule.java
===================================================================
RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/tm/TxCapsule.java,v
retrieving revision 1.27
retrieving revision 1.27.4.1
diff -u -r1.27 -r1.27.4.1
--- TxCapsule.java 2001/05/08 07:22:06 1.27
+++ TxCapsule.java 2001/11/20 09:42:56 1.27.4.1
@@ -49,10 +49,11 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Ole Husgaard</a>
* @author Toby Allsopp ([EMAIL PROTECTED])
*
- * @version $Revision: 1.27 $
+ * @version $Revision: 1.27.4.1 $
*/
class TxCapsule implements TimeoutTarget
{
+ private static Logger log = Logger.getLogger(TxCapsule.class);
// Constants -----------------------------------------------------
// Trace enabled flag
@@ -140,7 +141,7 @@
this.timeout = TimeoutFactory.createTimeout(start+timeout, this);
if (trace)
- Logger.debug("TxCapsule: Created new instance for tx=" + toString());
+ log.debug("TxCapsule: Created new instance for tx=" + toString());
}
/**
@@ -166,7 +167,7 @@
this.timeout = TimeoutFactory.createTimeout(start+timeout, this);
if (trace)
- Logger.debug("TxCapsule: Reused instance for tx=" + toString());
+ log.debug("TxCapsule: Reused instance for tx=" + toString());
}
// Public --------------------------------------------------------
@@ -179,7 +180,7 @@
try {
lock();
- Logger.warning("Transaction " + toString() + " timed out." +
+ log.warn("Transaction " + toString() + " timed out." +
" status=" + getStringStatus(status));
if (this.timeout == null)
@@ -221,7 +222,7 @@
return; // commit will fail
default:
- Logger.warning("TxCapsule: Unknown status at timeout, tx=" +
+ log.warn("TxCapsule: Unknown status at timeout, tx=" +
toString());
return;
}
@@ -262,7 +263,7 @@
lock();
if (trace)
- Logger.debug("TxCapsule.commit(): Entered, tx=" + toString() +
+ log.debug("TxCapsule.commit(): Entered, tx=" + toString() +
" status=" + getStringStatus(status));
switch (status) {
@@ -304,7 +305,7 @@
doBeforeCompletion();
if (trace)
- Logger.debug("TxCapsule.commit(): Before completion done, " +
+ log.debug("TxCapsule.commit(): Before completion done, " +
"tx=" + toString() +
" status=" + getStringStatus(status));
@@ -314,17 +315,17 @@
if (resourceCount == 0) {
// Zero phase commit is really fast ;-)
if (trace)
- Logger.debug("TxCapsule.commit(): No resources.");
+ log.debug("TxCapsule.commit(): No resources.");
status = Status.STATUS_COMMITTED;
} else if (resourceCount == 1) {
// One phase commit
if (trace)
- Logger.debug("TxCapsule.commit(): One resource.");
+ log.debug("TxCapsule.commit(): One resource.");
commitResources(true);
} else {
// Two phase commit
if (trace)
- Logger.debug("TxCapsule.commit(): Many resources.");
+ log.debug("TxCapsule.commit(): Many resources.");
if (!prepareResources()) {
boolean commitDecision =
@@ -357,7 +358,7 @@
checkHeuristics();
if (trace)
- Logger.debug("TxCapsule.commit(): Transaction " + toString() +
+ log.debug("TxCapsule.commit(): Transaction " + toString() +
" committed OK.");
} finally {
@@ -383,7 +384,7 @@
lock();
if (trace)
- Logger.debug("TxCapsule.rollback(): Entered, tx=" + toString() +
+ log.debug("TxCapsule.rollback(): Entered, tx=" + toString() +
" status=" + getStringStatus(status));
switch (status) {
@@ -432,7 +433,7 @@
lock();
if (trace)
- Logger.debug("TxCapsule.setRollbackOnly(): Entered, tx=" +
+ log.debug("TxCapsule.setRollbackOnly(): Entered, tx=" +
toString() + " status=" + getStringStatus(status));
switch (status) {
@@ -487,7 +488,7 @@
lock();
if (trace)
- Logger.debug("TxCapsule.delistResource(): Entered, tx=" +
+ log.debug("TxCapsule.delistResource(): Entered, tx=" +
toString() + " status=" + getStringStatus(status));
int idx = findResource(xaRes);
@@ -523,9 +524,9 @@
endResource(idx, flag);
return true;
} catch(XAException e) {
- Logger.warning("XAException: tx=" + toString() + " errorCode=" +
- getStringXAErrorCode(e.errorCode));
- Logger.exception(e);
+ String msg = "XAException: tx=" + toString() + " errorCode=" +
+ getStringXAErrorCode(e.errorCode);
+ log.warn(msg, e);
status = Status.STATUS_MARKED_ROLLBACK;
return false;
}
@@ -553,7 +554,7 @@
lock();
if (trace)
- Logger.debug("TxCapsule.enlistResource(): Entered, tx=" +
+ log.debug("TxCapsule.enlistResource(): Entered, tx=" +
toString() + " status=" + getStringStatus(status));
switch (status) {
@@ -614,9 +615,9 @@
startResource(addResource(xaRes, createXidBranch(), -1));
return true;
} catch(XAException e) {
- Logger.warning("XAException: tx=" + toString() + " errorCode=" +
- getStringXAErrorCode(e.errorCode));
- Logger.exception(e);
+ String msg = "XAException: tx=" + toString() + " errorCode=" +
+ getStringXAErrorCode(e.errorCode);
+ log.warn(msg, e);
return false;
}
} finally {
@@ -649,7 +650,7 @@
lock();
if (trace)
- Logger.debug("TxCapsule.registerSynchronization(): Entered, " +
+ log.debug("TxCapsule.registerSynchronization(): Entered, " +
"tx=" + toString() +
" status=" + getStringStatus(status));
@@ -672,7 +673,7 @@
throw new RollbackException("Already marked for rollback");
else {
// Workaround for EntitySynchronizationInterceptor bug.
- Logger.warning("TxCapsule: Violating JTA by adding synchronization to a
transaction marked for rollback.");
+ log.warn("TxCapsule: Violating JTA by adding synchronization to a
transaction marked for rollback.");
break;
}
case Status.STATUS_ROLLING_BACK:
@@ -936,7 +937,7 @@
throw new IllegalStateException("Transaction has terminated");
if (locked) {
- Logger.warning("TxCapsule: Lock contention, tx=" + toString());
+ log.warn("TxCapsule: Lock contention, tx=" + toString());
//DEBUG Thread.currentThread().dumpStack();
long myIncarnation = incarnationCount;
@@ -963,9 +964,9 @@
private synchronized void unlock()
{
if (!locked) {
- Logger.warning("TxCapsule: Unlocking, but not locked, tx=" +
- toString());
- Logger.exception(new Exception("[Stack trace]"));
+ String msg = "TxCapsule: Unlocking, but not locked, tx=" +
+ toString();
+ log.warn(msg, new Exception("[Stack trace]"));
}
locked = false;
@@ -985,7 +986,7 @@
timeout.cancel();
} catch (Exception e)
{
- Logger.debug(e);
+ log.debug(e);
} finally {
lock();
}
@@ -1075,7 +1076,7 @@
}
if (trace)
- Logger.debug("TxCapsule.startResource(" +
+ log.debug("TxCapsule.startResource(" +
XidImpl.toString(resourceXids[idx]) +
") entered: " + resources[idx].toString() +
" flags=" + flags);
@@ -1089,7 +1090,7 @@
throw e;
} catch (Throwable t) {
if (trace)
- Logger.exception(t);
+ log.error(t);
status = Status.STATUS_MARKED_ROLLBACK;
return;
}
@@ -1099,7 +1100,7 @@
} finally {
lock();
if (trace)
- Logger.debug("TxCapsule.startResource(" +
+ log.debug("TxCapsule.startResource(" +
XidImpl.toString(resourceXids[idx]) +
") leaving: " + resources[idx].toString() +
" flags=" + flags);
@@ -1118,7 +1119,7 @@
throws XAException
{
if (trace)
- Logger.debug("TxCapsule.endResource(" +
+ log.debug("TxCapsule.endResource(" +
XidImpl.toString(resourceXids[idx]) +
") entered: " + resources[idx].toString() +
" flag=" + flag);
@@ -1131,7 +1132,7 @@
throw e;
} catch (Throwable t) {
if (trace)
- Logger.exception(t);
+ log.error(t);
status = Status.STATUS_MARKED_ROLLBACK;
// Resource may or may not be ended after illegal exception.
// We just assume it ended.
@@ -1151,7 +1152,7 @@
} finally {
lock();
if (trace)
- Logger.debug("TxCapsule.endResource(" +
+ log.debug("TxCapsule.endResource(" +
XidImpl.toString(resourceXids[idx]) +
") leaving: " + resources[idx].toString() +
" flag=" + flag);
@@ -1182,14 +1183,14 @@
}
if (resourceState[idx] == RS_ENLISTED) {
if (trace)
- Logger.debug("endresources(" + idx + "): state=" +
+ log.debug("endresources(" + idx + "): state=" +
resourceState[idx]);
endResource(idx, XAResource.TMSUCCESS);
}
} catch(XAException e) {
- Logger.warning("XAException: tx=" + toString() + " errorCode=" +
- getStringXAErrorCode(e.errorCode));
- Logger.exception(e);
+ String msg = "XAException: tx=" + toString() + " errorCode=" +
+ getStringXAErrorCode(e.errorCode);
+ log.warn(msg, e);
status = Status.STATUS_MARKED_ROLLBACK;
}
}
@@ -1210,7 +1211,7 @@
sync[i].beforeCompletion();
} catch (Throwable t) {
if (trace)
- Logger.exception(t);
+ log.error(t);
status = Status.STATUS_MARKED_ROLLBACK;
break;
}
@@ -1234,7 +1235,7 @@
sync[i].afterCompletion(status);
} catch (Throwable t) {
if (trace)
- Logger.exception(t);
+ log.error(t);
}
}
} finally {
@@ -1291,9 +1292,9 @@
unlock();
resources[resIdx].forget(resourceXids[resIdx]);
} catch (XAException e) {
- Logger.warning("XAException at forget(): errorCode=" +
- getStringXAErrorCode(e.errorCode));
- Logger.exception(e);
+ String msg = "XAException at forget(): errorCode=" +
+ getStringXAErrorCode(e.errorCode);
+ log.warn(msg, e);
} finally {
lock();
}
@@ -1312,13 +1313,13 @@
case XAException.XA_HEURMIX:
heuristicCode = HEUR_NONE;
if (trace)
- Logger.debug("TxCapsule: Throwing HeuristicMixedException, " +
+ log.debug("TxCapsule: Throwing HeuristicMixedException, " +
"status=" + getStringStatus(status));
throw new HeuristicMixedException();
case XAException.XA_HEURRB:
heuristicCode = HEUR_NONE;
if (trace)
- Logger.debug("TxCapsule: Throwing HeuristicRollbackException, " +
+ log.debug("TxCapsule: Throwing HeuristicRollbackException, " +
"status=" + getStringStatus(status));
throw new HeuristicRollbackException();
case XAException.XA_HEURCOM:
@@ -1328,7 +1329,7 @@
// For now we just have to ignore this failure, even if it happened
// on rollback.
if (trace)
- Logger.debug("TxCapsule: NOT Throwing HeuristicCommitException, " +
+ log.debug("TxCapsule: NOT Throwing HeuristicCommitException, " +
"status=" + getStringStatus(status));
return;
}
@@ -1439,16 +1440,16 @@
status = Status.STATUS_MARKED_ROLLBACK;
break;
default:
- Logger.warning("XAException: tx=" + toString() + " errorCode=" +
- getStringXAErrorCode(e.errorCode));
- Logger.exception(e);
+ String msg = "XAException: tx=" + toString() + " errorCode=" +
+ getStringXAErrorCode(e.errorCode);
+ log.warn(msg, e);
if (status == Status.STATUS_PREPARING)
status = Status.STATUS_MARKED_ROLLBACK;
break;
}
} catch (Throwable t) {
if (trace)
- Logger.exception(t);
+ log.error(t);
if (status == Status.STATUS_PREPARING)
status = Status.STATUS_MARKED_ROLLBACK;
}
@@ -1470,7 +1471,7 @@
for (int i = 0; i < resourceCount; i++) {
if (trace)
- Logger.debug("TxCapsule.commitResources(): " +
+ log.debug("TxCapsule.commitResources(): " +
"resourceStates["+i+"]="+resourceState[i]);
if (!onePhase && resourceState[i] != RS_VOTE_OK)
@@ -1499,9 +1500,9 @@
gotHeuristic(i, e.errorCode);
break;
default:
- Logger.warning("XAException: tx=" + toString() + " errorCode=" +
- getStringXAErrorCode(e.errorCode));
- Logger.exception(e);
+ String msg = "XAException: tx=" + toString() + " errorCode=" +
+ getStringXAErrorCode(e.errorCode);
+ log.warn(msg, e);
break;
}
try {
@@ -1513,7 +1514,7 @@
} catch (XAException forgetEx) {}
} catch (Throwable t) {
if (trace)
- Logger.exception(t);
+ log.error(t);
}
}
@@ -1552,9 +1553,9 @@
gotHeuristic(i, e.errorCode);
break;
default:
- Logger.warning("XAException: tx=" + toString() + " errorCode=" +
- getStringXAErrorCode(e.errorCode));
- Logger.exception(e);
+ String msg = "XAException: tx=" + toString() + " errorCode=" +
+ getStringXAErrorCode(e.errorCode);
+ log.warn(msg, e);
break;
}
try {
@@ -1566,7 +1567,7 @@
} catch (XAException forgetEx) {}
} catch (Throwable t) {
if (trace)
- Logger.exception(t);
+ log.error(t);
}
}
1.28.4.2 +3 -2 jboss/src/main/org/jboss/tm/TxManager.java
Index: TxManager.java
===================================================================
RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/tm/TxManager.java,v
retrieving revision 1.28.4.1
retrieving revision 1.28.4.2
diff -u -r1.28.4.1 -r1.28.4.2
--- TxManager.java 2001/09/26 21:50:41 1.28.4.1
+++ TxManager.java 2001/11/20 09:42:56 1.28.4.2
@@ -36,13 +36,14 @@
* @author Rickard �berg ([EMAIL PROTECTED])
* @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Ole Husgaard</a>
- * @version $Revision: 1.28.4.1 $
+ * @version $Revision: 1.28.4.2 $
*/
public class TxManager
implements TransactionManager,
TransactionPropagationContextImporter,
TransactionPropagationContextFactory
{
+ private static Logger log = Logger.getLogger(TxManager.class);
// Constants -----------------------------------------------------
// Attributes ----------------------------------------------------
@@ -314,7 +315,7 @@
if (tpc instanceof GlobalId)
return (Transaction)globalIdTx.get((GlobalId)tpc);
else {
- Logger.warning("Cannot import transaction propagation context: " +
+ log.warn("Cannot import transaction propagation context: " +
tpc.toString());
return null;
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development