Search in sources :

Example 6 with RequestTraceSpanLog

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;
}
Also used : RequestTraceSpanLog(fish.payara.notification.requesttracing.RequestTraceSpanLog)

Example 7 with RequestTraceSpanLog

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;
}
Also used : RequestTraceSpanLog(fish.payara.notification.requesttracing.RequestTraceSpanLog) PluginPoint(org.glassfish.external.probe.provider.PluginPoint)

Example 8 with RequestTraceSpanLog

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();
        }
    }
}
Also used : JavaEETransaction(com.sun.enterprise.transaction.api.JavaEETransaction) RequestTraceSpanLog(fish.payara.notification.requesttracing.RequestTraceSpanLog)

Example 9 with RequestTraceSpanLog

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;
}
Also used : RequestTraceSpanLog(fish.payara.notification.requesttracing.RequestTraceSpanLog)

Example 10 with RequestTraceSpanLog

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);
}
Also used : RequestTraceSpanLog(fish.payara.notification.requesttracing.RequestTraceSpanLog)

Aggregations

RequestTraceSpanLog (fish.payara.notification.requesttracing.RequestTraceSpanLog)11 JavaEETransaction (com.sun.enterprise.transaction.api.JavaEETransaction)2 RuntimeJobExecution (com.ibm.jbatch.container.jobinstance.RuntimeJobExecution)1 Timestamp (java.sql.Timestamp)1 PluginPoint (org.glassfish.external.probe.provider.PluginPoint)1