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 from ImageJ:
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 |
---|---|
<P extends PT> |
create(Class<P> pluginClass)
Creates an instance of the given plugin class.
|
List<PluginInfo<PT>> |
getPlugins()
Gets the plugins managed by this service.
|
PluginService |
getPluginService()
Gets the service responsible for discovering and managing this service's
plugins.
|
Class<PT> |
getPluginType()
Gets the type of plugins managed by this service.
|
initialize, registerEventHandlers
context, getContext, setContext
getPriority, setPriority
compareTo
getInfo, setInfo
dispose
PluginService getPluginService()
List<PluginInfo<PT>> getPlugins()
Copyright © 2009–2015 SciJava. All rights reserved.