|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
@Internal @ParametersAreNonnullByDefault public interface ActivityMonitor
Represents the ability to record current activity in the system. It is expected that activities to be monitored are
registered as starting using registerStart(String, String, String) and finishing using
Activity.close().
| Method Summary | |
|---|---|
Activity |
registerStart(String userId,
String type,
String summary)
Starts tracking an activity using the current thread. |
Collection<ActivitySnapshot> |
snapshotCurrent()
Returns an immutable snapshot of the current activity in the system. |
| Method Detail |
|---|
@Nonnull
Activity registerStart(String userId,
String type,
String summary)
Activity.close()
on the returned Activity after the activity has completed.
The typical usage is:
final Activity activity = activityMonitor.registerStart(userId, type, summary);
try {
// code to execute
}
finally {
activity.close();
}
Under Java 7, the following is also possible:
try (Activity activity = activityMonitor.registerStart(userId, type, summary)) {
// code to execute
}
userId - the identifier of the user associated with the activity.type - the type of activity being performed. E.g. web-requestsummary - a textual summary of the activity. E.g. /some/url.action@Nonnull Collection<ActivitySnapshot> snapshotCurrent()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||