[jboss-svn-commits] JBL Code SVN: r30037 - in labs/jbosstm/trunk: ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator and 11 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu Nov 5 16:46:50 EST 2009
Author: mark.little at jboss.com
Date: 2009-11-05 16:46:49 -0500 (Thu, 05 Nov 2009)
New Revision: 30037
Added:
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/RecoveryRecord.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/abstractrecord/
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/abstractrecords/LastResourceRecord.java
Removed:
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/LastResourceRecord.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/RecoveryRecord.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/record/
Modified:
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/AbstractRecord.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/RecordType.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/abstractrecord/RecordTypeManager.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/abstractrecord/RecordTypeMap.java
labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/atomicaction/LastResource.java
labs/jbosstm/trunk/ArjunaCore/txoj/classes/com/arjuna/ats/internal/txoj/Implementations.java
labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/Implementations.java
labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/transaction/arjunacore/TransactionImple.java
labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/Implementationsx.java
labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/Implementations.java
labs/jbosstm/trunk/XTS/recovery/src/org/jboss/jbossts/xts/recovery/coordinator/at/Implementations.java
labs/jbosstm/trunk/XTS/recovery/src/org/jboss/jbossts/xts/recovery/coordinator/ba/Implementations.java
labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/ArjunaCore/AbstractRecord/CrashRecovery/setup/AddUserDefFirst0.java
labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/ArjunaCore/AbstractRecord/CrashRecovery/setup/AddUserDefFirst1.java
Log:
https://jira.jboss.org/jira/browse/JBTM-639
Deleted: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/LastResourceRecord.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/LastResourceRecord.java 2009-11-05 21:36:20 UTC (rev 30036)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/LastResourceRecord.java 2009-11-05 21:46:49 UTC (rev 30037)
@@ -1,310 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * 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,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2004,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: LastResourceRecord.java 2342 2006-03-30 13:06:17Z $
- */
-
-package com.arjuna.ats.arjuna;
-
-import com.arjuna.ats.arjuna.logging.tsLogger;
-import com.arjuna.ats.arjuna.logging.FacilityCode;
-
-import com.arjuna.ats.arjuna.coordinator.*;
-import com.arjuna.ats.arjuna.common.*;
-
-import java.io.PrintWriter;
-
-import com.arjuna.common.util.logging.*;
-
-/**
- * AbstractRecord that helps us do the last resource commit optimization.
- * Basically this is something that is used to allow a *single* resource that is
- * only one-phase aware to be enlisted with a transaction that is usually
- * two-phase. The way it works is:
- *
- * (i) the coordinator runs its normal first (prepare) phase on all two-phase
- * aware participants and makes a decision based solely on their responses as to
- * whether to commit or roll back. Note, the one-phase aware resource
- * essentially returns voteCommit during prepare, to ensure that the second
- * phase runs even if all other resources return voteReadOnly.
- *
- * (ii) if the transaction is to commit then the coordinator invokes the second
- * phase on *all* participants, starting with the one that is only one-phase
- * aware. If it rolls back, it rolls all resources back, but the order is not
- * important.
- *
- * @author Mark Little (mark at arjuna.com)
- * @version $Id: LastResourceRecord.java 2342 2006-03-30 13:06:17Z $
- * @since ATS 3.2.
- */
-
-public class LastResourceRecord extends AbstractRecord
-{
-
- public LastResourceRecord (OnePhaseResource opr)
- {
- super(ONE_PHASE_RESOURCE_UID);
-
- if (tsLogger.arjLogger.isDebugEnabled())
- {
- tsLogger.arjLogger.debug(DebugLevel.CONSTRUCTORS, VisibilityLevel.VIS_PUBLIC, FacilityCode.FAC_ABSTRACT_REC, "LastResourceRecord()");
- }
-
- _lro = opr;
- }
-
- public boolean propagateOnCommit ()
- {
- return false;
- }
-
- public int typeIs ()
- {
- return RecordType.LASTRESOURCE;
- }
-
- public int nestedAbort ()
- {
- if (tsLogger.arjLogger.isDebugEnabled())
- {
- tsLogger.arjLogger.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC, FacilityCode.FAC_ABSTRACT_REC, "LastResourceRecord::nestedAbort() for "
- + order());
- }
-
- return TwoPhaseOutcome.FINISH_OK;
- }
-
- public int nestedCommit ()
- {
- if (tsLogger.arjLogger.isDebugEnabled())
- {
- tsLogger.arjLogger.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC, FacilityCode.FAC_ABSTRACT_REC, "LastResourceRecord::nestedCommit() for "
- + order());
- }
-
- return TwoPhaseOutcome.FINISH_ERROR;
- }
-
- /**
- * Not allowed to participate in nested transactions.
- */
-
- public int nestedPrepare ()
- {
- if (tsLogger.arjLogger.isDebugEnabled())
- {
- tsLogger.arjLogger.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC, FacilityCode.FAC_ABSTRACT_REC, "LastResourceRecord::nestedPrepare() for "
- + order());
- }
-
- return TwoPhaseOutcome.PREPARE_NOTOK;
- }
-
- public int topLevelAbort ()
- {
- if (tsLogger.arjLogger.isDebugEnabled())
- {
- tsLogger.arjLogger.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC, FacilityCode.FAC_ABSTRACT_REC, "LastResourceRecord::topLevelAbort() for "
- + order());
- }
-
- if (_lro != null)
- {
- return _lro.rollback() ;
- }
- else
- {
- return TwoPhaseOutcome.FINISH_OK;
- }
- }
-
- public int topLevelCommit ()
- {
- if (tsLogger.arjLogger.isDebugEnabled())
- {
- tsLogger.arjLogger.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC, FacilityCode.FAC_ABSTRACT_REC, "LastResourceRecord::topLevelCommit() for "
- + order());
- }
-
- return TwoPhaseOutcome.FINISH_OK;
- }
-
- public int topLevelPrepare ()
- {
- if (tsLogger.arjLogger.isDebugEnabled())
- {
- tsLogger.arjLogger.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC, FacilityCode.FAC_ABSTRACT_REC, "LastResourceRecord::topLevelPrepare() for "
- + order());
- }
-
- if ((_lro != null) && (_lro.commit() == TwoPhaseOutcome.FINISH_OK))
- {
- return TwoPhaseOutcome.PREPARE_OK;
- }
- else
- return TwoPhaseOutcome.PREPARE_NOTOK;
- }
-
- public void print (PrintWriter strm)
- {
- strm.println("LastResource for:");
- super.print(strm);
- }
-
- public String type ()
- {
- return "/StateManager/AbstractRecord/LastResourceRecord";
- }
-
- /**
- * @message com.arjuna.ats.arjuna.lastResource.multipleWarning
- * [com.arjuna.ats.arjuna.lastResource.multipleWarning]
- * Multiple last resources have been added to the current transaction.
- * This is transactionally unsafe and should not be relied upon.
- * Current resource is {0}
- * @message com.arjuna.ats.arjuna.lastResource.disallow
- * [com.arjuna.ats.arjuna.lastResource.disallow]
- * Adding multiple last resources is disallowed. Current resource is
- * {0}
- * @message com.arjuna.ats.arjuna.lastResource.startupWarning
- * [com.arjuna.ats.arjuna.lastResource.startupWarning]
- * You have chosen to enable multiple last resources in the transaction
- * manager. This is transactionally unsafe and should not be relied
- * upon.
- * @message com.arjuna.ats.arjuna.lastResource.disableWarning
- * [com.arjuna.ats.arjuna.lastResource.disableWarning]
- * You have chosen to disable the Multiple Last Resources warning. You will see it only once.
- */
- public boolean shouldAdd (AbstractRecord a)
- {
- if( a.typeIs() == typeIs() )
- {
- if(ALLOW_MULTIPLE_LAST_RESOURCES)
- {
- if (tsLogger.arjLoggerI18N.isWarnEnabled())
- {
- if (!_disableMLRWarning || (_disableMLRWarning && !_issuedWarning))
- {
- tsLogger.arjLoggerI18N.warn("com.arjuna.ats.arjuna.lastResource.multipleWarning",
- new Object[] { a });
- _issuedWarning = true;
- }
- }
-
- return true;
- }
- else
- {
- if (tsLogger.arjLoggerI18N.isWarnEnabled())
- {
- tsLogger.arjLoggerI18N.warn("com.arjuna.ats.arjuna.lastResource.disallow",
- new Object[] { a });
- }
-
- return false;
- }
- }
- else
- {
- return true;
- }
- }
-
- public boolean shouldMerge (AbstractRecord a)
- {
- return false;
- }
-
- public boolean shouldReplace (AbstractRecord a)
- {
- return false;
- }
-
- public boolean shouldAlter (AbstractRecord a)
- {
- return false;
- }
-
- public void merge (AbstractRecord a)
- {
- }
-
- public void alter (AbstractRecord a)
- {
- }
-
- /**
- * @return <code>Object</code> to be used to order.
- */
-
- public Object value ()
- {
- return _lro;
- }
-
- public void setValue (Object o)
- {
- }
-
- public LastResourceRecord ()
- {
- super();
-
- _lro = null;
- }
-
- private OnePhaseResource _lro;
-
- private static final Uid ONE_PHASE_RESOURCE_UID = Uid.lastResourceUid() ;
-
-
- private static final boolean ALLOW_MULTIPLE_LAST_RESOURCES;
-
- private static boolean _disableMLRWarning = false;
- private static boolean _issuedWarning = false;
-
- static
- {
- ALLOW_MULTIPLE_LAST_RESOURCES = arjPropertyManager.getCoreEnvironmentBean().isAllowMultipleLastResources();
-
- if (ALLOW_MULTIPLE_LAST_RESOURCES
- && tsLogger.arjLoggerI18N.isWarnEnabled())
- {
- tsLogger.arjLoggerI18N.warn("com.arjuna.ats.arjuna.lastResource.startupWarning");
- }
-
- _disableMLRWarning = arjPropertyManager.getCoreEnvironmentBean().isDisableMultipleLastResourcesWarning();
-
- if(arjPropertyManager.getCoreEnvironmentBean().isDisableMultipleLastResourcesWarning())
- {
- tsLogger.arjLoggerI18N.warn("com.arjuna.ats.arjuna.lastResource.disableWarning");
-
- _disableMLRWarning = true;
- }
- }
-}
Deleted: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/RecoveryRecord.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/RecoveryRecord.java 2009-11-05 21:36:20 UTC (rev 30036)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/RecoveryRecord.java 2009-11-05 21:46:49 UTC (rev 30037)
@@ -1,345 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * 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,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 1998, 1999, 2000,
- *
- * Arjuna Solutions Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: RecoveryRecord.java 2342 2006-03-30 13:06:17Z $
- */
-
-package com.arjuna.ats.arjuna;
-
-import com.arjuna.ats.arjuna.logging.tsLogger;
-import com.arjuna.ats.arjuna.logging.FacilityCode;
-
-import com.arjuna.common.util.logging.*;
-
-import com.arjuna.ats.arjuna.coordinator.*;
-import com.arjuna.ats.arjuna.state.*;
-import java.io.PrintWriter;
-
-public class RecoveryRecord extends AbstractRecord
-{
-
- /**
- * This constructor is used to create a new instance of a
- * RecoveryRecord.
- */
-
- public RecoveryRecord (OutputObjectState os, StateManager sm)
- {
- super(sm.get_uid(), sm.type(), ObjectType.ANDPERSISTENT);
-
- if (tsLogger.arjLogger.isDebugEnabled())
- {
- tsLogger.arjLogger.debug(DebugLevel.CONSTRUCTORS, VisibilityLevel.VIS_PUBLIC,
- FacilityCode.FAC_ABSTRACT_REC,
- "RecoveryRecord::RecoveryRecord("+os+", "+sm.get_uid()+")");
- }
-
- objectAddr = sm;
- state = os;
- actionHandle = BasicAction.Current();
- }
-
- public void finalize () throws Throwable
- {
- if (tsLogger.arjLogger.isDebugEnabled())
- {
- tsLogger.arjLogger.debug(DebugLevel.DESTRUCTORS, VisibilityLevel.VIS_PUBLIC,
- FacilityCode.FAC_ABSTRACT_REC, "RecoveryRecord.finalize() for "+order() + " type " + type());
- }
- super.finalize();
- }
-
- public int typeIs ()
- {
- return RecordType.RECOVERY;
- }
-
- public Object value ()
- {
- return state;
- }
-
- /**
- * @message com.arjuna.ats.arjuna.RecoveryRecord_1 [com.arjuna.ats.arjuna.RecoveryRecord_1] - RecoveryRecord::setValue not given OutputObjectState.
- */
-
- public void setValue (Object newState)
- {
- if (newState instanceof OutputObjectState)
- state = (OutputObjectState) newState;
- else
- {
- if (tsLogger.arjLoggerI18N.isWarnEnabled())
- tsLogger.arjLoggerI18N.warn("com.arjuna.ats.arjuna.RecoveryRecord_1");
- }
- }
-
- /**
- * nestedAbort causes the restore_state function of the object to be
- * invoked passing it the saved ObjectState.
- *
- * @message com.arjuna.ats.arjuna.RecoveryRecord_2 [com.arjuna.ats.arjuna.RecoveryRecord_2] - RecoveryRecord::nestedAbort - restore_state on object failed!
- */
-
-public int nestedAbort ()
- {
- if (tsLogger.arjLogger.isDebugEnabled())
- {
- tsLogger.arjLogger.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC,
- FacilityCode.FAC_ABSTRACT_REC, "RecoveryRecord::nestedAbort() for "+order());
- }
-
- /*
- * First check that we have a state. We won't have for records
- * created by crash recovery.
- */
-
- forgetAction(false);
-
- if (state != null)
- {
- if (state.notempty()) /* anything to restore ? */
- {
- InputObjectState oldState = new InputObjectState(state);
-
- int result = objectAddr.restore_state(oldState, ObjectType.RECOVERABLE) ? TwoPhaseOutcome.FINISH_OK : TwoPhaseOutcome.FINISH_ERROR;
-
- if (result == TwoPhaseOutcome.FINISH_ERROR)
- {
- if (tsLogger.arjLoggerI18N.isWarnEnabled())
- tsLogger.arjLoggerI18N.warn("com.arjuna.ats.arjuna.RecoveryRecord_2");
- }
-
- return result;
- }
- }
-
- return TwoPhaseOutcome.FINISH_OK;
- }
-
- /**
- * nestedCommit does nothing since the passing of the state up to
- * the parent action is handled by the record list merging system.
- * In fact since nestedPrepare returns PREPARE_READONLY this function
- * should never actaully be called
- */
-
- public int nestedCommit ()
- {
- if (tsLogger.arjLogger.isDebugEnabled())
- {
- tsLogger.arjLogger.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC,
- FacilityCode.FAC_ABSTRACT_REC, "RecoveryRecord::nestedCommit() for "+order());
- }
-
- return TwoPhaseOutcome.FINISH_OK;
- }
-
- public int nestedPrepare ()
- {
- if (tsLogger.arjLogger.isDebugEnabled())
- {
- tsLogger.arjLogger.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC,
- FacilityCode.FAC_ABSTRACT_REC, "RecoveryRecord::nestedPrepare() for "+order());
- }
-
- forgetAction(true);
-
- return TwoPhaseOutcome.PREPARE_READONLY;
- }
-
- /**
- * topLevelAbort for Recovery records implies the object state
- * should be restored to the saved state exactly like a nested
- * abort.
- */
-
- public int topLevelAbort ()
- {
- if (tsLogger.arjLogger.isDebugEnabled())
- {
- tsLogger.arjLogger.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC,
- FacilityCode.FAC_ABSTRACT_REC,
- "RecoveryRecord::topLevelAbort() for "+order());
- }
-
- return nestedAbort(); /* i.e., same as nested case */
- }
-
- /**
- * topLevelCommit has nothing to do for RecoveryRecords as no changes
- * have been made in the object store. In fact since topLevelPrepare
- * returns PREPARE_READONLY this function should never actually be called
- */
-
- public int topLevelCommit ()
- {
- if (tsLogger.arjLogger.isDebugEnabled())
- {
- tsLogger.arjLogger.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC,
- FacilityCode.FAC_ABSTRACT_REC,
- "RecoveryRecord::topLevelCommit() for "+order());
- }
-
- forgetAction(true);
-
- return TwoPhaseOutcome.FINISH_OK;
- }
-
- /**
- * topLevelPrepare can return PREPARE_READONLY to avoid topLevelCommit
- * being called in the action commit case
- */
-
- public int topLevelPrepare ()
- {
- if (tsLogger.arjLogger.isDebugEnabled())
- {
- tsLogger.arjLogger.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC,
- FacilityCode.FAC_ABSTRACT_REC,
- "RecoveryRecord::topLevelPrepare() for "+order());
- }
-
- return TwoPhaseOutcome.PREPARE_READONLY;
- }
-
- /*
- * Saving of RecoveryRecords is only undertaken during the Prepare
- * phase of the top level 2PC. Since the managed objects are only
- * recoverable (not persistent) there is no need to save any
- * information (or restore any either).
- * However, persistence records (derived from recovery records) need
- * to be saved for crash recovery purposes.
- */
-
- public boolean doSave ()
- {
- return false;
- }
-
- public boolean restore_state (InputObjectState os, int ot)
- {
- return super.restore_state(os, ot);
- }
-
- public boolean save_state (OutputObjectState os, int ot)
- {
- return super.save_state(os, ot);
- }
-
- public void print (PrintWriter strm)
- {
- super.print(strm);
- strm.println("RecoveryRecord with state:\n"+state);
- }
-
- public String type ()
- {
- return "/StateManager/AbstractRecord/RecoveryRecord";
- }
-
- public void merge (AbstractRecord a)
- {
- }
-
- public void alter (AbstractRecord a)
- {
- }
-
- /*
- * should_merge and should_replace are invoked by the record list manager
- * to determine if two records should be merged togethor or if the
- * 'newer' should replace the older.
- * shouldAdd determines if the new record should be added in addition
- * to the existing record and is currently only invoked if both of
- * should_merge and should_replace return false
- * Default implementations here always return false - ie new records
- * do not override old.
- */
-
- public boolean shouldAdd (AbstractRecord a)
- {
- return false;
- }
-
- public boolean shouldAlter (AbstractRecord a)
- {
- return false;
- }
-
- public boolean shouldMerge (AbstractRecord a)
- {
- return false;
- }
-
- public boolean shouldReplace (AbstractRecord a)
- {
- return false;
- }
-
- /*
- * Creates a 'blank' recovery record. This is used during crash recovery
- * when recreating the prepared list of a server atomic action.
- */
-
- public RecoveryRecord ()
- {
- super();
-
- if (tsLogger.arjLogger.isDebugEnabled())
- {
- tsLogger.arjLogger.debug(DebugLevel.CONSTRUCTORS, VisibilityLevel.VIS_PROTECTED,
- FacilityCode.FAC_ABSTRACT_REC, "RecoveryRecord::RecoveryRecord()"
- +" - crash recovery constructor");
- }
-
- objectAddr = null;
- state = null;
- actionHandle = null;
- }
-
- /*
- * Can we use this to force our parent to "remember" us when we commit, and
- * prevent the system from creating another record in that action?
- */
-
- protected final void forgetAction (boolean commit)
- {
- if ((actionHandle != null) && (objectAddr != null))
- {
- objectAddr.forgetAction(actionHandle, commit, RecordType.RECOVERY);
- actionHandle = null; // only do this once!
- }
- }
-
- protected StateManager objectAddr;
- protected OutputObjectState state;
-
- private BasicAction actionHandle;
-
-}
Added: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/RecoveryRecord.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/RecoveryRecord.java (rev 0)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/RecoveryRecord.java 2009-11-05 21:46:49 UTC (rev 30037)
@@ -0,0 +1,358 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 1998, 1999, 2000,
+ *
+ * Arjuna Solutions Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: RecoveryRecord.java 2342 2006-03-30 13:06:17Z $
+ */
+
+package com.arjuna.ats.arjuna;
+
+import com.arjuna.ats.arjuna.logging.tsLogger;
+import com.arjuna.ats.arjuna.logging.FacilityCode;
+
+import com.arjuna.common.util.logging.*;
+
+import com.arjuna.ats.arjuna.coordinator.*;
+import com.arjuna.ats.arjuna.state.*;
+import java.io.PrintWriter;
+
+public class RecoveryRecord extends AbstractRecord
+{
+
+ /**
+ * This constructor is used to create a new instance of a RecoveryRecord.
+ */
+
+ public RecoveryRecord(OutputObjectState os, StateManager sm)
+ {
+ super(sm.get_uid(), sm.type(), ObjectType.ANDPERSISTENT);
+
+ if (tsLogger.arjLogger.isDebugEnabled())
+ {
+ tsLogger.arjLogger.debug(DebugLevel.CONSTRUCTORS,
+ VisibilityLevel.VIS_PUBLIC, FacilityCode.FAC_ABSTRACT_REC,
+ "RecoveryRecord::RecoveryRecord(" + os + ", "
+ + sm.get_uid() + ")");
+ }
+
+ objectAddr = sm;
+ state = os;
+ actionHandle = BasicAction.Current();
+ }
+
+ public void finalize () throws Throwable
+ {
+ if (tsLogger.arjLogger.isDebugEnabled())
+ {
+ tsLogger.arjLogger.debug(DebugLevel.DESTRUCTORS,
+ VisibilityLevel.VIS_PUBLIC, FacilityCode.FAC_ABSTRACT_REC,
+ "RecoveryRecord.finalize() for " + order() + " type "
+ + type());
+ }
+ super.finalize();
+ }
+
+ public int typeIs ()
+ {
+ return RecordType.RECOVERY;
+ }
+
+ public Object value ()
+ {
+ return state;
+ }
+
+ /**
+ * @message com.arjuna.ats.arjuna.RecoveryRecord_1
+ * [com.arjuna.ats.arjuna.RecoveryRecord_1] -
+ * RecoveryRecord::setValue not given OutputObjectState.
+ */
+
+ public void setValue (Object newState)
+ {
+ if (newState instanceof OutputObjectState)
+ state = (OutputObjectState) newState;
+ else
+ {
+ if (tsLogger.arjLoggerI18N.isWarnEnabled())
+ tsLogger.arjLoggerI18N
+ .warn("com.arjuna.ats.arjuna.RecoveryRecord_1");
+ }
+ }
+
+ /**
+ * nestedAbort causes the restore_state function of the object to be invoked
+ * passing it the saved ObjectState.
+ *
+ * @message com.arjuna.ats.arjuna.RecoveryRecord_2
+ * [com.arjuna.ats.arjuna.RecoveryRecord_2] -
+ * RecoveryRecord::nestedAbort - restore_state on object failed!
+ */
+
+ public int nestedAbort ()
+ {
+ if (tsLogger.arjLogger.isDebugEnabled())
+ {
+ tsLogger.arjLogger.debug(DebugLevel.FUNCTIONS,
+ VisibilityLevel.VIS_PUBLIC, FacilityCode.FAC_ABSTRACT_REC,
+ "RecoveryRecord::nestedAbort() for " + order());
+ }
+
+ /*
+ * First check that we have a state. We won't have for records created
+ * by crash recovery.
+ */
+
+ forgetAction(false);
+
+ if (state != null)
+ {
+ if (state.notempty()) /* anything to restore ? */
+ {
+ InputObjectState oldState = new InputObjectState(state);
+
+ int result = objectAddr.restore_state(oldState,
+ ObjectType.RECOVERABLE) ? TwoPhaseOutcome.FINISH_OK
+ : TwoPhaseOutcome.FINISH_ERROR;
+
+ if (result == TwoPhaseOutcome.FINISH_ERROR)
+ {
+ if (tsLogger.arjLoggerI18N.isWarnEnabled())
+ tsLogger.arjLoggerI18N
+ .warn("com.arjuna.ats.arjuna.RecoveryRecord_2");
+ }
+
+ return result;
+ }
+ }
+
+ return TwoPhaseOutcome.FINISH_OK;
+ }
+
+ /**
+ * nestedCommit does nothing since the passing of the state up to the parent
+ * action is handled by the record list merging system. In fact since
+ * nestedPrepare returns PREPARE_READONLY this function should never
+ * actaully be called
+ */
+
+ public int nestedCommit ()
+ {
+ if (tsLogger.arjLogger.isDebugEnabled())
+ {
+ tsLogger.arjLogger.debug(DebugLevel.FUNCTIONS,
+ VisibilityLevel.VIS_PUBLIC, FacilityCode.FAC_ABSTRACT_REC,
+ "RecoveryRecord::nestedCommit() for " + order());
+ }
+
+ return TwoPhaseOutcome.FINISH_OK;
+ }
+
+ public int nestedPrepare ()
+ {
+ if (tsLogger.arjLogger.isDebugEnabled())
+ {
+ tsLogger.arjLogger.debug(DebugLevel.FUNCTIONS,
+ VisibilityLevel.VIS_PUBLIC, FacilityCode.FAC_ABSTRACT_REC,
+ "RecoveryRecord::nestedPrepare() for " + order());
+ }
+
+ forgetAction(true);
+
+ return TwoPhaseOutcome.PREPARE_READONLY;
+ }
+
+ /**
+ * topLevelAbort for Recovery records implies the object state should be
+ * restored to the saved state exactly like a nested abort.
+ */
+
+ public int topLevelAbort ()
+ {
+ if (tsLogger.arjLogger.isDebugEnabled())
+ {
+ tsLogger.arjLogger.debug(DebugLevel.FUNCTIONS,
+ VisibilityLevel.VIS_PUBLIC, FacilityCode.FAC_ABSTRACT_REC,
+ "RecoveryRecord::topLevelAbort() for " + order());
+ }
+
+ return nestedAbort(); /* i.e., same as nested case */
+ }
+
+ /**
+ * topLevelCommit has nothing to do for RecoveryRecords as no changes have
+ * been made in the object store. In fact since topLevelPrepare returns
+ * PREPARE_READONLY this function should never actually be called
+ */
+
+ public int topLevelCommit ()
+ {
+ if (tsLogger.arjLogger.isDebugEnabled())
+ {
+ tsLogger.arjLogger.debug(DebugLevel.FUNCTIONS,
+ VisibilityLevel.VIS_PUBLIC, FacilityCode.FAC_ABSTRACT_REC,
+ "RecoveryRecord::topLevelCommit() for " + order());
+ }
+
+ forgetAction(true);
+
+ return TwoPhaseOutcome.FINISH_OK;
+ }
+
+ /**
+ * topLevelPrepare can return PREPARE_READONLY to avoid topLevelCommit being
+ * called in the action commit case
+ */
+
+ public int topLevelPrepare ()
+ {
+ if (tsLogger.arjLogger.isDebugEnabled())
+ {
+ tsLogger.arjLogger.debug(DebugLevel.FUNCTIONS,
+ VisibilityLevel.VIS_PUBLIC, FacilityCode.FAC_ABSTRACT_REC,
+ "RecoveryRecord::topLevelPrepare() for " + order());
+ }
+
+ return TwoPhaseOutcome.PREPARE_READONLY;
+ }
+
+ /*
+ * Saving of RecoveryRecords is only undertaken during the Prepare phase of
+ * the top level 2PC. Since the managed objects are only recoverable (not
+ * persistent) there is no need to save any information (or restore any
+ * either). However, persistence records (derived from recovery records)
+ * need to be saved for crash recovery purposes.
+ */
+
+ public boolean doSave ()
+ {
+ return false;
+ }
+
+ public boolean restore_state (InputObjectState os, int ot)
+ {
+ return super.restore_state(os, ot);
+ }
+
+ public boolean save_state (OutputObjectState os, int ot)
+ {
+ return super.save_state(os, ot);
+ }
+
+ public void print (PrintWriter strm)
+ {
+ super.print(strm);
+ strm.println("RecoveryRecord with state:\n" + state);
+ }
+
+ public String type ()
+ {
+ return "/StateManager/AbstractRecord/RecoveryRecord";
+ }
+
+ public void merge (AbstractRecord a)
+ {
+ }
+
+ public void alter (AbstractRecord a)
+ {
+ }
+
+ /*
+ * should_merge and should_replace are invoked by the record list manager to
+ * determine if two records should be merged togethor or if the 'newer'
+ * should replace the older. shouldAdd determines if the new record should
+ * be added in addition to the existing record and is currently only invoked
+ * if both of should_merge and should_replace return false Default
+ * implementations here always return false - ie new records do not override
+ * old.
+ */
+
+ public boolean shouldAdd (AbstractRecord a)
+ {
+ return false;
+ }
+
+ public boolean shouldAlter (AbstractRecord a)
+ {
+ return false;
+ }
+
+ public boolean shouldMerge (AbstractRecord a)
+ {
+ return false;
+ }
+
+ public boolean shouldReplace (AbstractRecord a)
+ {
+ return false;
+ }
+
+ /*
+ * Creates a 'blank' recovery record. This is used during crash recovery
+ * when recreating the prepared list of a server atomic action.
+ */
+
+ public RecoveryRecord()
+ {
+ super();
+
+ if (tsLogger.arjLogger.isDebugEnabled())
+ {
+ tsLogger.arjLogger.debug(DebugLevel.CONSTRUCTORS,
+ VisibilityLevel.VIS_PROTECTED,
+ FacilityCode.FAC_ABSTRACT_REC,
+ "RecoveryRecord::RecoveryRecord()"
+ + " - crash recovery constructor");
+ }
+
+ objectAddr = null;
+ state = null;
+ actionHandle = null;
+ }
+
+ /*
+ * Can we use this to force our parent to "remember" us when we commit, and
+ * prevent the system from creating another record in that action?
+ */
+
+ protected final void forgetAction (boolean commit)
+ {
+ if ((actionHandle != null) && (objectAddr != null))
+ {
+ objectAddr.forgetAction(actionHandle, commit, RecordType.RECOVERY);
+ actionHandle = null; // only do this once!
+ }
+ }
+
+ protected StateManager objectAddr;
+
+ protected OutputObjectState state;
+
+ private BasicAction actionHandle;
+
+}
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/AbstractRecord.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/AbstractRecord.java 2009-11-05 21:36:20 UTC (rev 30036)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/AbstractRecord.java 2009-11-05 21:46:49 UTC (rev 30037)
@@ -33,7 +33,7 @@
import com.arjuna.ats.arjuna.StateManager;
import com.arjuna.ats.arjuna.common.*;
-import com.arjuna.ats.arjuna.coordinator.record.RecordTypeManager;
+import com.arjuna.ats.arjuna.coordinator.abstractrecord.RecordTypeManager;
import com.arjuna.ats.arjuna.state.*;
import com.arjuna.common.util.logging.*;
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/RecordType.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/RecordType.java 2009-11-05 21:36:20 UTC (rev 30036)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/RecordType.java 2009-11-05 21:46:49 UTC (rev 30037)
@@ -33,14 +33,14 @@
import java.io.*;
-import com.arjuna.ats.arjuna.coordinator.record.RecordTypeManager;
+import com.arjuna.ats.arjuna.coordinator.abstractrecord.RecordTypeManager;
import com.arjuna.ats.arjuna.ActivationRecord;
import com.arjuna.ats.arjuna.DisposeRecord;
-import com.arjuna.ats.arjuna.LastResourceRecord;
import com.arjuna.ats.arjuna.PersistenceRecord;
import com.arjuna.ats.arjuna.RecoveryRecord;
import com.arjuna.ats.internal.arjuna.TxLogWritePersistenceRecord;
import com.arjuna.ats.internal.arjuna.abstractrecords.CadaverRecord;
+import com.arjuna.ats.internal.arjuna.abstractrecords.LastResourceRecord;
/**
* The following enumerated type defines the types of record that are derived
Copied: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/abstractrecord (from rev 30034, labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/record)
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/abstractrecord/RecordTypeManager.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/record/RecordTypeManager.java 2009-11-05 21:18:48 UTC (rev 30034)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/abstractrecord/RecordTypeManager.java 2009-11-05 21:46:49 UTC (rev 30037)
@@ -29,7 +29,7 @@
* $Id: RecordType.java 2342 2006-03-30 13:06:17Z $
*/
-package com.arjuna.ats.arjuna.coordinator.record;
+package com.arjuna.ats.arjuna.coordinator.abstractrecord;
import java.util.ArrayList;
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/abstractrecord/RecordTypeMap.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/record/RecordTypeMap.java 2009-11-05 21:18:48 UTC (rev 30034)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/abstractrecord/RecordTypeMap.java 2009-11-05 21:46:49 UTC (rev 30037)
@@ -29,7 +29,7 @@
* $Id: RecordType.java 2342 2006-03-30 13:06:17Z $
*/
-package com.arjuna.ats.arjuna.coordinator.record;
+package com.arjuna.ats.arjuna.coordinator.abstractrecord;
/**
* This allows users to define a mapping between record type integers
Copied: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/abstractrecords/LastResourceRecord.java (from rev 30034, labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/LastResourceRecord.java)
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/abstractrecords/LastResourceRecord.java (rev 0)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/abstractrecords/LastResourceRecord.java 2009-11-05 21:46:49 UTC (rev 30037)
@@ -0,0 +1,326 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2004,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: LastResourceRecord.java 2342 2006-03-30 13:06:17Z $
+ */
+
+package com.arjuna.ats.internal.arjuna.abstractrecords;
+
+import com.arjuna.ats.arjuna.logging.tsLogger;
+import com.arjuna.ats.arjuna.logging.FacilityCode;
+
+import com.arjuna.ats.arjuna.coordinator.*;
+import com.arjuna.ats.arjuna.common.*;
+
+import java.io.PrintWriter;
+
+import com.arjuna.common.util.logging.*;
+
+/**
+ * AbstractRecord that helps us do the last resource commit optimization.
+ * Basically this is something that is used to allow a *single* resource that is
+ * only one-phase aware to be enlisted with a transaction that is usually
+ * two-phase. The way it works is: (i) the coordinator runs its normal first
+ * (prepare) phase on all two-phase aware participants and makes a decision
+ * based solely on their responses as to whether to commit or roll back. Note,
+ * the one-phase aware resource essentially returns voteCommit during prepare,
+ * to ensure that the second phase runs even if all other resources return
+ * voteReadOnly. (ii) if the transaction is to commit then the coordinator
+ * invokes the second phase on *all* participants, starting with the one that is
+ * only one-phase aware. If it rolls back, it rolls all resources back, but the
+ * order is not important.
+ *
+ * @author Mark Little (mark at arjuna.com)
+ * @version $Id: LastResourceRecord.java 2342 2006-03-30 13:06:17Z $
+ * @since ATS 3.2.
+ */
+
+public class LastResourceRecord extends AbstractRecord
+{
+
+ public LastResourceRecord(OnePhaseResource opr)
+ {
+ super(ONE_PHASE_RESOURCE_UID);
+
+ if (tsLogger.arjLogger.isDebugEnabled())
+ {
+ tsLogger.arjLogger.debug(DebugLevel.CONSTRUCTORS,
+ VisibilityLevel.VIS_PUBLIC, FacilityCode.FAC_ABSTRACT_REC,
+ "LastResourceRecord()");
+ }
+
+ _lro = opr;
+ }
+
+ public boolean propagateOnCommit ()
+ {
+ return false;
+ }
+
+ public int typeIs ()
+ {
+ return RecordType.LASTRESOURCE;
+ }
+
+ public int nestedAbort ()
+ {
+ if (tsLogger.arjLogger.isDebugEnabled())
+ {
+ tsLogger.arjLogger.debug(DebugLevel.FUNCTIONS,
+ VisibilityLevel.VIS_PUBLIC, FacilityCode.FAC_ABSTRACT_REC,
+ "LastResourceRecord::nestedAbort() for " + order());
+ }
+
+ return TwoPhaseOutcome.FINISH_OK;
+ }
+
+ public int nestedCommit ()
+ {
+ if (tsLogger.arjLogger.isDebugEnabled())
+ {
+ tsLogger.arjLogger.debug(DebugLevel.FUNCTIONS,
+ VisibilityLevel.VIS_PUBLIC, FacilityCode.FAC_ABSTRACT_REC,
+ "LastResourceRecord::nestedCommit() for " + order());
+ }
+
+ return TwoPhaseOutcome.FINISH_ERROR;
+ }
+
+ /**
+ * Not allowed to participate in nested transactions.
+ */
+
+ public int nestedPrepare ()
+ {
+ if (tsLogger.arjLogger.isDebugEnabled())
+ {
+ tsLogger.arjLogger.debug(DebugLevel.FUNCTIONS,
+ VisibilityLevel.VIS_PUBLIC, FacilityCode.FAC_ABSTRACT_REC,
+ "LastResourceRecord::nestedPrepare() for " + order());
+ }
+
+ return TwoPhaseOutcome.PREPARE_NOTOK;
+ }
+
+ public int topLevelAbort ()
+ {
+ if (tsLogger.arjLogger.isDebugEnabled())
+ {
+ tsLogger.arjLogger.debug(DebugLevel.FUNCTIONS,
+ VisibilityLevel.VIS_PUBLIC, FacilityCode.FAC_ABSTRACT_REC,
+ "LastResourceRecord::topLevelAbort() for " + order());
+ }
+
+ if (_lro != null)
+ {
+ return _lro.rollback();
+ }
+ else
+ {
+ return TwoPhaseOutcome.FINISH_OK;
+ }
+ }
+
+ public int topLevelCommit ()
+ {
+ if (tsLogger.arjLogger.isDebugEnabled())
+ {
+ tsLogger.arjLogger.debug(DebugLevel.FUNCTIONS,
+ VisibilityLevel.VIS_PUBLIC, FacilityCode.FAC_ABSTRACT_REC,
+ "LastResourceRecord::topLevelCommit() for " + order());
+ }
+
+ return TwoPhaseOutcome.FINISH_OK;
+ }
+
+ public int topLevelPrepare ()
+ {
+ if (tsLogger.arjLogger.isDebugEnabled())
+ {
+ tsLogger.arjLogger.debug(DebugLevel.FUNCTIONS,
+ VisibilityLevel.VIS_PUBLIC, FacilityCode.FAC_ABSTRACT_REC,
+ "LastResourceRecord::topLevelPrepare() for " + order());
+ }
+
+ if ((_lro != null) && (_lro.commit() == TwoPhaseOutcome.FINISH_OK))
+ {
+ return TwoPhaseOutcome.PREPARE_OK;
+ }
+ else
+ return TwoPhaseOutcome.PREPARE_NOTOK;
+ }
+
+ public void print (PrintWriter strm)
+ {
+ strm.println("LastResource for:");
+ super.print(strm);
+ }
+
+ public String type ()
+ {
+ return "/StateManager/AbstractRecord/LastResourceRecord";
+ }
+
+ /**
+ * @message com.arjuna.ats.arjuna.lastResource.multipleWarning
+ * [com.arjuna.ats.arjuna.lastResource.multipleWarning] Multiple
+ * last resources have been added to the current transaction. This
+ * is transactionally unsafe and should not be relied upon. Current
+ * resource is {0}
+ * @message com.arjuna.ats.arjuna.lastResource.disallow
+ * [com.arjuna.ats.arjuna.lastResource.disallow] Adding multiple
+ * last resources is disallowed. Current resource is {0}
+ * @message com.arjuna.ats.arjuna.lastResource.startupWarning
+ * [com.arjuna.ats.arjuna.lastResource.startupWarning] You have
+ * chosen to enable multiple last resources in the transaction
+ * manager. This is transactionally unsafe and should not be relied
+ * upon.
+ * @message com.arjuna.ats.arjuna.lastResource.disableWarning
+ * [com.arjuna.ats.arjuna.lastResource.disableWarning] You have
+ * chosen to disable the Multiple Last Resources warning. You will
+ * see it only once.
+ */
+ public boolean shouldAdd (AbstractRecord a)
+ {
+ if (a.typeIs() == typeIs())
+ {
+ if (ALLOW_MULTIPLE_LAST_RESOURCES)
+ {
+ if (tsLogger.arjLoggerI18N.isWarnEnabled())
+ {
+ if (!_disableMLRWarning
+ || (_disableMLRWarning && !_issuedWarning))
+ {
+ tsLogger.arjLoggerI18N
+ .warn(
+ "com.arjuna.ats.arjuna.lastResource.multipleWarning",
+ new Object[]
+ { a });
+ _issuedWarning = true;
+ }
+ }
+
+ return true;
+ }
+ else
+ {
+ if (tsLogger.arjLoggerI18N.isWarnEnabled())
+ {
+ tsLogger.arjLoggerI18N.warn(
+ "com.arjuna.ats.arjuna.lastResource.disallow",
+ new Object[]
+ { a });
+ }
+
+ return false;
+ }
+ }
+ else
+ {
+ return true;
+ }
+ }
+
+ public boolean shouldMerge (AbstractRecord a)
+ {
+ return false;
+ }
+
+ public boolean shouldReplace (AbstractRecord a)
+ {
+ return false;
+ }
+
+ public boolean shouldAlter (AbstractRecord a)
+ {
+ return false;
+ }
+
+ public void merge (AbstractRecord a)
+ {
+ }
+
+ public void alter (AbstractRecord a)
+ {
+ }
+
+ /**
+ * @return <code>Object</code> to be used to order.
+ */
+
+ public Object value ()
+ {
+ return _lro;
+ }
+
+ public void setValue (Object o)
+ {
+ }
+
+ public LastResourceRecord()
+ {
+ super();
+
+ _lro = null;
+ }
+
+ private OnePhaseResource _lro;
+
+ private static final Uid ONE_PHASE_RESOURCE_UID = Uid.lastResourceUid();
+
+ private static final boolean ALLOW_MULTIPLE_LAST_RESOURCES;
+
+ private static boolean _disableMLRWarning = false;
+
+ private static boolean _issuedWarning = false;
+
+ static
+ {
+ ALLOW_MULTIPLE_LAST_RESOURCES = arjPropertyManager
+ .getCoreEnvironmentBean().isAllowMultipleLastResources();
+
+ if (ALLOW_MULTIPLE_LAST_RESOURCES
+ && tsLogger.arjLoggerI18N.isWarnEnabled())
+ {
+ tsLogger.arjLoggerI18N
+ .warn("com.arjuna.ats.arjuna.lastResource.startupWarning");
+ }
+
+ _disableMLRWarning = arjPropertyManager.getCoreEnvironmentBean()
+ .isDisableMultipleLastResourcesWarning();
+
+ if (arjPropertyManager.getCoreEnvironmentBean()
+ .isDisableMultipleLastResourcesWarning())
+ {
+ tsLogger.arjLoggerI18N
+ .warn("com.arjuna.ats.arjuna.lastResource.disableWarning");
+
+ _disableMLRWarning = true;
+ }
+ }
+}
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/atomicaction/LastResource.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/atomicaction/LastResource.java 2009-11-05 21:36:20 UTC (rev 30036)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/atomicaction/LastResource.java 2009-11-05 21:46:49 UTC (rev 30037)
@@ -34,8 +34,8 @@
import com.hp.mwtests.ts.arjuna.resources.*;
import com.arjuna.ats.arjuna.AtomicAction;
-import com.arjuna.ats.arjuna.LastResourceRecord;
import com.arjuna.ats.arjuna.coordinator.*;
+import com.arjuna.ats.internal.arjuna.abstractrecords.LastResourceRecord;
import org.junit.Test;
import static org.junit.Assert.*;
Modified: labs/jbosstm/trunk/ArjunaCore/txoj/classes/com/arjuna/ats/internal/txoj/Implementations.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/txoj/classes/com/arjuna/ats/internal/txoj/Implementations.java 2009-11-05 21:36:20 UTC (rev 30036)
+++ labs/jbosstm/trunk/ArjunaCore/txoj/classes/com/arjuna/ats/internal/txoj/Implementations.java 2009-11-05 21:46:49 UTC (rev 30037)
@@ -32,8 +32,8 @@
package com.arjuna.ats.internal.txoj;
import com.arjuna.ats.arjuna.coordinator.RecordType;
-import com.arjuna.ats.arjuna.coordinator.record.RecordTypeManager;
-import com.arjuna.ats.arjuna.coordinator.record.RecordTypeMap;
+import com.arjuna.ats.arjuna.coordinator.abstractrecord.RecordTypeManager;
+import com.arjuna.ats.arjuna.coordinator.abstractrecord.RecordTypeMap;
import com.arjuna.ats.txoj.LockRecord;
/**
Modified: labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/Implementations.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/Implementations.java 2009-11-05 21:36:20 UTC (rev 30036)
+++ labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/Implementations.java 2009-11-05 21:46:49 UTC (rev 30037)
@@ -32,8 +32,8 @@
package com.arjuna.ats.internal.jta;
import com.arjuna.ats.arjuna.coordinator.RecordType;
-import com.arjuna.ats.arjuna.coordinator.record.RecordTypeManager;
-import com.arjuna.ats.arjuna.coordinator.record.RecordTypeMap;
+import com.arjuna.ats.arjuna.coordinator.abstractrecord.RecordTypeManager;
+import com.arjuna.ats.arjuna.coordinator.abstractrecord.RecordTypeMap;
import com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord;
class XAResourceRecordMap implements RecordTypeMap
Modified: labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/transaction/arjunacore/TransactionImple.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/transaction/arjunacore/TransactionImple.java 2009-11-05 21:36:20 UTC (rev 30036)
+++ labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/transaction/arjunacore/TransactionImple.java 2009-11-05 21:46:49 UTC (rev 30037)
@@ -31,6 +31,7 @@
package com.arjuna.ats.internal.jta.transaction.arjunacore;
+import com.arjuna.ats.internal.arjuna.abstractrecords.LastResourceRecord;
import com.arjuna.ats.internal.jta.xa.TxInfo;
import com.arjuna.ats.internal.jta.utils.*;
import com.arjuna.ats.internal.jta.utils.arjunacore.StatusConverter;
@@ -47,7 +48,6 @@
import com.arjuna.ats.jta.logging.*;
import com.arjuna.ats.jta.xa.XAModifier;
-import com.arjuna.ats.arjuna.LastResourceRecord;
import com.arjuna.ats.arjuna.coordinator.*;
import com.arjuna.ats.arjuna.common.*;
Modified: labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/Implementationsx.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/Implementationsx.java 2009-11-05 21:36:20 UTC (rev 30036)
+++ labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/Implementationsx.java 2009-11-05 21:46:49 UTC (rev 30037)
@@ -32,8 +32,8 @@
package com.arjuna.ats.internal.jta;
import com.arjuna.ats.arjuna.coordinator.RecordType;
-import com.arjuna.ats.arjuna.coordinator.record.RecordTypeManager;
-import com.arjuna.ats.arjuna.coordinator.record.RecordTypeMap;
+import com.arjuna.ats.arjuna.coordinator.abstractrecord.RecordTypeManager;
+import com.arjuna.ats.arjuna.coordinator.abstractrecord.RecordTypeMap;
import com.arjuna.ats.internal.jta.resources.jts.orbspecific.XAResourceRecord;
class ExtendedXAResourceRecordMap implements RecordTypeMap
Modified: labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/Implementations.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/Implementations.java 2009-11-05 21:36:20 UTC (rev 30036)
+++ labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/Implementations.java 2009-11-05 21:46:49 UTC (rev 30037)
@@ -32,8 +32,8 @@
package com.arjuna.ats.internal.jts;
import com.arjuna.ats.arjuna.coordinator.RecordType;
-import com.arjuna.ats.arjuna.coordinator.record.RecordTypeManager;
-import com.arjuna.ats.arjuna.coordinator.record.RecordTypeMap;
+import com.arjuna.ats.arjuna.coordinator.abstractrecord.RecordTypeManager;
+import com.arjuna.ats.arjuna.coordinator.abstractrecord.RecordTypeMap;
/*
* Slightly different for historical reasons.
Modified: labs/jbosstm/trunk/XTS/recovery/src/org/jboss/jbossts/xts/recovery/coordinator/at/Implementations.java
===================================================================
--- labs/jbosstm/trunk/XTS/recovery/src/org/jboss/jbossts/xts/recovery/coordinator/at/Implementations.java 2009-11-05 21:36:20 UTC (rev 30036)
+++ labs/jbosstm/trunk/XTS/recovery/src/org/jboss/jbossts/xts/recovery/coordinator/at/Implementations.java 2009-11-05 21:46:49 UTC (rev 30037)
@@ -22,8 +22,8 @@
package org.jboss.jbossts.xts.recovery.coordinator.at;
import com.arjuna.ats.arjuna.coordinator.RecordType;
-import com.arjuna.ats.arjuna.coordinator.record.RecordTypeManager;
-import com.arjuna.ats.arjuna.coordinator.record.RecordTypeMap;
+import com.arjuna.ats.arjuna.coordinator.abstractrecord.RecordTypeManager;
+import com.arjuna.ats.arjuna.coordinator.abstractrecord.RecordTypeMap;
import com.arjuna.mwlabs.wscf.model.twophase.arjunacore.ParticipantRecord;
/**
Modified: labs/jbosstm/trunk/XTS/recovery/src/org/jboss/jbossts/xts/recovery/coordinator/ba/Implementations.java
===================================================================
--- labs/jbosstm/trunk/XTS/recovery/src/org/jboss/jbossts/xts/recovery/coordinator/ba/Implementations.java 2009-11-05 21:36:20 UTC (rev 30036)
+++ labs/jbosstm/trunk/XTS/recovery/src/org/jboss/jbossts/xts/recovery/coordinator/ba/Implementations.java 2009-11-05 21:46:49 UTC (rev 30037)
@@ -22,8 +22,8 @@
package org.jboss.jbossts.xts.recovery.coordinator.ba;
import com.arjuna.ats.arjuna.coordinator.RecordType;
-import com.arjuna.ats.arjuna.coordinator.record.RecordTypeManager;
-import com.arjuna.ats.arjuna.coordinator.record.RecordTypeMap;
+import com.arjuna.ats.arjuna.coordinator.abstractrecord.RecordTypeManager;
+import com.arjuna.ats.arjuna.coordinator.abstractrecord.RecordTypeMap;
import com.arjuna.mwlabs.wscf.model.sagas.arjunacore.ParticipantRecord;
/**
Modified: labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/ArjunaCore/AbstractRecord/CrashRecovery/setup/AddUserDefFirst0.java
===================================================================
--- labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/ArjunaCore/AbstractRecord/CrashRecovery/setup/AddUserDefFirst0.java 2009-11-05 21:36:20 UTC (rev 30036)
+++ labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/ArjunaCore/AbstractRecord/CrashRecovery/setup/AddUserDefFirst0.java 2009-11-05 21:46:49 UTC (rev 30037)
@@ -21,8 +21,9 @@
package org.jboss.jbossts.qa.ArjunaCore.AbstractRecord.CrashRecovery.setup;
import com.arjuna.ats.arjuna.coordinator.RecordType;
-import com.arjuna.ats.arjuna.coordinator.record.RecordTypeManager;
-import com.arjuna.ats.arjuna.coordinator.record.RecordTypeMap;
+import com.arjuna.ats.arjuna.coordinator.abstractrecord.RecordTypeManager;
+import com.arjuna.ats.arjuna.coordinator.abstractrecord.RecordTypeMap;
+
import org.jboss.jbossts.qa.ArjunaCore.AbstractRecord.CrashRecovery.impl.BasicAbstractRecord;
class UserDefFirst0Map implements RecordTypeMap
Modified: labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/ArjunaCore/AbstractRecord/CrashRecovery/setup/AddUserDefFirst1.java
===================================================================
--- labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/ArjunaCore/AbstractRecord/CrashRecovery/setup/AddUserDefFirst1.java 2009-11-05 21:36:20 UTC (rev 30036)
+++ labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/ArjunaCore/AbstractRecord/CrashRecovery/setup/AddUserDefFirst1.java 2009-11-05 21:46:49 UTC (rev 30037)
@@ -23,8 +23,8 @@
import org.jboss.jbossts.qa.ArjunaCore.AbstractRecord.CrashRecovery.impl.CrashAbstractRecord02;
import com.arjuna.ats.arjuna.coordinator.RecordType;
-import com.arjuna.ats.arjuna.coordinator.record.RecordTypeManager;
-import com.arjuna.ats.arjuna.coordinator.record.RecordTypeMap;
+import com.arjuna.ats.arjuna.coordinator.abstractrecord.RecordTypeManager;
+import com.arjuna.ats.arjuna.coordinator.abstractrecord.RecordTypeMap;
class UserDefFirst1Map implements RecordTypeMap
{
More information about the jboss-svn-commits
mailing list