Package org.scijava.object
Class DefaultObjectService
- java.lang.Object
-
- org.scijava.AbstractContextual
-
- org.scijava.plugin.AbstractRichPlugin
-
- org.scijava.service.AbstractService
-
- org.scijava.object.DefaultObjectService
-
- All Implemented Interfaces:
Comparable<Prioritized>,Contextual,Disposable,Identifiable,Initializable,Locatable,Logged,ObjectService,HasPluginInfo,RichPlugin,SciJavaPlugin,Prioritized,SciJavaService,Service,Versioned
public final class DefaultObjectService extends AbstractService implements ObjectService
Default service for keeping track of registered objects. Automatically registers new objects fromObjectCreatedEvents, and removes objects fromObjectDeletedEvents.This is useful to retrieve available objects of a particular type. For example, the
InputHarvesterinfrastructure uses it to provide a pool of available objects for widgets such as theObjectWidget, which provide the user with a multiple-choice selection.- Author:
- Curtis Rueden
-
-
Constructor Summary
Constructors Constructor Description DefaultObjectService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EventServiceeventService()NamedObjectIndex<Object>getIndex()Gets the index of available objects.voidinitialize()Performs any needed initialization when the service is first loaded.protected voidonEvent(ObjectCreatedEvent event)protected voidonEvent(ObjectDeletedEvent event)-
Methods inherited from class org.scijava.service.AbstractService
getContext, setContext, toString
-
Methods inherited from class org.scijava.plugin.AbstractRichPlugin
getInfo, getPriority, setInfo, setPriority
-
Methods inherited from class org.scijava.AbstractContextual
context
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
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.object.ObjectService
addObject, addObject, getEventService, getName, getObjects, removeObject
-
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
registerEventHandlers
-
Methods inherited from interface org.scijava.Versioned
getVersion
-
-
-
-
Method Detail
-
eventService
public EventService eventService()
- Specified by:
eventServicein interfaceObjectService
-
getIndex
public NamedObjectIndex<Object> getIndex()
Description copied from interface:ObjectServiceGets the index of available objects.- Specified by:
getIndexin interfaceObjectService
-
initialize
public 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
-
onEvent
protected void onEvent(ObjectCreatedEvent event)
-
onEvent
protected void onEvent(ObjectDeletedEvent event)
-
-