use of org.mobicents.slee.resource.jdbc.JdbcActivity in project charging-server by RestComm.
the class DataSourceSbb method executeTask.
// ---------------------------- Event Handlers ----------------------------
/**
* Simple method to create JDBC activity and execute given task.
*
* @param jdbcTask
*/
private void executeTask(SimpleJdbcTask jdbcTask) {
JdbcActivity jdbcActivity = jdbcRA.createActivity();
ActivityContextInterface jdbcACI = jdbcACIF.getActivityContextInterface(jdbcActivity);
jdbcACI.attach(sbbContextExt.getSbbLocalObject());
jdbcActivity.execute(jdbcTask);
}
use of org.mobicents.slee.resource.jdbc.JdbcActivity in project charging-server by RestComm.
the class DataSourceSbb method onJdbcTaskExecutionThrowableEvent.
/**
* Event handler for {@link JdbcTaskExecutionThrowableEvent}.
*
* @param event
* @param aci
*/
public void onJdbcTaskExecutionThrowableEvent(JdbcTaskExecutionThrowableEvent event, ActivityContextInterface aci) {
if (tracer.isWarningEnabled()) {
tracer.warning("Received a JdbcTaskExecutionThrowableEvent, as result of executed task " + event.getTask(), event.getThrowable());
}
// end jdbc activity
((JdbcActivity) aci.getActivity()).endActivity();
// call back parent
final SbbLocalObject parent = sbbContextExt.getSbbLocalObject().getParent();
final DataSourceJdbcTask jdbcTask = (DataSourceJdbcTask) event.getTask();
jdbcTask.callBackParentOnException(parent);
}
use of org.mobicents.slee.resource.jdbc.JdbcActivity in project charging-server by RestComm.
the class DataSourceSbb method onSimpleJdbcTaskResultEvent.
public void onSimpleJdbcTaskResultEvent(SimpleJdbcTaskResultEvent event, ActivityContextInterface aci) {
if (tracer.isFineEnabled()) {
tracer.fine("Received a SimpleJdbcTaskResultEvent, as result of executed task " + event.getTask());
}
// end jdbc activity
((JdbcActivity) aci.getActivity()).endActivity();
// call back parent
final SbbLocalObject parent = sbbContextExt.getSbbLocalObject().getParent();
final DataSourceJdbcTask jdbcTask = (DataSourceJdbcTask) event.getTask();
jdbcTask.callBackParentOnResult(parent);
}
Aggregations