use of fish.payara.notification.requesttracing.RequestTraceSpanLog in project Payara by payara.
the class RequestTracingListener method constructJDBCSpanLog.
/**
* Constructs a Request tracing event for the JDBC event
* @param record The SQL record to log
* @return RequestEvent to be traced
*/
private RequestTraceSpanLog constructJDBCSpanLog(SQLTraceRecord record) {
RequestTraceSpanLog spanLog = new RequestTraceSpanLog("jdbcContextEvent");
spanLog.addLogEntry("Method Name", record.getMethodName());
spanLog.addLogEntry("Parameters", Arrays.toString(record.getParams()));
spanLog.addLogEntry("Pool Name", record.getPoolName());
spanLog.addLogEntry("Thread ID", Long.toString(record.getThreadID()));
spanLog.addLogEntry("Thread Name", record.getThreadName());
spanLog.addLogEntry("Execution Time", Long.toString(record.getExecutionTime()));
return spanLog;
}
use of fish.payara.notification.requesttracing.RequestTraceSpanLog in project Payara by payara.
the class JavaEETransactionManagerSimplified method constructJTAEndSpanLog.
private RequestTraceSpanLog constructJTAEndSpanLog(JavaEETransaction transaction) throws SystemException {
RequestTraceSpanLog spanLog = new RequestTraceSpanLog("jtaContextEndEvent");
if (transaction.getClass().equals(JavaEETransactionImpl.class)) {
JavaEETransactionImpl tx = (JavaEETransactionImpl) transaction;
spanLog.addLogEntry("Transaction ID", (tx.getTransactionId()));
}
// Check if transaction was rolled back or committed
int status = transaction.getStatus();
switch(status) {
case 3:
spanLog.addLogEntry("Status", "Committed");
break;
case 4:
spanLog.addLogEntry("Status", "Rolled Back");
break;
default:
spanLog.addLogEntry("Status", Integer.toString(status));
break;
}
return spanLog;
}
use of fish.payara.notification.requesttracing.RequestTraceSpanLog in project Payara by payara.
the class JavaEETransactionManagerSimplified method rollback.
public void rollback() throws IllegalStateException, SecurityException, SystemException {
boolean acquiredlock = false;
try {
JavaEETransaction tx = transactions.get();
if (tx != null && tx.isLocalTx()) {
if (monitoringEnabled) {
// XXX acquireReadLock();
getDelegate().getReadLock().lock();
acquiredlock = true;
}
// rollback local tx
tx.rollback();
} else {
try {
// an XA transaction
getDelegate().rollbackDistributedTransaction();
} finally {
if (tx != null) {
((JavaEETransactionImpl) tx).onTxCompletion(false);
}
}
}
if (requestTracing != null && getRequestTracing().isRequestTracingEnabled()) {
RequestTraceSpanLog spanLog = constructJTAEndSpanLog(tx);
getRequestTracing().addSpanLog(spanLog);
}
} finally {
// clear current thread's tx
setCurrentTransaction(null);
delegates.set(null);
if (acquiredlock) {
// XXX releaseReadLock();
getDelegate().getReadLock().unlock();
}
}
}
use of fish.payara.notification.requesttracing.RequestTraceSpanLog in project Payara by payara.
the class JavaEETransactionManagerSimplified method initJavaEETransaction.
private JavaEETransactionImpl initJavaEETransaction(int timeout) {
JavaEETransactionImpl tx = null;
// Do not need to use injection.
if (timeout > 0)
tx = new JavaEETransactionImpl(timeout, this);
else
tx = new JavaEETransactionImpl(this);
setCurrentTransaction(tx);
if (requestTracing != null && getRequestTracing().isRequestTracingEnabled()) {
RequestTraceSpanLog spanLog = constructJTABeginSpanLog(tx);
getRequestTracing().addSpanLog(spanLog);
}
return tx;
}
use of fish.payara.notification.requesttracing.RequestTraceSpanLog in project Payara by payara.
the class SafeProperties method onEjbMethodStart.
final void onEjbMethodStart(String method_sig) {
ejbProbeNotifier.ejbMethodStartEvent(getContainerId(), callFlowInfo.getApplicationName(), callFlowInfo.getModuleName(), callFlowInfo.getComponentName(), method_sig);
if (requestTracing.isRequestTracingEnabled()) {
RequestTraceSpanLog spanLog = constructEjbMethodSpanLog(callFlowInfo, true);
requestTracing.addSpanLog(spanLog);
}
// callFlowAgent.ejbMethodStart(callFlowInfo);
}
Aggregations