Fields Summary |
---|
private static String | serverName |
private static byte[] | serverNameByteArray |
private static org.omg.CORBA.ORB | orb |
private static Properties | prop |
private static TransactionFactory | factory |
private static boolean | localFactory |
private static boolean | recoverable |
private static ProxyChecker | checker |
private static LogFile | logFile |
private static Hashtable | poas |
private static String | dbLogResource |
private static boolean | disableFileLogging |
private static Hashtable | logPathToServernametable |
private static Hashtable | logPathToFiletable |
private static int | retries |
public static final int | LAO_PREPARE_OK |
public static final long | COMMIT_RETRY_WAIT |
private static boolean | isAppClient |
static Logger | _loggerThe traceOn would enable/disable JTS wide tracing;
(Related class: com.sun.jts.trace.TraceUtil)
- kannan.srinivasan@Sun.COM 27Nov2001 |
public static boolean | traceOn |
public static final String | TRACE_DIRECTORYThe 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. |
public static final String | LOG_DIRECTORYThe 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. |
public static final String | DB_LOG_RESOURCEThe property key used to specify the resource which will be used to wirte
transaction logs.
The value is com.sun.jts.logResource.
|
public static final String | ERR_LOGGINGWhether to write warnings and errors to jts.log file
if this property has any value, it is active, otherwise it is inactive |
public static final String | MANUAL_RECOVERYThis 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. |
public static final String | COMMIT_RETRYThe 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. |
public static final String | HEURISTIC_DIRECTIONThe 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. |
public static final String | KEYPOINT_COUNTThe 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. |
public static final String | INSTANCE_NAME |
public static final String | TIMEOUT_INTERVALThe 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. |
public static final String | JTS_SUBDIRECTORYThe default subdirectory in which log and repository files are stored. |
public static final int | DIRECTORY_OKgetDirectory return value which indicates that the required directory was
specified and is OK. |
public static final int | DEFAULT_USEDgetDirectory 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. |
public static final int | DEFAULT_INVALIDgetDirectory 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. |
public static final int | EXPECTED_CONCURRENT_TRANSACTIONSThe approximate concurrent transactions expected. This is used to set the capacity of Vectors etc. |
public static final int | EXPECTED_CONCURRENT_THREADSThe approximate concurrent transactions expected. This is used to set the capacity of Vectors etc. |
Methods Summary |
---|
public static void | disableFileLogging()
disableFileLogging = true;
|
public static final void | disableTrace()
traceOn = false;
|
public static final void | enableTrace()
traceOn = true;
|
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.
/*1*/
// Get the environment variable value.
String envValue = null;
if( prop != null )
envValue = prop.getProperty(envDir);
// If the environment variable is not set, or does not refer to a valid
// directory, then try to use a default.
result[0] = DIRECTORY_OK;
if( envValue == null || envValue.length() == 0 ||
!new File(envValue).isDirectory() ) {
result[0] = DEFAULT_USED;
// If the default subdirectory is not valid, then use the current directory.
envValue = new String("."+File.separator+defaultSubdirectory/*#Frozen*/);
if( !new File(envValue).isDirectory() ) {
result[0] = DEFAULT_INVALID;
}
}
if(_logger.isLoggable(Level.FINE))
{
String dirType="";
switch(result[0]){
case DEFAULT_INVALID:
dirType="used default, but is invalid";
break;
case DEFAULT_USED :
dirType="used default";
break;
case DIRECTORY_OK:
dirType="provided in configuration";
break;
default:
dirType="invalid type";
break;
}
_logger.logp(Level.FINE,"Configuration","getDirectory()",
"Using directory = " + envValue + " : "+dirType);
}
return envValue;
|
public static final TransactionFactory | getFactory()Returns the identity of the TransactionFactory.
// Return the TransactionFactory identity.
return factory;
|
public static final LogFile | getLogFile()Returns the identity of the LogFile for the process.
return logFile;
|
public static final LogFile | getLogFile(java.lang.String logPath)Returns the LogFile for the given log path. For delegated recovery support.
if (logPath == null) return null;
return (LogFile)logPathToFiletable.get(logPath);
|
public static final org.omg.CORBA.ORB | getORB()Returns the identity of the ORB.
// Return the ORB identity.
return orb;
|
public static final POA | getPOA(java.lang.String type)Returns the identity of the POA to be used for the given type of objects.
POA result = (POA)poas.get(type);
return result;
|
public static final java.lang.String | getPropertyValue(java.lang.String envValue)Returns the value of the given variable.
// Get the environment variable value.
String result = null;
if( prop != null )
{
result = prop.getProperty(envValue);
if(_logger.isLoggable(Level.FINE))
{
_logger.log(Level.FINE,"Property :"+ envValue +
" has the value : " + result);
}
}
return result;
|
public static final ProxyChecker | getProxyChecker()Returns the identity of the ProxyChecker.
return checker;
|
public static int | getRetries()
return retries;
|
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.
// Determine the server name.
String result = serverName;
return result;
|
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.
return (String)logPathToServernametable.get(logPath);
|
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.
// Determine the server name.
byte [] result = serverNameByteArray;
return result;
|
public static boolean | isAppClientContainer()
return isAppClient;
|
static boolean | isDBLoggingEnabled()
if (dbLogResource == null)
return false;
else
return true;
|
static boolean | isFileLoggingDisabled()
return disableFileLogging;
|
public static final boolean | isLocalFactory()Determines whether we hava a local factory or a remote factory.
// This is a local factory if localFactory is TRUE
boolean result = localFactory;
return result;
|
public static final boolean | isRecoverable()Determines whether the JTS instance is recoverable.
// This JTS is recoverable if recoverable is set to TRUE.
boolean result = recoverable;
return result;
|
public static final boolean | isTraceEnabled()
return traceOn;
|
public static void | setAsAppClientConatiner(boolean value)
isAppClient = value;
|
public static void | setCommitRetryVar(java.lang.String commitRetryString)
// RegisteredResources.setCommitRetryVar(commitRetryString);
if (commitRetryString != null) {
int retriesInMinutes = Integer.parseInt(commitRetryString,10);
if ((retriesInMinutes % (COMMIT_RETRY_WAIT / 1000)) == 0)
retries = (int)(retriesInMinutes / (COMMIT_RETRY_WAIT / 1000));
else
retries = ((int)(retriesInMinutes / (COMMIT_RETRY_WAIT / 1000))) + 1;
}
|
public static final void | setFactory(TransactionFactory newFactory, boolean localTxFactory)Sets the identity of the TransactionFactory and indicates if it is local
or remote.
// Store the factory identity and if it is local or not.
factory = newFactory;
localFactory = localTxFactory;
|
public static void | setKeypointTrigger(int keypoint)
CoordinatorLogPool.getCoordinatorLog().setKeypointTrigger(keypoint);
|
public static final void | setLogFile(LogFile newLogFile)Sets the identity of the log file for the process.
// Store the logFile identity.
logFile = newLogFile;
|
public static final void | setLogFile(java.lang.String logPath, LogFile newLogFile)Sets the log file for the given log path. For delegated recovery support.
logPathToFiletable.put(logPath, newLogFile);
|
public static final void | setORB(org.omg.CORBA.ORB newORB)Sets the identity of the ORB.
// Store the ORB identity.
orb = newORB;
|
public static final void | setPOA(java.lang.String type, POA poa)Sets the identity of the POA to be used for the given types of object.
// Store the mapping.
poas.put(type,poa);
|
public static final void | setProperties(java.util.Properties newProp)Sets the Properties object to be used for this JTS instance.
// Store the Properties object.
if (prop == null)
prop = newProp;
else if (newProp != null)
prop.putAll(newProp);
if(_logger.isLoggable(Level.FINE))
{
String propertiesList = LogFormatter.convertPropsToString(prop);
_logger.logp(Level.FINE,"Configuration","setProperties()",
" Properties set are :"+ propertiesList);
}
if (prop != null) {
dbLogResource = prop.getProperty(DB_LOG_RESOURCE);
String retryLimit = prop.getProperty(COMMIT_RETRY);
int retriesInMinutes;
if (retryLimit != null) {
retriesInMinutes = Integer.parseInt(retryLimit,10);
if ((retriesInMinutes % (COMMIT_RETRY_WAIT / 1000)) == 0)
retries = (int)(retriesInMinutes / (COMMIT_RETRY_WAIT / 1000));
else
retries = ((int)((retriesInMinutes / (COMMIT_RETRY_WAIT / 1000)))) + 1;
}
}
|
public static final void | setProxyChecker(ProxyChecker newChecker)Sets the identity of the ProxyChecker.
// Store the checker identity.
checker = newChecker;
|
public static final void | setServerName(java.lang.String name, boolean recoverableServer)Sets the name of the server.
// Store the server name.
serverName = name;
serverNameByteArray = (name == null) ? null : serverName.getBytes();
recoverable = recoverableServer;
if(recoverable)
RecoveryManager.createRecoveryFile(serverName);
if(_logger.isLoggable(Level.FINE))
{
_logger.logp(Level.FINE,"Configuration" ,"setServerName()",
" serverName = " +
serverName + "; isRecoverable = " + recoverable);
}
|
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.
logPathToServernametable.put(logPath, name);
|