Interface PTService<PT extends SciJavaPlugin>
-
- Type Parameters:
PT- Plugin type of the plugins being managed.
- All Superinterfaces:
Comparable<Prioritized>,Contextual,Disposable,HasPluginInfo,Identifiable,Initializable,Locatable,Logged,Prioritized,RichPlugin,SciJavaPlugin,Service,Versioned
- All Known Subinterfaces:
AppService,CommandService,ConsoleService,ConvertService,DataHandleService,DragAndDropService,HandlerService<DT,PT>,IOService,LocationService,OptionsService,PlatformService,RunService,ScriptHeaderService,ScriptProcessorService,ScriptService,SingletonService<PT>,TextIOService,TextService,ToolService,TypedIOService<D>,TypedService<DT,PT>,WidgetService,WrapperService<DT,PT>
- All Known Implementing Classes:
AbstractConvertService,AbstractHandlerService,AbstractPTService,AbstractSingletonService,AbstractTypedIOService,AbstractTypedService,AbstractWrapperService,DefaultAppService,DefaultCommandService,DefaultConsoleService,DefaultConvertService,DefaultDataHandleService,DefaultDragAndDropService,DefaultIOService,DefaultLocationService,DefaultOptionsService,DefaultPlatformService,DefaultRunService,DefaultScriptHeaderService,DefaultScriptProcessorService,DefaultScriptService,DefaultTextIOService,DefaultTextService,DefaultToolService,DefaultWidgetService
public interface PTService<PT extends SciJavaPlugin> extends Service
A service for managing a particular sort ofSciJavaPlugin.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:
- The
CommandServiceworks withCommands. - The
TextServiceworks withTextFormats. - The
PlatformServiceworks withPlatforms.
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 correspondingPTServicefor working with it. Depending on the nature of your new plugin type, this service might be:- A
SingletonService, such asPlatformService, which managesSingletonPlugins. - A
HandlerService, such asTextService, which managesHandlerPlugins. - A
WrapperService, such asWidgetService, which managesWrapperPlugins.
It is named
PTServicerather thanPluginTypeServiceor similar to avoid confusion with A) thePluginServiceitself, and B) any other service interface intended to define the API of a concrete service. In contrast to such services, thePTServiceis a more general layer in a type hierarchy intended to ease creation of services that fit its pattern.- Author:
- Curtis Rueden
- See Also:
SingletonService,TypedService,WrapperService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default <P extends PT>
Pcreate(Class<P> pluginClass)Creates an instance of the given plugin class.default List<PluginInfo<PT>>getPlugins()Gets the plugins managed by this service.default PluginServicegetPluginService()Deprecated.UsepluginService()instead.Class<PT>getPluginType()Gets the type of plugins managed by this service.default PluginServicepluginService()Gets the service responsible for discovering and managing this service's plugins.-
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.RichPlugin
getIdentifier, log
-
Methods inherited from interface org.scijava.service.Service
initialize, registerEventHandlers
-
Methods inherited from interface org.scijava.Versioned
getVersion
-
-
-
-
Method Detail
-
pluginService
default PluginService pluginService()
Gets the service responsible for discovering and managing this service's plugins.
-
getPlugins
default List<PluginInfo<PT>> getPlugins()
Gets the plugins managed by this service.
-
create
default <P extends PT> P create(Class<P> pluginClass)
Creates an instance of the given plugin class.
-
getPluginService
@Deprecated default PluginService getPluginService()
Deprecated.UsepluginService()instead.
-
-