use of com.sun.enterprise.transaction.monitoring.TransactionServiceStatsProvider in project Payara by payara.
the class JavaEETransactionManagerSimplified method initProperties.
private void initProperties() {
// FIXME: this maxEntry should be a config
int maxEntries = 8192;
// FIXME: this loadFactor should be a config
float loadFactor = 0.75f;
// for now, let's get it from system prop
try {
String mEnlistDelists = System.getProperty("ALLOW_MULTIPLE_ENLISTS_DELISTS");
if ("true".equals(mEnlistDelists)) {
multipleEnlistDelists = true;
if (_logger.isLoggable(Level.FINE))
_logger.log(Level.FINE, "TM: multiple enlists, delists are enabled");
}
String maxEntriesValue = System.getProperty("JTA_RESOURCE_TABLE_MAX_ENTRIES");
if (maxEntriesValue != null) {
int temp = Integer.parseInt(maxEntriesValue);
if (temp > 0) {
maxEntries = temp;
}
}
String loadFactorValue = System.getProperty("JTA_RESOURCE_TABLE_DEFAULT_LOAD_FACTOR");
if (loadFactorValue != null) {
float f = Float.parseFloat(loadFactorValue);
if (f > 0) {
loadFactor = f;
}
}
} catch (Exception ex) {
// ignore
}
resourceTable = new BaseCache();
((BaseCache) resourceTable).init(maxEntries, loadFactor, null);
if (habitat != null) {
TransactionService txnService = habitat.getService(TransactionService.class, ServerEnvironment.DEFAULT_INSTANCE_NAME);
// running on the server side ?
if (txnService != null) {
transactionTimeout = Integer.parseInt(txnService.getTimeoutInSeconds());
// the delegates will do the rest if they support it
String v = txnService.getPropertyValue("purge-cancelled-transactions-after");
if (v != null && v.length() > 0) {
purgeCancelledTtransactions = Integer.parseInt(v);
}
TransactionServiceConfigListener listener = habitat.getService(TransactionServiceConfigListener.class);
listener.setTM(this);
}
ModuleMonitoringLevels levels = habitat.getService(ModuleMonitoringLevels.class);
// running on the server side ?
if (levels != null) {
String level = levels.getTransactionService();
if (!("OFF".equals(level))) {
monitoringEnabled = true;
}
}
}
// ENF OF BUG 4665539
if (_logger.isLoggable(Level.FINE))
_logger.log(Level.FINE, "TM: Tx Timeout = " + transactionTimeout);
// START IASRI 4705808 TTT004 -- monitor resource table stats
try {
// XXX TODO:
if (Boolean.getBoolean("MONITOR_JTA_RESOURCE_TABLE_STATISTICS")) {
registerStatisticMonitorTask();
}
StatsProviderManager.register(// element in domain.xml <monitoring-service>/<monitoring-level>
"transaction-service", // server.transaction-service node in asadmin get
PluginPoint.SERVER, // server.transaction-service node in asadmin get
"transaction-service", new TransactionServiceStatsProvider(this, _logger));
} catch (Exception ex) {
// ignore
}
monitor = new TransactionServiceProbeProvider();
}
Aggregations