Package org.scijava.plugin
Interface SingletonService<PT extends SingletonPlugin>
-
- Type Parameters:
PT- Plugin type of the plugins being managed.
- All Superinterfaces:
Comparable<Prioritized>,Contextual,Disposable,HasPluginInfo,Identifiable,Initializable,Locatable,Logged,Prioritized,PTService<PT>,RichPlugin,SciJavaPlugin,Service,Versioned
- All Known Subinterfaces:
AppService,ConsoleService,ConvertService,DragAndDropService,HandlerService<DT,PT>,IOService,LocationService,OptionsService,PlatformService,RunService,ScriptHeaderService,ScriptService,TextIOService,TextService,ToolService,TypedIOService<D>
- All Known Implementing Classes:
AbstractConvertService,AbstractHandlerService,AbstractSingletonService,AbstractTypedIOService,DefaultAppService,DefaultConsoleService,DefaultConvertService,DefaultDragAndDropService,DefaultIOService,DefaultLocationService,DefaultOptionsService,DefaultPlatformService,DefaultRunService,DefaultScriptHeaderService,DefaultScriptService,DefaultTextIOService,DefaultTextService,DefaultToolService
public interface SingletonService<PT extends SingletonPlugin> extends PTService<PT>
A service for managingSingletonPlugins of a particular type. TheSingletonServicecreates and maintain a list of singleton instances.Note that like
PTService,TypedServiceandWrapperService,SingletonServiceis not a service interface defining API for a specific concrete service implementation, but rather a more general layer in a type hierarchy intended to ease creation of services that fit its pattern.- Author:
- Curtis Rueden
- See Also:
PTService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <P extends PT>
Pcreate(Class<P> pluginClass)Creates an instance of the given plugin class.default List<? extends PT>filterInstances(List<PT> list)Filters the given list of instances by this service's inclusion criteria.<P extends PT>
PgetInstance(Class<P> pluginClass)Gets the singleton plugin instance of the given class.List<PT>getInstances()Gets the list of plugin instances.default voidinitialize()Performs any needed initialization when the service is first loaded.default ObjectServiceobjectService()Gets theObjectServiceupon which this service depends.-
Methods inherited from interface org.scijava.Contextual
context, getContext, setContext
-
Methods inherited from interface org.scijava.Disposable
dispose
-
Methods inherited from interface org.scijava.plugin.HasPluginInfo
getInfo, setInfo
-
Methods inherited from interface org.scijava.Locatable
getLocation
-
Methods inherited from interface org.scijava.Prioritized
compareTo, getPriority, setPriority
-
Methods inherited from interface org.scijava.plugin.PTService
getPlugins, getPluginService, getPluginType, pluginService
-
Methods inherited from interface org.scijava.plugin.RichPlugin
getIdentifier, log
-
Methods inherited from interface org.scijava.service.Service
registerEventHandlers
-
Methods inherited from interface org.scijava.Versioned
getVersion
-
-
-
-
Method Detail
-
objectService
default ObjectService objectService()
Gets theObjectServiceupon which this service depends.
-
getInstances
List<PT> getInstances()
Gets the list of plugin instances. There will be one singleton instance for each available plugin.
-
getInstance
<P extends PT> P getInstance(Class<P> pluginClass)
Gets the singleton plugin instance of the given class.
-
filterInstances
default List<? extends PT> filterInstances(List<PT> list)
Filters the given list of instances by this service's inclusion criteria.- Parameters:
list- the initial list of instances- Returns:
- the filtered list of instances
-
create
default <P extends PT> P create(Class<P> pluginClass)
Description copied from interface:PTServiceCreates an instance of the given plugin class.- Specified by:
createin interfacePTService<PT extends SingletonPlugin>
-
initialize
default void initialize()
Description copied from interface:ServicePerforms any needed initialization when the service is first loaded.NB: This method is not intended to be called directly. It is called by the service framework itself (specifically by the
ServiceHelper) when initializing the service. It should not be called a second time.- Specified by:
initializein interfaceInitializable- Specified by:
initializein interfaceService
-
-