PT
- Plugin type of the plugins being managed.public interface SingletonService<PT extends SingletonPlugin> extends PTService<PT>
SingletonPlugin
s of a particular type. The
SingletonService
creates and maintain a list of singleton instances.
Note that like PTService
, TypedService
and
WrapperService
, SingletonService
is 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.
PTService
Modifier and Type | Method and Description |
---|---|
default <P extends PT> |
create(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> |
getInstance(Class<P> pluginClass)
Gets the singleton plugin instance of the given class.
|
List<PT> |
getInstances()
Gets the list of plugin instances.
|
default void |
initialize()
Performs any needed initialization when the service is first loaded.
|
default ObjectService |
objectService()
Gets the
ObjectService upon which this service depends. |
getPlugins, getPluginService, getPluginType, pluginService
registerEventHandlers
getIdentifier, log
context, getContext, setContext
compareTo, getPriority, setPriority
getInfo, setInfo
getLocation
getVersion
dispose
default ObjectService objectService()
ObjectService
upon which this service depends.List<PT> getInstances()
<P extends PT> P getInstance(Class<P> pluginClass)
default List<? extends PT> filterInstances(List<PT> list)
list
- the initial list of instancesdefault <P extends PT> P create(Class<P> pluginClass)
PTService
create
in interface PTService<PT extends SingletonPlugin>
default void initialize()
Service
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.
initialize
in interface Initializable
initialize
in interface Service
Copyright © 2015–2022 SciJava. All rights reserved.