Class Configuration


  • public class Configuration
    extends Object
    Provides interaction with the execution environment.
    Version:
    0.01
    Author:
    Simon Holdsworth, IBM Corporation
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String COMMIT_ONE_PHASE_DURING_RECOVERY  
      static String COMMIT_RETRY
      The property key used to specify the number of times the JTS should retry a commit or resync operation before giving up.
      static long COMMIT_RETRY_WAIT  
      static String DB_LOG_RESOURCE
      The property key used to specify the resource which will be used to wirte transaction logs.
      static int DEFAULT_INVALID
      getDirectory return value which indicates that the required directory was either not specified or was specified and invalid, and that the default subdirectory does not exist.
      static int DEFAULT_USED
      getDirectory return value which indicates that the required directory was either not specified or was specified and invalid, and that the default subdirectory exists.
      static int DIRECTORY_OK
      getDirectory return value which indicates that the required directory was specified and is OK.
      static String ERR_LOGGING
      Whether to write warnings and errors to jts.log file if this property has any value, it is active, otherwise it is inactive
      static int EXPECTED_CONCURRENT_THREADS
      The approximate concurrent transactions expected.
      static int EXPECTED_CONCURRENT_TRANSACTIONS
      The approximate concurrent transactions expected.
      static String HEURISTIC_DIRECTION
      The property key used to specify whether the JTS should assume a transaction is to be committed or rolled back if an outcome cannot be obtained during recovery.
      static String INSTANCE_NAME  
      static String JTS_SUBDIRECTORY
      The default subdirectory in which log and repository files are stored.
      static String KEYPOINT_COUNT
      The property key used to specify the number of transactions between keypoint operations on the log.
      static int LAO_PREPARE_OK  
      static String LOG_DIRECTORY
      The property key used to specify the directory to which transaction log files should be written.
      static String MANUAL_RECOVERY
      This property indicates that XA Resources would be passed in via the TM.recover() method, and that the recovery thread would have to wait until the resources are passed in.
      static String TIMEOUT_INTERVAL
      The property is used to specify the time interval in seconds for which the timeout manager would scan for timedout transactions.
      static String TRACE_DIRECTORY
      The property key used to specify the directory to which trace files and the error log should be written.
    • Constructor Summary

      Constructors 
      Constructor Description
      Configuration()  
    • Field Detail

      • TRACE_DIRECTORY

        public static final String TRACE_DIRECTORY
        The property key used to specify the directory to which trace files and the error log should be written.

        The value is com.sun.jts.traceDirectory.

        The default value used for this property is the current directory.

        See Also:
        Constant Field Values
      • LOG_DIRECTORY

        public static final String LOG_DIRECTORY
        The property key used to specify the directory to which transaction log files should be written.

        The value is com.sun.jts.logDirectory.

        The default value used for this property is the "jts" subdirectory from the current directory, if that exists, otherwise the current directory.

        See Also:
        Constant Field Values
      • DB_LOG_RESOURCE

        public static final String DB_LOG_RESOURCE
        The property key used to specify the resource which will be used to wirte transaction logs.

        The value is com.sun.jts.logResource.

        See Also:
        Constant Field Values
      • ERR_LOGGING

        public static final String ERR_LOGGING
        Whether to write warnings and errors to jts.log file if this property has any value, it is active, otherwise it is inactive
        See Also:
        Constant Field Values
      • MANUAL_RECOVERY

        public static final String MANUAL_RECOVERY
        This property indicates that XA Resources would be passed in via the TM.recover() method, and that the recovery thread would have to wait until the resources are passed in. If not set, the recovery thread would not wait for the XA Resources to be passed in.
        See Also:
        Constant Field Values
      • COMMIT_RETRY

        public static final String COMMIT_RETRY
        The property key used to specify the number of times the JTS should retry a commit or resync operation before giving up.

        The value is com.sun.jts.commitRetry.

        If this property has no value, retries continue indefinitely. A value of zero indicates that no retries should be made.

        See Also:
        Constant Field Values
      • HEURISTIC_DIRECTION

        public static final String HEURISTIC_DIRECTION
        The property key used to specify whether the JTS should assume a transaction is to be committed or rolled back if an outcome cannot be obtained during recovery. It should also be used by Resource objects if they cannot obtain an outcome during recovery and cannot make a decision.

        The value is com.sun.jts.heuristicDirection.

        The default is to assume that the transaction should be rolled back. If the value is '1', the transaction should be committed.

        See Also:
        Constant Field Values
      • KEYPOINT_COUNT

        public static final String KEYPOINT_COUNT
        The property key used to specify the number of transactions between keypoint operations on the log. Keypoint operations reduce the size of the transaction log files. A larger value for this property (for example, 1000) will result in larger transaction log files, but less keypoint operations, and hence better performance. a smaller value (e.g. 20) results in smaller log files but slightly reduced performance due to the greater frequency of keypoint operations.

        The value is com.sun.jts.keypointCount.

        The default value for this property is 100. If the value is specified as zero, then no keypoints are taken.

        See Also:
        Constant Field Values
      • TIMEOUT_INTERVAL

        public static final String TIMEOUT_INTERVAL
        The property is used to specify the time interval in seconds for which the timeout manager would scan for timedout transactions. A higher value would mean better performance, but at the cost of closeness to which coordinator timeout is effected.

        The value is com.sun.jts.timeoutInterval"

        This needs to be a positive integer value greater than 10. If the value is less than 10, illegal or unspecified a default value of 10 seconds is assumed.

        See Also:
        Constant Field Values
      • JTS_SUBDIRECTORY

        public static final String JTS_SUBDIRECTORY
        The default subdirectory in which log and repository files are stored.
        See Also:
        Constant Field Values
      • DIRECTORY_OK

        public static final int DIRECTORY_OK
        getDirectory return value which indicates that the required directory was specified and is OK.
        See Also:
        Constant Field Values
      • DEFAULT_USED

        public static final int DEFAULT_USED
        getDirectory return value which indicates that the required directory was either not specified or was specified and invalid, and that the default subdirectory exists. In this case the default subdirectory should be used.
        See Also:
        Constant Field Values
      • DEFAULT_INVALID

        public static final int DEFAULT_INVALID
        getDirectory return value which indicates that the required directory was either not specified or was specified and invalid, and that the default subdirectory does not exist. In this case the current directory should be used.
        See Also:
        Constant Field Values
      • EXPECTED_CONCURRENT_TRANSACTIONS

        public static final int EXPECTED_CONCURRENT_TRANSACTIONS
        The approximate concurrent transactions expected. This is used to set the capacity of Vectors etc.
        See Also:
        Constant Field Values
      • EXPECTED_CONCURRENT_THREADS

        public static final int EXPECTED_CONCURRENT_THREADS
        The approximate concurrent transactions expected. This is used to set the capacity of Vectors etc.
        See Also:
        Constant Field Values
    • Constructor Detail

      • Configuration

        public Configuration()
    • Method Detail

      • getDirectory

        public static String getDirectory​(String envDir,
                                          String defaultSubdirectory,
                                          int[] result)
        Returns a valid directory for a particular purpose. If the required directory is not valid, then a default subdirectory of the current directory is tried. If that is not valid either, then the current directory is used.
        Parameters:
        envDir - The environment variable containing the directory.
        defaultSubdirectory - The default subdirectory to use.
        result - A single-element array which will hold a value indicating whether the requested directory, default subdirectory, or current directory had to be used.
        Returns:
        The directory name.
      • setServerName

        public static final void setServerName​(String name,
                                               boolean recoverableServer)
        Sets the name of the server.
        Parameters:
        name - The server name. Non-recoverable servers have null.
      • getServerName

        public static final String getServerName()
        Returns the name of the server.

        Non-recoverable servers may not have a name, in which case the method returns null.

        Returns:
        The server name.
      • setServerName

        public static final void setServerName​(String logPath,
                                               String name)
        Sets the name of the server for the given log path. Added for delegated recovery support.
        Parameters:
        logPath - Location, where the logs are stored.
        name - The server name.
      • getServerName

        public static final String getServerName​(String logPath)
        Returns the name of the server for the given log path. Added for delegated recovery support.
        Parameters:
        logPath - location of the log files.
        Returns:
        The server name.
      • getServerNameByteArray

        public static final byte[] getServerNameByteArray()
        Returns a byte array with the name of the server.

        Non-recoverable servers may not have a name, in which case the method returns null.

        Returns:
        The server name (byte array).
      • setProperties

        public static final void setProperties​(Properties newProp)
        Sets the Properties object to be used for this JTS instance.
        Parameters:
        prop - The Properties.
      • getPropertyValue

        public static final String getPropertyValue​(String envValue)
        Returns the value of the given variable.
        Parameters:
        envValue - The environment variable required.
        Returns:
        The value.
      • setORB

        public static final void setORB​(org.omg.CORBA.ORB newORB)
        Sets the identity of the ORB.
        Parameters:
        newORB - The ORB.
      • getORB

        public static final org.omg.CORBA.ORB getORB()
        Returns the identity of the ORB.
        Returns:
        The ORB.
      • setFactory

        public static final void setFactory​(org.omg.CosTransactions.TransactionFactory newFactory,
                                            boolean localTxFactory)
        Sets the identity of the TransactionFactory and indicates if it is local or remote.
        Parameters:
        newFactory - The TransactionFactory.
        localFactory - Indicates if the factory is local or remote.
      • getFactory

        public static final org.omg.CosTransactions.TransactionFactory getFactory()
        Returns the identity of the TransactionFactory.
        Returns:
        The TransactionFactory.
      • isLocalFactory

        public static final boolean isLocalFactory()
        Determines whether we hava a local factory or a remote factory.
        Returns:
        Indicates whether we have a local factory.
      • isRecoverable

        public static final boolean isRecoverable()
        Determines whether the JTS instance is recoverable.
        Returns:
        Indicates whether the JTS is recoverable.
      • setProxyChecker

        public static final void setProxyChecker​(com.sun.jts.CosTransactions.ProxyChecker newChecker)
        Sets the identity of the ProxyChecker.
        Parameters:
        newChecker - The new ProxyChecker.
      • getProxyChecker

        public static final com.sun.jts.CosTransactions.ProxyChecker getProxyChecker()
        Returns the identity of the ProxyChecker.
        Returns:
        The ProxyChecker.
      • setLogFile

        public static final void setLogFile​(com.sun.jts.CosTransactions.LogFile newLogFile)
        Sets the identity of the log file for the process.
        Parameters:
        logFile - The new LogFile object.
      • getLogFile

        public static final com.sun.jts.CosTransactions.LogFile getLogFile()
        Returns the identity of the LogFile for the process.
        Returns:
        The LogFile.
      • setLogFile

        public static final void setLogFile​(String logPath,
                                            com.sun.jts.CosTransactions.LogFile newLogFile)
        Sets the log file for the given log path. For delegated recovery support.
        Parameters:
        logPath - The new LogFile object.
        newLogFile - The new LogFile object.
      • getLogFile

        public static final com.sun.jts.CosTransactions.LogFile getLogFile​(String logPath)
        Returns the LogFile for the given log path. For delegated recovery support.
        Parameters:
        logPath - log location.
        Returns:
        The LogFile.
      • setPOA

        public static final void setPOA​(String type,
                                        org.omg.PortableServer.POA poa)
        Sets the identity of the POA to be used for the given types of object.
        Parameters:
        type - The type of objects to use the POA.
        POA - The POA object.
      • getPOA

        public static final org.omg.PortableServer.POA getPOA​(String type)
        Returns the identity of the POA to be used for the given type of objects.
        Parameters:
        type - The type of objects
        Returns:
        The POA.
      • isTraceEnabled

        public static final boolean isTraceEnabled()
      • enableTrace

        public static final void enableTrace()
      • disableTrace

        public static final void disableTrace()
      • setKeypointTrigger

        public static void setKeypointTrigger​(int keypoint)
      • setCommitRetryVar

        public static void setCommitRetryVar​(String commitRetryString)
      • getRetries

        public static int getRetries()
      • setAsAppClientConatiner

        public static void setAsAppClientConatiner​(boolean value)
      • isAppClientContainer

        public static boolean isAppClientContainer()
      • isDBLoggingEnabled

        public static boolean isDBLoggingEnabled()
      • disableFileLogging

        public static void disableFileLogging()
      • isFileLoggingDisabled

        public static boolean isFileLoggingDisabled()