Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * JBoss, Home of Professional Open Source
   * Copyright 2009, 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) 2009,
  * @author JBoss, a division of Red Hat.
  */
 package com.arjuna.ats.arjuna.common;
 
A JavaBean containing configuration properties for the core transaction coordinator.

Author(s):
Jonathan Halliday (jonathan.halliday@redhat.com)
 
 @PropertyPrefix(prefix = "com.arjuna.ats.arjuna.coordinator.")
 {
     private volatile boolean asyncCommit = false;
     private volatile boolean asyncPrepare = false;
     private volatile boolean asyncRollback = false;
     private volatile boolean commitOnePhase = true;
     private volatile boolean maintainHeuristics = true;
     private volatile boolean transactionLog = false// rename to useTransactionLog ?
 
     private volatile int maxTwoPhaseCommitThreads = 100;
 
     // public static final String TRANSACTION_LOG_REMOVAL_MARKER = "com.arjuna.ats.arjuna.coordinator.transactionLog.removalMarker";
     //private String removalMarker;
 
     @FullPropertyName(name = "com.arjuna.ats.arjuna.coordinator.transactionLog.writeOptimisation")
     private volatile boolean writeOptimisation = false;
 
     private volatile boolean readonlyOptimisation = true;
     private volatile boolean classicPrepare = false;
     private volatile boolean enableStatistics = false;
     private volatile boolean sharedTransactionLog = false;
     private volatile boolean startDisabled = false// rename/repurpose to 'enable'?
     private volatile String txReaperMode = "DYNAMIC"// rename bool txReaperModeDynamic?
 
     private volatile long txReaperTimeout = .;
     private volatile int txReaperZombieMax = .;
 
     private volatile int defaultTimeout = 60; // seconds
     private volatile boolean transactionStatusManagerEnable = true;
 
     @FullPropertyName(name = "com.arjuna.ats.coordinator.beforeCompletionWhenRollbackOnly")
     private volatile boolean beforeCompletionWhenRollbackOnly = false;
 
     @FullPropertyName(name = "com.arjuna.ats.coordinator.checkedActionFactory")
     private volatile String checkedActionFactoryClassName = "com.arjuna.ats.internal.arjuna.coordinator.CheckedActionFactoryImple";
     private volatile CheckedActionFactory checkedActionFactory = null;
 
     private volatile boolean alternativeRecordOrdering = false;
 
     private volatile String communicationStore = HashedActionStore.class.getName();
 
     private volatile boolean finalizeBasicActions = false;

    
Returns true if anynchronous commit behaviour is enabled. Default: false Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.asyncCommit

Returns:
true if asynchronous commit is enabled, value otherwise.
 
     public boolean isAsyncCommit()
     {
         return ;
     }

    
Sets if asynchronous commit behaviour should be enabled or not. Note: heuristics cannot be reported programatically if asynchronous commit is used.

Parameters:
asyncCommit true to enable asynchronous commit, false to disable.
    public void setAsyncCommit(boolean asyncCommit)
    {
        this. = asyncCommit;
    }

    
Returns true if asynchronous prepare behaviour is enabled. Default: false Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.asyncPrepare

Returns:
true if asynchronous prepare is enabled, false otherwise.
    public boolean isAsyncPrepare()
    {
        return ;
    }

    
Sets if asynchronous prepare behaviour should be enabled or not.

Parameters:
asyncPrepare true to enable asynchronous prepare, false to disable.
    public void setAsyncPrepare(boolean asyncPrepare)
    {
        this. = asyncPrepare;
    }

    
Returns true if asynchronous rollback behaviour is enabled. Default: false Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.asyncRollback

Returns:
true if asynchronous rollback is enabled, false otherwise.
    public boolean isAsyncRollback()
    {
        return ;
    }

    
Sets if asynchronous rollback behaviour should be enabled or not.

Parameters:
asyncRollback true to enable asynchronous rollback, false to disable.
    public void setAsyncRollback(boolean asyncRollback)
    {
        this. = asyncRollback;
    }
    public int getMaxTwoPhaseCommitThreads() {
        return ;
    }
    public void setMaxTwoPhaseCommitThreads(int maxTwoPhaseCommitThreads) {
        this. = maxTwoPhaseCommitThreads;
    }

    
Returns true if one phase commit optimization is to be used. Default: true Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.commitOnePhase

Returns:
true if one phase commit is enabled, false otherwise.
    public boolean isCommitOnePhase()
    {
        return ;
    }

    
Sets if one phase commit behaviour is enabled or not.

Parameters:
commitOnePhase true to enable, false to disable.
    public void setCommitOnePhase(boolean commitOnePhase)
    {
        this. = commitOnePhase;
    }

    
Returns true if heuristic outcomes should be recorded. Default: true Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.maintainHeuristics

Returns:
true if heuristics should be recorded, false otherwise.
    public boolean isMaintainHeuristics()
    {
        return ;
    }

    
Sets if heuristics should be recorded or not.

Parameters:
maintainHeuristics true to enable recording of heuristics, false to disable.
    public void setMaintainHeuristics(boolean maintainHeuristics)
    {
        this. = maintainHeuristics;
    }

    
Returns true if write optimisation protocol should be used for PersistenceRecord. Default: false Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.transactionLog.writeOptimisation

Returns:
true if write optimisation is enabled, false otherwise.
    public boolean isWriteOptimisation()
    {
        return ;
    }

    
Sets if write optimization protocol should be used for PersistenceRecord.

Parameters:
writeOptimisation true to enable write optimization, false to disable.
    public void setWriteOptimisation(boolean writeOptimisation)
    {
        this. = writeOptimisation;
    }

    
Returns true if handling of read only resources should be optimized. Default: true Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.readonlyOptimisation

Returns:
true if read only optimization is enabled, false otherwise.
    public boolean isReadonlyOptimisation()
    {
        return ;
    }

    
Sets if handling of read only resources should be optimized.

Parameters:
readonlyOptimisation true to enable read only optimization, false to disable.
    public void setReadonlyOptimisation(boolean readonlyOptimisation)
    {
        this. = readonlyOptimisation;
    }

    
Returns true if the old sytle of prepare handling should be used for PersistenceRecord. Default: false Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.classicPrepare

Returns:
true is classic prepare handling is enabled, false otherwise.
    public boolean isClassicPrepare()
    {
        return ;
    }

    
Sets if old sytle prepare handling should be used for PersistenceRecord.

Parameters:
classicPrepare true to enable classic prepare handling, false to disable.
    public void setClassicPrepare(boolean classicPrepare)
    {
        this. = classicPrepare;
    }

    
Returns true if transaction statistics should be recorded. Note: Enabling statistics may have a slight performance impact due to locking on the counter variables. Default: false Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.enableStatistics Effect: immediate.

Returns:
true if recording of transaction statistics is enabled, false otherwise.
    public boolean isEnableStatistics()
    {
        return ;
    }

    
Sets if transaction statistics should be recorded or not.

Parameters:
enableStatistics true to enable statistics gathering, false to disable.
    public void setEnableStatistics(boolean enableStatistics)
    {
        this. = enableStatistics;
    }

    
Returns if the transaction log sould be run in shared mode or not. Default: false Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.sharedTransactionLog

Returns:
true if transaction log sharing is enabled, false otherwise.
    public boolean isSharedTransactionLog()
    {
        return ;
    }

    
Sets if the transaction log should be run in shared mode or not.

Parameters:
sharedTransactionLog true to enable transaction log sharing, false to disable.
    public void setSharedTransactionLog(boolean sharedTransactionLog)
    {
        this. = sharedTransactionLog;
    }

    
Returns if the transaction manager should be created in a disabled state or not. Default: false (i.e. transaction manager is enabled on creation) Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.startDisabled

Returns:
true if the transaction manager will start in a disabled state, false otherwise.
    public boolean isStartDisabled()
    {
        return ;
    }

    
Sets if the transaction manager should be created in a disabled state or not.

Parameters:
startDisabled true to start in a diabled state, false to start enabled.
    public void setStartDisabled(boolean startDisabled)
    {
        this. = startDisabled;
    }

    
Returns the operating mode of the transaction timeout processing system. Default: "DYNAMIC" Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.txReaperMode

Returns:
the operating mode of the transaction reaper.
    public String getTxReaperMode()
    {
        return ;
    }

    
Sets the operating mode of the transaction timeout processing system.

Parameters:
txReaperMode the name of the required operating mode.
    public void setTxReaperMode(String txReaperMode)
    {
        this. = txReaperMode;
    }

    
Returns the timeout (wakeup) interval of the reaper's PERIODIC mode, in milliseconds. Default: 120000ms Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.txReaperTimeout

Returns:
the sleep interval of the transaction reaper, in milliseconds.
    public long getTxReaperTimeout()
    {
        return ;
    }

    
Sets the timeout interval of the transaction reaper.

Parameters:
txReaperTimeout the reaper sleep interval, in milliseconds.
    public void setTxReaperTimeout(long txReaperTimeout)
    {
        this. = txReaperTimeout;
    }

    
Returns the number of millisecs delay afer a cancel is scheduled, before the reaper tries to interrupt the worker thread executing the cancel. Default: 500ms Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.txReaperCancelWaitPeriod

Returns:
the reaper cancel wait period, in milliseconds.
    public long getTxReaperCancelWaitPeriod()
    {
        return ;
    }

    
Sets the delay to allow a cancel to be processed before interrupting it.

Parameters:
txReaperCancelWaitPeriod in milliseconds.
    public void setTxReaperCancelWaitPeriod(long txReaperCancelWaitPeriod)
    {
        this. = txReaperCancelWaitPeriod;
    }

    
Returns the number of millisecs delay afer a worker thread is interrupted, before the reaper writes the it off as a zombie and starts a new thread. Default: 500ms Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.txReaperCancelFailWaitPeriod

Returns:
the reaper cancel wait fail period, in milliseconds.
    public long getTxReaperCancelFailWaitPeriod()
    {
        return ;
    }

    
Sets the delay to allow an interrupted cancel to be cleaned up.

Parameters:
txReaperCancelFailWaitPeriod in milliseconds.
    public void setTxReaperCancelFailWaitPeriod(long txReaperCancelFailWaitPeriod)
    {
        this. = txReaperCancelFailWaitPeriod;
    }

    
Returns the threshold for count of non-exited zombies at which the system starts logging error messages. Default: 8 Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.txReaperZombieMax

Returns:
the number of zombie threads at which errors will start being reported.
    public int getTxReaperZombieMax()
    {
        return ;
    }

    
Sets the threshold number of zombie threads at which errors will start to be reported.

Parameters:
txReaperZombieMax the number of threads.
    public void setTxReaperZombieMax(int txReaperZombieMax)
    {
        this. = txReaperZombieMax;
    }

    
Returns the default interval after which a transaction may be considered for timeout, in seconds. Note: depending on the reaper mode and workload, transactions may not be timed out immediately. Default: 60 Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.defaultTimeout

Returns:
the default transaction lifetime, in seconds.
    public int getDefaultTimeout()
    {
        return ;
    }

    
Sets the default lifetime after which a transaction may be considered for timeout, in seconds.

Parameters:
defaultTimeout the default transaction lifetime, in seconds.
    public void setDefaultTimeout(int defaultTimeout)
    {
        this. = defaultTimeout;
    }

    
Returns if the transaction status manager (TSM) service, needed for out of process recovery, should be provided or not. Default: true Equivalent deprecated property: com.arjuna.ats.arjuna.coordinator.transactionStatusManagerEnable

Returns:
true is the transaction status manager is enabled, false otherwise.
    public boolean isTransactionStatusManagerEnable()
    {
        return ;
    }

    
Sets if the transaction status manager service should be provided or not.

Parameters:
transactionStatusManagerEnable true to enable the TSM, false to disable.
    public void setTransactionStatusManagerEnable(boolean transactionStatusManagerEnable)
    {
        this. = transactionStatusManagerEnable;
    }

    
Returns if beforeCompletion should be called on Synchronizations when completing transactions that are marked rollback only. Default: false Equivalent deprecated property: com.arjuna.ats.coordinator.beforeCompletionWhenRollbackOnly

Returns:
true if beforeCompletion will be called in rollback only cases, false otherwise.
    public boolean isBeforeCompletionWhenRollbackOnly()
    {
        return ;
    }

    
Sets if beforeCompletion should be called on transactions that are set rollback only.

Parameters:
beforeCompletionWhenRollbackOnly true to call beforeCompletions on rollback only tx, false to skip them.
    public void setBeforeCompletionWhenRollbackOnly(boolean beforeCompletionWhenRollbackOnly)
    {
        this. = beforeCompletionWhenRollbackOnly;
    }

    
Returns the class name of an implementation of CheckedActionFactory Default: "com.arjuna.ats.internal.arjuna.coordinator.CheckedActionFactoryImple" Equivalent deprecated property: com.arjuna.ats.coordinator.checkedActionFactory

Returns:
the class name of the CheckedActionFactory implementation to use.
    {
        return ;
    }

    
Sets the class name of the CheckedActionFactory implementation.

Parameters:
checkedActionFactoryClassName the name of a class that implements CheckedActionFactory.
    public void setCheckedActionFactoryClassName(String checkedActionFactoryClassName)
    {
        synchronized(this)
        {
            if(checkedActionFactoryClassName == null)
            {
                this. = null;
            }
            else if(!checkedActionFactoryClassName.equals(this.))
            {
                this. = null;
            }
            this. = checkedActionFactoryClassName;
        }
    }

    
Returns an instance of a class implementing CheckedActionFactory. If there is no pre-instantiated instance set and classloading or instantiation fails, this method will log appropriate warning and return null, not throw an exception.

Returns:
a CheckedActionFactory implementation instance, or null.
    {
        if( == null &&  != null)
        {
            synchronized (this) {
                if( == null &&  != null) {
                    try
                    {
                        CheckedActionFactory instance = ClassloadingUtility.loadAndInstantiateClass(CheckedActionFactory.classnull);
                         = instance;
                    }
                    catch (final java.lang.RuntimeException ex// todo android
                    {
                        if (Utility.isAndroid())
                             = new CheckedActionFactoryImple();
                        else
                            throw ex;
                    }
                }
            }
        }
        return ;
    }

    
Sets the instance of CheckedActionFactory.

Parameters:
instance an Object that implements CheckedActionFactory, or null.
    public void setCheckedActionFactory(CheckedActionFactory instance)
    {
        synchronized(this)
        {
            CheckedActionFactory oldInstance = this.;
             = instance;
            if(instance == null)
            {
                this. = null;
            }
            else if(instance != oldInstance)
            {
                String name = ClassloadingUtility.getNameForClass(instance);
                this. = name;
            }
        }
    }


    
Whether to use the alternative abstract record ordering. At present this is not fully documented, so stay away! Default: false

Returns:
true if order abstract records on type first, or false if order on Uid first.
    public boolean isAlternativeRecordOrdering()
    {
        return ;
    }

    
Set whether or not to use the alternative abstract record ordering. Don't try this whilst the system is running!

Parameters:
alternativeRecordOrdering true for alternative (i.e. type) ordering, false for normal (i.e. Uid) ordering.
    public void setAlternativeRecordOrdering(boolean alternativeRecordOrdering)
    {
        this. = alternativeRecordOrdering;
    }

    
Returns the symbolic name for the communication store type. Default: "HashedActionStore"

Returns:
the communication store name.
    public String getCommunicationStore()
    {
        return ;
    }

    
Sets the symbolic name of the communication store.

Parameters:
communicationStore the communication store name.
    public void setCommunicationStore(String communicationStore)
    {
        this. = communicationStore;
    }

    
Sets whether or not to use finalizers for BasicActions (i.e. transactions). This can provide a useful safety net to ensure cleanup of locks and other resources, but does not perform well. In most cases it's preferable to set a transaction timeout and rely on the reaper for cleanup. Default: false

Returns:
true if a finalize method should be registered for BasicActions instances, false otherwise.
    public boolean isFinalizeBasicActions()
    {
        return ;
    }

    
Sets whether or not to use finalizers for BasicActions (i.e. transactions).

Parameters:
finalizeBasicActions true to enable finalization, false to disable.
    public void setFinalizeBasicActions(boolean finalizeBasicActions)
    {
        this. = finalizeBasicActions;
    }
New to GrepCode? Check out our FAQ X