com.sun.jts.CosTransactions
Class Configuration

java.lang.Object
  extended by com.sun.jts.CosTransactions.Configuration

public class Configuration
extends java.lang.Object

Provides interaction with the execution environment.

Version:
0.01
Author:
Simon Holdsworth, IBM Corporation
See Also:

Field Summary
static java.lang.String COMMIT_ONE_PHASE_DURING_RECOVERY
           
static java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.String INSTANCE_NAME
           
static java.lang.String JTS_SUBDIRECTORY
          The default subdirectory in which log and repository files are stored.
static java.lang.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 java.lang.String LOG_DIRECTORY
          The property key used to specify the directory to which transaction log files should be written.
static java.lang.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 java.lang.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 java.lang.String TRACE_DIRECTORY
          The property key used to specify the directory to which trace files and the error log should be written.
 
Constructor Summary
Configuration()
           
 
Method Summary
static void disableFileLogging()
           
static void disableTrace()
           
static void enableTrace()
           
static java.lang.String getDirectory(java.lang.String envDir, java.lang.String defaultSubdirectory, int[] result)
          Returns a valid directory for a particular purpose.
static org.omg.CosTransactions.TransactionFactory getFactory()
          Returns the identity of the TransactionFactory.
static com.sun.jts.CosTransactions.LogFile getLogFile()
          Returns the identity of the LogFile for the process.
static com.sun.jts.CosTransactions.LogFile getLogFile(java.lang.String logPath)
          Returns the LogFile for the given log path.
static org.omg.CORBA.ORB getORB()
          Returns the identity of the ORB.
static org.omg.PortableServer.POA getPOA(java.lang.String type)
          Returns the identity of the POA to be used for the given type of objects.
static java.lang.String getPropertyValue(java.lang.String envValue)
          Returns the value of the given variable.
static com.sun.jts.CosTransactions.ProxyChecker getProxyChecker()
          Returns the identity of the ProxyChecker.
static int getRetries()
           
static java.lang.String getServerName()
          Returns the name of the server.
static java.lang.String getServerName(java.lang.String logPath)
          Returns the name of the server for the given log path.
static byte[] getServerNameByteArray()
          Returns a byte array with the name of the server.
static boolean isAppClientContainer()
           
static boolean isDBLoggingEnabled()
           
static boolean isFileLoggingDisabled()
           
static boolean isLocalFactory()
          Determines whether we hava a local factory or a remote factory.
static boolean isRecoverable()
          Determines whether the JTS instance is recoverable.
static boolean isTraceEnabled()
           
static void setAsAppClientConatiner(boolean value)
           
static void setCommitRetryVar(java.lang.String commitRetryString)
           
static void setFactory(org.omg.CosTransactions.TransactionFactory newFactory, boolean localTxFactory)
          Sets the identity of the TransactionFactory and indicates if it is local or remote.
static void setKeypointTrigger(int keypoint)
           
static void setLogFile(com.sun.jts.CosTransactions.LogFile newLogFile)
          Sets the identity of the log file for the process.
static void setLogFile(java.lang.String logPath, com.sun.jts.CosTransactions.LogFile newLogFile)
          Sets the log file for the given log path.
static void setORB(org.omg.CORBA.ORB newORB)
          Sets the identity of the ORB.
static void setPOA(java.lang.String type, org.omg.PortableServer.POA poa)
          Sets the identity of the POA to be used for the given types of object.
static void setProperties(java.util.Properties newProp)
          Sets the Properties object to be used for this JTS instance.
static void setProxyChecker(com.sun.jts.CosTransactions.ProxyChecker newChecker)
          Sets the identity of the ProxyChecker.
static void setServerName(java.lang.String name, boolean recoverableServer)
          Sets the name of the server.
static void setServerName(java.lang.String logPath, java.lang.String name)
          Sets the name of the server for the given log path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMMIT_ONE_PHASE_DURING_RECOVERY

public static final java.lang.String COMMIT_ONE_PHASE_DURING_RECOVERY
See Also:
Constant Field Values

LAO_PREPARE_OK

public static final int LAO_PREPARE_OK
See Also:
Constant Field Values

COMMIT_RETRY_WAIT

public static final long COMMIT_RETRY_WAIT
See Also:
Constant Field Values

TRACE_DIRECTORY

public static final java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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

INSTANCE_NAME

public static final java.lang.String INSTANCE_NAME
See Also:
Constant Field Values

TIMEOUT_INTERVAL

public static final java.lang.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 java.lang.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 java.lang.String getDirectory(java.lang.String envDir,
                                            java.lang.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.
See Also:

setServerName

public static final void setServerName(java.lang.String name,
                                       boolean recoverableServer)
Sets the name of the server.

Parameters:
name - The server name. Non-recoverable servers have null.
See Also:

getServerName

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

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

Parameters:
-
Returns:
The server name.
See Also:

setServerName

public static final void setServerName(java.lang.String logPath,
                                       java.lang.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.
See Also:

getServerName

public static final java.lang.String getServerName(java.lang.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.
See Also:

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.

Parameters:
-
Returns:
The server name (byte array).
See Also:

setProperties

public static final void setProperties(java.util.Properties newProp)
Sets the Properties object to be used for this JTS instance.

Parameters:
prop - The Properties.
See Also:

getPropertyValue

public static final java.lang.String getPropertyValue(java.lang.String envValue)
Returns the value of the given variable.

Parameters:
envValue - The environment variable required.
Returns:
The value.
See Also:

setORB

public static final void setORB(org.omg.CORBA.ORB newORB)
Sets the identity of the ORB.

Parameters:
newORB - The ORB.
See Also:

getORB

public static final org.omg.CORBA.ORB getORB()
Returns the identity of the ORB.

Parameters:
-
Returns:
The ORB.
See Also:

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.
See Also:

getFactory

public static final org.omg.CosTransactions.TransactionFactory getFactory()
Returns the identity of the TransactionFactory.

Parameters:
-
Returns:
The TransactionFactory.
See Also:

isLocalFactory

public static final boolean isLocalFactory()
Determines whether we hava a local factory or a remote factory.

Parameters:
-
Returns:
Indicates whether we have a local factory.
See Also:

isRecoverable

public static final boolean isRecoverable()
Determines whether the JTS instance is recoverable.

Parameters:
-
Returns:
Indicates whether the JTS is recoverable.
See Also:

setProxyChecker

public static final void setProxyChecker(com.sun.jts.CosTransactions.ProxyChecker newChecker)
Sets the identity of the ProxyChecker.

Parameters:
newChecker - The new ProxyChecker.
See Also:

getProxyChecker

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

Parameters:
-
Returns:
The ProxyChecker.
See Also:

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.
See Also:

getLogFile

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

Parameters:
-
Returns:
The LogFile.
See Also:

setLogFile

public static final void setLogFile(java.lang.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.
See Also:

getLogFile

public static final com.sun.jts.CosTransactions.LogFile getLogFile(java.lang.String logPath)
Returns the LogFile for the given log path. For delegated recovery support.

Parameters:
logPath - log location.
Returns:
The LogFile.
See Also:

setPOA

public static final void setPOA(java.lang.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.
See Also:

getPOA

public static final org.omg.PortableServer.POA getPOA(java.lang.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.
See Also:

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(java.lang.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()


Copyright © 2012 GlassFish Community. All Rights Reserved.