01: /*
02: * $Id: CallEvent.java,v 1.8 2007/09/18 08:45:07 agoubard Exp $
03: *
04: * Copyright 2003-2007 Orange Nederland Breedband B.V.
05: * See the COPYRIGHT file for redistribution and use restrictions.
06: */
07: package org.xins.client.async;
08:
09: import java.util.EventObject;
10: import org.xins.client.AbstractCAPI;
11: import org.xins.client.AbstractCAPICallRequest;
12:
13: /**
14: * Event fired and the result of the call is returned.
15: *
16: * @version $Revision: 1.8 $ $Date: 2007/09/18 08:45:07 $
17: * @author <a href="mailto:anthony.goubard@japplis.com">Anthony Goubard</a>
18: *
19: * @since XINS 1.4.0
20: */
21: class CallEvent extends EventObject {
22:
23: /**
24: * Duration of the call.
25: */
26: private long _duration;
27:
28: /**
29: * Request of the call.
30: */
31: private AbstractCAPICallRequest _request;
32:
33: /**
34: * Creates a new call event.
35: *
36: * @param capi
37: * the CAPI used to call the function. The CAPI is used as the event source.
38: *
39: * @param request
40: * the request of the call to the function.
41: *
42: * @param duration
43: * the duration of the call.
44: */
45: protected CallEvent(AbstractCAPI capi,
46: AbstractCAPICallRequest request, long duration) {
47: super (capi);
48: _request = request;
49: _duration = duration;
50: }
51:
52: /**
53: * Gets the time it took to call the function.
54: *
55: * @return
56: * the duration of the call in milliseconds.
57: */
58: public long getDuration() {
59: return _duration;
60: }
61:
62: /**
63: * The request of the call.
64: *
65: * @return
66: * the request of the call to the function.
67: */
68: public AbstractCAPICallRequest getRequest() {
69: return _request;
70: }
71: }
|