PT
- Plugin type of the plugins being managed.public interface PTService<PT extends SciJavaPlugin> extends Service
SciJavaPlugin
.
There are many kinds of services, but most of them share one common characteristic: they provide API specific to a particular type of plugin. A few examples:
CommandService
works with
Command
s.TextService
works with
TextFormat
s.PlatformService
works with
Platform
s.
Most services fit this pattern in one way or another. When you wish to
provide a new extensibility point, you create a new type of
SciJavaPlugin
, and a corresponding PTService
for working with
it. Depending on the nature of your new plugin type, this service might be:
SingletonService
, such as
PlatformService
, which manages
SingletonPlugin
s.HandlerService
, such as TextService
,
which manages HandlerPlugin
s.WrapperService
, such as
WidgetService
, which manages
WrapperPlugin
s.
It is named PTService
rather than PluginTypeService
or
similar to avoid confusion with A) the PluginService
itself, and B)
any other service interface intended to define the API of a concrete service.
In contrast to such services, the PTService
is a more general layer
in a type hierarchy intended to ease creation of services that fit its
pattern.
SingletonService
,
TypedService
,
WrapperService
Modifier and Type | Method and Description |
---|---|
default <P extends PT> |
create(Class<P> pluginClass)
Creates an instance of the given plugin class.
|
default List<PluginInfo<PT>> |
getPlugins()
Gets the plugins managed by this service.
|
default PluginService |
getPluginService()
Deprecated.
Use
pluginService() instead. |
Class<PT> |
getPluginType()
Gets the type of plugins managed by this service.
|
default PluginService |
pluginService()
Gets the service responsible for discovering and managing this service's
plugins.
|
initialize, registerEventHandlers
getIdentifier, log
context, getContext, setContext
compareTo, getPriority, setPriority
getInfo, setInfo
getLocation
getVersion
dispose
default PluginService pluginService()
default List<PluginInfo<PT>> getPlugins()
default <P extends PT> P create(Class<P> pluginClass)
@Deprecated default PluginService getPluginService()
pluginService()
instead.Copyright © 2015–2022 SciJava. All rights reserved.