|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.confluence.util.profiling.NopActivityMonitor
@Internal @ParametersAreNonnullByDefault public class NopActivityMonitor
Provides an implementation of the ActivityMonitor that does nothing.
Useful if you are in situations (legacy code) that does not have access to the real service.
| Field Summary | |
|---|---|
static NopActivityMonitor |
INSTANCE
|
| 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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final NopActivityMonitor INSTANCE
| Method Detail |
|---|
@Nonnull
public Activity registerStart(String userId,
String type,
String summary)
ActivityMonitorActivity.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
}
registerStart in interface ActivityMonitoruserId - 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 public Collection<ActivitySnapshot> snapshotCurrent()
ActivityMonitor
snapshotCurrent in interface ActivityMonitor
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||