
Figure 23.9: Call Duration SBB creation
public void onCallConnected(JccConnectionEvent event,
ActivityContextInterface aci) {
JccConnection connection = event.getConnection();
long startTime = System.currentTimeMillis();
trace(Level.FINE, "Call from " + connection.getAddress().getName());
this.setStartTime(startTime);
try {
if (connection.isBlocked())
connection.continueProcessing();
} catch (Exception e) {
trace(Level.WARNING, "ERROR: exception caught in continueProcessing()", e);
}
}
The SBB stores the current time in a CMP field in order to calculate the call duration at a later stage. Finally, the SBB executes
the
continueProcessing()
method in the JCC connection, and the connection is unblocked.
Using the
findsbbs
command of the Command Console, it can be seen that there is an SBB handling each established call.
[Rhino@localhost (#2)] findsbbs -service JCC\ Call\ Duration\ 1.0,\ Open\ Cloud
pkey creation-time parent-pkey replicated sbb-component-id service-component-id
---- -------------- ------------ ----------- ---------------- --------
101:31421066918:0 20051102 12:58:14 false JCC Call Duration SBB^Open Cloud^1.0 JCC Call Duration^Open Cloud^1.0
1 rows
OnCallDisconnected and onCallFailed method – Service Garbage Collection
The SBB is listening to Call Disconnected and Call Failed events, as we can see in the deployment descriptor file for this
service:
Open Cloud Rhino 1.4.3 Administration Manual v1.1 166
Commentaires sur ces manuels