org.scijava.usage
Class DefaultUsageService
java.lang.Object
org.scijava.AbstractContextual
org.scijava.plugin.AbstractRichPlugin
org.scijava.service.AbstractService
org.scijava.usage.DefaultUsageService
- All Implemented Interfaces:
- Comparable<Prioritized>, Contextual, Disposable, HasPluginInfo, RichPlugin, SciJavaPlugin, Prioritized, SciJavaService, Service, UsageService
public class DefaultUsageService
- extends AbstractService
- implements UsageService
Default service for tracking anonymous usage statistics.
Please note that that this implementation is not thread safe. It is
up to the caller to ensure that multiple threads do not attempt to modify
statistics at the same time. One way to do that (but not the only way) is to
only call increment(Object)
from the event dispatch thread (i.e.,
when ThreadService.isDispatchThread()
returns true). And one easy way
to accomplish that is by calling the UsageService
only from event
handler methods.
- Author:
- Curtis Rueden
DefaultUsageService
public DefaultUsageService()
getStats
public Map<String,UsageStats> getStats()
- Description copied from interface:
UsageService
- Gets the table of usage statistics.
- Specified by:
getStats
in interface UsageService
clearStats
public void clearStats()
- Description copied from interface:
UsageService
- Clears the table of usage statistics.
- Specified by:
clearStats
in interface UsageService
getUsage
public UsageStats getUsage(Object o)
- Description copied from interface:
UsageService
- Gets the given object's usage statistics.
- Specified by:
getUsage
in interface UsageService
increment
public void increment(Object o)
- Description copied from interface:
UsageService
- Increments the given object's usage count.
- Specified by:
increment
in interface UsageService
Copyright © 2009–2014 SciJava. All rights reserved.